use of android.app.IActivityManager.ContentProviderHolder in project android_frameworks_base by ParanoidAndroid.
the class ContentProviderRecord method newHolder.
public ContentProviderHolder newHolder(ContentProviderConnection conn) {
ContentProviderHolder holder = new ContentProviderHolder(info);
holder.provider = provider;
holder.noReleaseNeeded = noReleaseNeeded;
holder.connection = conn;
return holder;
}
use of android.app.IActivityManager.ContentProviderHolder in project platform_frameworks_base by android.
the class ContentProviderRecord method newHolder.
public ContentProviderHolder newHolder(ContentProviderConnection conn) {
ContentProviderHolder holder = new ContentProviderHolder(info);
holder.provider = provider;
holder.noReleaseNeeded = noReleaseNeeded;
holder.connection = conn;
return holder;
}
use of android.app.IActivityManager.ContentProviderHolder in project android_frameworks_base by DirtyUnicorns.
the class ShellUiAutomatorBridge method getSystemLongPressTime.
public long getSystemLongPressTime() {
// Read the long press timeout setting.
long longPressTimeout = 0;
try {
IContentProvider provider = null;
Cursor cursor = null;
IActivityManager activityManager = ActivityManagerNative.getDefault();
String providerName = Settings.Secure.CONTENT_URI.getAuthority();
IBinder token = new Binder();
try {
ContentProviderHolder holder = activityManager.getContentProviderExternal(providerName, UserHandle.USER_SYSTEM, token);
if (holder == null) {
throw new IllegalStateException("Could not find provider: " + providerName);
}
provider = holder.provider;
cursor = provider.query(null, Settings.Secure.CONTENT_URI, new String[] { Settings.Secure.VALUE }, "name=?", new String[] { Settings.Secure.LONG_PRESS_TIMEOUT }, null, null);
if (cursor.moveToFirst()) {
longPressTimeout = cursor.getInt(0);
}
} finally {
if (cursor != null) {
cursor.close();
}
if (provider != null) {
activityManager.removeContentProviderExternal(providerName, token);
}
}
} catch (RemoteException e) {
String message = "Error reading long press timeout setting.";
Log.e(LOG_TAG, message, e);
throw new RuntimeException(message, e);
}
return longPressTimeout;
}
use of android.app.IActivityManager.ContentProviderHolder in project android_frameworks_base by DirtyUnicorns.
the class ContentProviderRecord method newHolder.
public ContentProviderHolder newHolder(ContentProviderConnection conn) {
ContentProviderHolder holder = new ContentProviderHolder(info);
holder.provider = provider;
holder.noReleaseNeeded = noReleaseNeeded;
holder.connection = conn;
return holder;
}
use of android.app.IActivityManager.ContentProviderHolder in project android_frameworks_base by AOSPA.
the class ShellUiAutomatorBridge method getSystemLongPressTime.
public long getSystemLongPressTime() {
// Read the long press timeout setting.
long longPressTimeout = 0;
try {
IContentProvider provider = null;
Cursor cursor = null;
IActivityManager activityManager = ActivityManagerNative.getDefault();
String providerName = Settings.Secure.CONTENT_URI.getAuthority();
IBinder token = new Binder();
try {
ContentProviderHolder holder = activityManager.getContentProviderExternal(providerName, UserHandle.USER_SYSTEM, token);
if (holder == null) {
throw new IllegalStateException("Could not find provider: " + providerName);
}
provider = holder.provider;
cursor = provider.query(null, Settings.Secure.CONTENT_URI, new String[] { Settings.Secure.VALUE }, "name=?", new String[] { Settings.Secure.LONG_PRESS_TIMEOUT }, null, null);
if (cursor.moveToFirst()) {
longPressTimeout = cursor.getInt(0);
}
} finally {
if (cursor != null) {
cursor.close();
}
if (provider != null) {
activityManager.removeContentProviderExternal(providerName, token);
}
}
} catch (RemoteException e) {
String message = "Error reading long press timeout setting.";
Log.e(LOG_TAG, message, e);
throw new RuntimeException(message, e);
}
return longPressTimeout;
}
Aggregations