use of android.os.IBinder in project android_frameworks_base by ParanoidAndroid.
the class ActivityManagerProxy method newUriPermissionOwner.
public IBinder newUriPermissionOwner(String name) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeString(name);
mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
reply.readException();
IBinder res = reply.readStrongBinder();
data.recycle();
reply.recycle();
return res;
}
use of android.os.IBinder in project android_frameworks_base by ParanoidAndroid.
the class ActivityManagerProxy method peekService.
public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
service.writeToParcel(data, 0);
data.writeString(resolvedType);
mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
reply.readException();
IBinder binder = reply.readStrongBinder();
reply.recycle();
data.recycle();
return binder;
}
use of android.os.IBinder in project android_frameworks_base by ParanoidAndroid.
the class NotificationManager method getService.
/** @hide */
public static INotificationManager getService() {
if (sService != null) {
return sService;
}
IBinder b = ServiceManager.getService("notification");
sService = INotificationManager.Stub.asInterface(b);
return sService;
}
use of android.os.IBinder in project android_frameworks_base by ParanoidAndroid.
the class BluetoothAdapter method getDefaultAdapter.
/**
* Get a handle to the default local Bluetooth adapter.
* <p>Currently Android only supports one Bluetooth adapter, but the API
* could be extended to support more. This will always return the default
* adapter.
* @return the default local adapter, or null if Bluetooth is not supported
* on this hardware platform
*/
public static synchronized BluetoothAdapter getDefaultAdapter() {
if (sAdapter == null) {
IBinder b = ServiceManager.getService(BLUETOOTH_MANAGER_SERVICE);
if (b != null) {
IBluetoothManager managerService = IBluetoothManager.Stub.asInterface(b);
sAdapter = new BluetoothAdapter(managerService);
} else {
Log.e(TAG, "Bluetooth binder is null");
}
}
return sAdapter;
}
use of android.os.IBinder in project android_frameworks_base by ParanoidAndroid.
the class BroadcastReceiver method peekService.
/**
* Provide a binder to an already-running service. This method is synchronous
* and will not start the target service if it is not present, so it is safe
* to call from {@link #onReceive}.
*
* @param myContext The Context that had been passed to {@link #onReceive(Context, Intent)}
* @param service The Intent indicating the service you wish to use. See {@link
* Context#startService(Intent)} for more information.
*/
public IBinder peekService(Context myContext, Intent service) {
IActivityManager am = ActivityManagerNative.getDefault();
IBinder binder = null;
try {
service.prepareToLeaveProcess();
binder = am.peekService(service, service.resolveTypeIfNeeded(myContext.getContentResolver()));
} catch (RemoteException e) {
}
return binder;
}
Aggregations