FileDocCategorySizeDatePackage
CommandQueue.javaAPI DocAndroid 5.1 API13925Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar

CommandQueue

public class CommandQueue extends IStatusBar.Stub
This class takes the functions from IStatusBar that come in on binder pool threads and posts messages to get them onto the main thread, and calls onto Callbacks. It also takes care of coalescing these calls so they don't stack up. For the calls are coalesced, note that they are all idempotent.

Fields Summary
private static final int
INDEX_MASK
private static final int
MSG_SHIFT
private static final int
MSG_MASK
private static final int
OP_SET_ICON
private static final int
OP_REMOVE_ICON
private static final int
MSG_ICON
private static final int
MSG_DISABLE
private static final int
MSG_EXPAND_NOTIFICATIONS
private static final int
MSG_COLLAPSE_PANELS
private static final int
MSG_EXPAND_SETTINGS
private static final int
MSG_SET_SYSTEMUI_VISIBILITY
private static final int
MSG_TOP_APP_WINDOW_CHANGED
private static final int
MSG_SHOW_IME_BUTTON
private static final int
MSG_TOGGLE_RECENT_APPS
private static final int
MSG_PRELOAD_RECENT_APPS
private static final int
MSG_CANCEL_PRELOAD_RECENT_APPS
private static final int
MSG_SET_WINDOW_STATE
private static final int
MSG_SHOW_RECENT_APPS
private static final int
MSG_HIDE_RECENT_APPS
private static final int
MSG_BUZZ_BEEP_BLINKED
private static final int
MSG_NOTIFICATION_LIGHT_OFF
private static final int
MSG_NOTIFICATION_LIGHT_PULSE
private static final int
MSG_SHOW_SCREEN_PIN_REQUEST
public static final int
FLAG_EXCLUDE_NONE
public static final int
FLAG_EXCLUDE_SEARCH_PANEL
public static final int
FLAG_EXCLUDE_RECENTS_PANEL
public static final int
FLAG_EXCLUDE_NOTIFICATION_PANEL
public static final int
FLAG_EXCLUDE_INPUT_METHODS_PANEL
public static final int
FLAG_EXCLUDE_COMPAT_MODE_PANEL
private static final String
SHOW_IME_SWITCHER_KEY
private com.android.internal.statusbar.StatusBarIconList
mList
private Callbacks
mCallbacks
private android.os.Handler
mHandler
Constructors Summary
public CommandQueue(Callbacks callbacks, com.android.internal.statusbar.StatusBarIconList list)


                  
       
                 
               
                   
               
             
          
           
          
             
           
               
                 
           
             
          
          
          
          
          
             
          
          
               
          
    

         
        mCallbacks = callbacks;
        mList = list;
    
Methods Summary
public voidanimateCollapsePanels()

        synchronized (mList) {
            mHandler.removeMessages(MSG_COLLAPSE_PANELS);
            mHandler.sendEmptyMessage(MSG_COLLAPSE_PANELS);
        }
    
public voidanimateExpandNotificationsPanel()

        synchronized (mList) {
            mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS);
            mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS);
        }
    
public voidanimateExpandSettingsPanel()

        synchronized (mList) {
            mHandler.removeMessages(MSG_EXPAND_SETTINGS);
            mHandler.sendEmptyMessage(MSG_EXPAND_SETTINGS);
        }
    
public voidbuzzBeepBlinked()

        synchronized (mList) {
            mHandler.removeMessages(MSG_BUZZ_BEEP_BLINKED);
            mHandler.sendEmptyMessage(MSG_BUZZ_BEEP_BLINKED);
        }
    
public voidcancelPreloadRecentApps()

        synchronized (mList) {
            mHandler.removeMessages(MSG_CANCEL_PRELOAD_RECENT_APPS);
            mHandler.obtainMessage(MSG_CANCEL_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget();
        }
    
public voiddisable(int state)

        synchronized (mList) {
            mHandler.removeMessages(MSG_DISABLE);
            mHandler.obtainMessage(MSG_DISABLE, state, 0, null).sendToTarget();
        }
    
public voidhideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)

        synchronized (mList) {
            mHandler.removeMessages(MSG_HIDE_RECENT_APPS);
            mHandler.obtainMessage(MSG_HIDE_RECENT_APPS,
                    triggeredFromAltTab ? 1 : 0, triggeredFromHomeKey ? 1 : 0,
                    null).sendToTarget();
        }
    
public voidnotificationLightOff()

        synchronized (mList) {
            mHandler.sendEmptyMessage(MSG_NOTIFICATION_LIGHT_OFF);
        }
    
public voidnotificationLightPulse(int argb, int onMillis, int offMillis)

        synchronized (mList) {
            mHandler.obtainMessage(MSG_NOTIFICATION_LIGHT_PULSE, onMillis, offMillis, argb)
                    .sendToTarget();
        }
    
public voidpreloadRecentApps()

        synchronized (mList) {
            mHandler.removeMessages(MSG_PRELOAD_RECENT_APPS);
            mHandler.obtainMessage(MSG_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget();
        }
    
public voidremoveIcon(int index)

        synchronized (mList) {
            int what = MSG_ICON | index;
            mHandler.removeMessages(what);
            mHandler.obtainMessage(what, OP_REMOVE_ICON, 0, null).sendToTarget();
        }
    
public voidsetIcon(int index, com.android.internal.statusbar.StatusBarIcon icon)

        synchronized (mList) {
            int what = MSG_ICON | index;
            mHandler.removeMessages(what);
            mHandler.obtainMessage(what, OP_SET_ICON, 0, icon.clone()).sendToTarget();
        }
    
public voidsetImeWindowStatus(android.os.IBinder token, int vis, int backDisposition, boolean showImeSwitcher)

        synchronized (mList) {
            mHandler.removeMessages(MSG_SHOW_IME_BUTTON);
            Message m = mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token);
            m.getData().putBoolean(SHOW_IME_SWITCHER_KEY, showImeSwitcher);
            m.sendToTarget();
        }
    
public voidsetSystemUiVisibility(int vis, int mask)

        synchronized (mList) {
            mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
            mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, vis, mask, null).sendToTarget();
        }
    
public voidsetWindowState(int window, int state)

        synchronized (mList) {
            // don't coalesce these
            mHandler.obtainMessage(MSG_SET_WINDOW_STATE, window, state, null).sendToTarget();
        }
    
public voidshowRecentApps(boolean triggeredFromAltTab)

        synchronized (mList) {
            mHandler.removeMessages(MSG_SHOW_RECENT_APPS);
            mHandler.obtainMessage(MSG_SHOW_RECENT_APPS,
                    triggeredFromAltTab ? 1 : 0, 0, null).sendToTarget();
        }
    
public voidshowScreenPinningRequest()

        synchronized (mList) {
            mHandler.sendEmptyMessage(MSG_SHOW_SCREEN_PIN_REQUEST);
        }
    
public voidtoggleRecentApps()

        synchronized (mList) {
            mHandler.removeMessages(MSG_TOGGLE_RECENT_APPS);
            mHandler.obtainMessage(MSG_TOGGLE_RECENT_APPS, 0, 0, null).sendToTarget();
        }
    
public voidtopAppWindowChanged(boolean menuVisible)

        synchronized (mList) {
            mHandler.removeMessages(MSG_TOP_APP_WINDOW_CHANGED);
            mHandler.obtainMessage(MSG_TOP_APP_WINDOW_CHANGED, menuVisible ? 1 : 0, 0,
                    null).sendToTarget();
        }