Here’s a partial listing of the available services on android.
Access the Service Manager and list available services
android.os.IServiceManager sm = android.os.ServiceManagerNative.getDefault(); try { String[] services = sm.listServices(); for (int i = 0; i < services.length; i++) { Log.i("Services", i + " : " + services[i]); } } catch (DeadObjectException e) { Log.i("Services", e.getMessage(), e); }
Now we try to dig thru the API to figure out which ones are available to applications. Here’s what i have found so far.
USB
android.os.IUsb usbService = android.os.IUsb.Stub.asInterface(sm.getService("USB"));
javadoc – IUsb
activity
android.app.IActivityManager activityService = android.app.IActivityManager.Stub.asInterface(sm.getService("activity"));
alarm
android.app.IAlarmManager alarmService = android.app.IAlarmManager.Stub.asInterface(sm.getService("alarm"));
content
android.content.IContentService contentService = android.content.IContentService.Stub.asInterface(sm.getService("content"));
location
android.location.ILocationManager locationService = android.location.ILocationManager.Stub.asInterface(sm.getService("location"));
notification
android.app.INotificationManager notificationService = android.app.INotificationManager.Stub.asInterface(sm.getService("notification"));
org.bluez.bluetooth
org.bluez.IBluetoothService bluetoothService = org.bluez.IBluetoothService.Stub.asInterface(sm.getService("org.bluez.bluetooth_service"));
javadoc – IBluetoothService
package
android.content.IPackageManager packageService = android.content.IPackageManager.Stub.asInterface(sm.getService("package"));
phone
android.telephony.IPhone phoneService = android.telephony.IPhone.Stub.asInterface(sm.getService("phone"));
javadoc – IPhone
power
android.os.IPowerManager powerService = android.os.IPowerManager.Stub.asInterface(sm.getService("power"));
statistics
android.os.IStatisticsService statisticsService = android.os.IStatisticsService.Stub.asInterface(sm.getService("statistics"));
statusbar
android.server.status.IStatusBar statusbarService = android.server.status.IStatusBar.Stub.asInterface(sm.getService("statusbar"));
vibrator
android.os.IVibratorService vibratorService = android.os.IVibratorService.Stub.asInterface(ServiceManager.getService("vibrator"));
volume
android.view.IRingerVolume volumeService = android.view.RingerVolumeNative.asInterface(sm.getService("volume"));
window
android.view.IWindowManager windowService = android.view.IWindowManager.Stub.asInterface(sm.getService("window"));
Hey can u explain me ,what are the return types of all classes and interface use for IPC in android.
For instance, IBinder,parcel,bluetooth..
Comment by sony — July 19, 2010 @ 5:50 am
First make sure youre root.
You can take a look at the android source code. The Inotificationmanager.aidl returns a parcel (obvious) so you can read String by String (or integer .. )
Take a look at this:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/app/INotificationManager.java
But as in these snippets posted here the service is directly addresses, I’m not sure if it is nescessary to use the parcel transaction.
Btw im working on sth similiar, if i got sth working i would contact you.. Sorry for my bad english im german.
Best regards
Julius
Comment by julius — January 9, 2015 @ 5:25 am
Hey,
I keep getting the error: android.app.INotificationManager cannot be resolved to a type
any idea’s?
Comment by Blundell — September 30, 2010 @ 5:53 pm