FileDocCategorySizeDatePackage
StatusBarManager.javaAPI DocAndroid 5.1 API6656Thu Mar 12 22:22:10 GMT 2015android.app

StatusBarManager

public class StatusBarManager extends Object
Allows an app to control the status bar.
hide

Fields Summary
public static final int
DISABLE_EXPAND
public static final int
DISABLE_NOTIFICATION_ICONS
public static final int
DISABLE_NOTIFICATION_ALERTS
public static final int
DISABLE_NOTIFICATION_TICKER
public static final int
DISABLE_SYSTEM_INFO
public static final int
DISABLE_HOME
public static final int
DISABLE_RECENT
public static final int
DISABLE_BACK
public static final int
DISABLE_CLOCK
public static final int
DISABLE_SEARCH
public static final int
DISABLE_NAVIGATION
public static final int
DISABLE_NONE
public static final int
DISABLE_MASK
public static final int
NAVIGATION_HINT_BACK_ALT
public static final int
NAVIGATION_HINT_IME_SHOWN
public static final int
WINDOW_STATUS_BAR
public static final int
WINDOW_NAVIGATION_BAR
public static final int
WINDOW_STATE_SHOWING
public static final int
WINDOW_STATE_HIDING
public static final int
WINDOW_STATE_HIDDEN
private android.content.Context
mContext
private com.android.internal.statusbar.IStatusBarService
mService
private android.os.IBinder
mToken
Constructors Summary
StatusBarManager(android.content.Context context)


      
        mContext = context;
    
Methods Summary
public voidcollapsePanels()
Collapse the notifications and settings panels.

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.collapsePanels();
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public voiddisable(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 {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.disable(what, mToken, mContext.getPackageName());
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public voidexpandNotificationsPanel()
Expand the notifications panel.

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.expandNotificationsPanel();
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public voidexpandSettingsPanel()
Expand the settings panel.

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.expandSettingsPanel();
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
private synchronized com.android.internal.statusbar.IStatusBarServicegetService()

        if (mService == null) {
            mService = IStatusBarService.Stub.asInterface(
                    ServiceManager.getService(Context.STATUS_BAR_SERVICE));
            if (mService == null) {
                Slog.w("StatusBarManager", "warning: no STATUS_BAR_SERVICE");
            }
        }
        return mService;
    
public voidremoveIcon(java.lang.String slot)

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.removeIcon(slot);
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public voidsetIcon(java.lang.String slot, int iconId, int iconLevel, java.lang.String contentDescription)

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.setIcon(slot, mContext.getPackageName(), iconId, iconLevel,
                    contentDescription);
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public voidsetIconVisibility(java.lang.String slot, boolean visible)

        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.setIconVisibility(slot, visible);
            }
        } catch (RemoteException ex) {
            // system process is dead anyway.
            throw new RuntimeException(ex);
        }
    
public static java.lang.StringwindowStateToString(int state)

hide

        if (state == WINDOW_STATE_HIDING) return "WINDOW_STATE_HIDING";
        if (state == WINDOW_STATE_HIDDEN) return "WINDOW_STATE_HIDDEN";
        if (state == WINDOW_STATE_SHOWING) return "WINDOW_STATE_SHOWING";
        return "WINDOW_STATE_UNKNOWN";