StatusBarManagerpublic class StatusBarManager extends Object Allows an app to control the status bar. |
Fields Summary |
---|
public static final int | DISABLE_EXPANDFlag for {@link #disable} to make the status bar not expandable. Unless you also
set {@link #DISABLE_NOTIFICATIONS}, new notifications will continue to show. | public static final int | DISABLE_NOTIFICATION_ICONSFlag for {@link #disable} to hide notification icons and ticker text. | public static final int | DISABLE_NOTIFICATION_ALERTSFlag for {@link #disable} to disable incoming notification alerts. This will not block
icons, but it will block sound, vibrating and other visual or aural notifications. | public static final int | DISABLE_NONERe-enable all of the status bar features that you've disabled. | private android.content.Context | mContext | private IStatusBar | mService | private android.os.IBinder | mToken |
Constructors Summary |
---|
StatusBarManager(android.content.Context context)
mContext = context;
mService = IStatusBar.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
|
Methods Summary |
---|
public android.os.IBinder | addIcon(java.lang.String slot, int iconId, int iconLevel)
try {
return mService.addIcon(slot, mContext.getPackageName(), iconId, iconLevel);
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | collapse()Collapse the status bar.
try {
mService.deactivate();
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | disable(int what)Disable some features in the status bar. Pass the bitwise-or of the DISABLE_* flags.
To re-enable everything, pass {@link #DISABLE_NONE}.
try {
mService.disable(what, mToken, mContext.getPackageName());
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | expand()Expand the status bar.
try {
mService.activate();
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | removeIcon(android.os.IBinder key)
try {
mService.removeIcon(key);
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | toggle()Toggle the status bar.
try {
mService.toggle();
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
| public void | updateIcon(android.os.IBinder key, java.lang.String slot, int iconId, int iconLevel)
try {
mService.updateIcon(key, slot, mContext.getPackageName(), iconId, iconLevel);
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
|
|