1 /*
2  * Copyright (C) 2007 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.app;
18 
19 import android.annotation.IntDef;
20 import android.annotation.NonNull;
21 import android.annotation.Nullable;
22 import android.annotation.RequiresPermission;
23 import android.annotation.SystemApi;
24 import android.annotation.SystemService;
25 import android.annotation.TestApi;
26 import android.compat.annotation.UnsupportedAppUsage;
27 import android.content.Context;
28 import android.os.Binder;
29 import android.os.IBinder;
30 import android.os.RemoteException;
31 import android.os.ServiceManager;
32 import android.util.Pair;
33 import android.util.Slog;
34 import android.view.View;
35 
36 import com.android.internal.statusbar.IStatusBarService;
37 
38 import java.lang.annotation.Retention;
39 import java.lang.annotation.RetentionPolicy;
40 
41 /**
42  * Allows an app to control the status bar.
43  */
44 @SystemService(Context.STATUS_BAR_SERVICE)
45 public class StatusBarManager {
46 
47     /** @hide */
48     public static final int DISABLE_EXPAND = View.STATUS_BAR_DISABLE_EXPAND;
49     /** @hide */
50     public static final int DISABLE_NOTIFICATION_ICONS = View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS;
51     /** @hide */
52     public static final int DISABLE_NOTIFICATION_ALERTS
53             = View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS;
54 
55     /** @hide */
56     @Deprecated
57     @UnsupportedAppUsage
58     public static final int DISABLE_NOTIFICATION_TICKER
59             = View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER;
60     /** @hide */
61     public static final int DISABLE_SYSTEM_INFO = View.STATUS_BAR_DISABLE_SYSTEM_INFO;
62     /** @hide */
63     public static final int DISABLE_HOME = View.STATUS_BAR_DISABLE_HOME;
64     /** @hide */
65     public static final int DISABLE_RECENT = View.STATUS_BAR_DISABLE_RECENT;
66     /** @hide */
67     public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK;
68     /** @hide */
69     public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK;
70     /** @hide */
71     public static final int DISABLE_SEARCH = View.STATUS_BAR_DISABLE_SEARCH;
72 
73     /** @hide */
74     @Deprecated
75     public static final int DISABLE_NAVIGATION =
76             View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_RECENT;
77 
78     /** @hide */
79     public static final int DISABLE_NONE = 0x00000000;
80 
81     /** @hide */
82     public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS
83             | DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
84             | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
85             | DISABLE_SEARCH;
86 
87     /** @hide */
88     @IntDef(flag = true, prefix = {"DISABLE_"}, value = {
89             DISABLE_NONE,
90             DISABLE_EXPAND,
91             DISABLE_NOTIFICATION_ICONS,
92             DISABLE_NOTIFICATION_ALERTS,
93             DISABLE_NOTIFICATION_TICKER,
94             DISABLE_SYSTEM_INFO,
95             DISABLE_HOME,
96             DISABLE_RECENT,
97             DISABLE_BACK,
98             DISABLE_CLOCK,
99             DISABLE_SEARCH
100     })
101     @Retention(RetentionPolicy.SOURCE)
102     public @interface DisableFlags {}
103 
104     /**
105      * Flag to disable quick settings.
106      *
107      * Setting this flag disables quick settings completely, but does not disable expanding the
108      * notification shade.
109      */
110     /** @hide */
111     public static final int DISABLE2_QUICK_SETTINGS = 1;
112     /** @hide */
113     public static final int DISABLE2_SYSTEM_ICONS = 1 << 1;
114     /** @hide */
115     public static final int DISABLE2_NOTIFICATION_SHADE = 1 << 2;
116     /** @hide */
117     public static final int DISABLE2_GLOBAL_ACTIONS = 1 << 3;
118     /** @hide */
119     public static final int DISABLE2_ROTATE_SUGGESTIONS = 1 << 4;
120 
121     /** @hide */
122     public static final int DISABLE2_NONE = 0x00000000;
123 
124     /** @hide */
125     public static final int DISABLE2_MASK = DISABLE2_QUICK_SETTINGS | DISABLE2_SYSTEM_ICONS
126             | DISABLE2_NOTIFICATION_SHADE | DISABLE2_GLOBAL_ACTIONS | DISABLE2_ROTATE_SUGGESTIONS;
127 
128     /** @hide */
129     @IntDef(flag = true, prefix = { "DISABLE2_" }, value = {
130             DISABLE2_NONE,
131             DISABLE2_MASK,
132             DISABLE2_QUICK_SETTINGS,
133             DISABLE2_SYSTEM_ICONS,
134             DISABLE2_NOTIFICATION_SHADE,
135             DISABLE2_GLOBAL_ACTIONS,
136             DISABLE2_ROTATE_SUGGESTIONS
137     })
138     @Retention(RetentionPolicy.SOURCE)
139     public @interface Disable2Flags {}
140 
141     /**
142      * Default disable flags for setup
143      *
144      * @hide
145      */
146     public static final int DEFAULT_SETUP_DISABLE_FLAGS = DISABLE_NOTIFICATION_ALERTS
147             | DISABLE_HOME | DISABLE_EXPAND | DISABLE_RECENT | DISABLE_CLOCK | DISABLE_SEARCH;
148 
149     /**
150      * Default disable2 flags for setup
151      *
152      * @hide
153      */
154     public static final int DEFAULT_SETUP_DISABLE2_FLAGS = DISABLE2_ROTATE_SUGGESTIONS;
155 
156     /**
157      * disable flags to be applied when the device is sim-locked.
158      */
159     private static final int DEFAULT_SIM_LOCKED_DISABLED_FLAGS = DISABLE_EXPAND;
160 
161     /** @hide */
162     public static final int NAVIGATION_HINT_BACK_ALT      = 1 << 0;
163     /** @hide */
164     public static final int NAVIGATION_HINT_IME_SHOWN     = 1 << 1;
165 
166     /** @hide */
167     public static final int WINDOW_STATUS_BAR = 1;
168     /** @hide */
169     public static final int WINDOW_NAVIGATION_BAR = 2;
170 
171     /** @hide */
172     @IntDef(flag = true, prefix = { "WINDOW_" }, value = {
173         WINDOW_STATUS_BAR,
174         WINDOW_NAVIGATION_BAR
175     })
176     @Retention(RetentionPolicy.SOURCE)
177     public @interface WindowType {}
178 
179     /** @hide */
180     public static final int WINDOW_STATE_SHOWING = 0;
181     /** @hide */
182     public static final int WINDOW_STATE_HIDING = 1;
183     /** @hide */
184     public static final int WINDOW_STATE_HIDDEN = 2;
185 
186     /** @hide */
187     @IntDef(flag = true, prefix = { "WINDOW_STATE_" }, value = {
188             WINDOW_STATE_SHOWING,
189             WINDOW_STATE_HIDING,
190             WINDOW_STATE_HIDDEN
191     })
192     @Retention(RetentionPolicy.SOURCE)
193     public @interface WindowVisibleState {}
194 
195     /** @hide */
196     public static final int CAMERA_LAUNCH_SOURCE_WIGGLE = 0;
197     /** @hide */
198     public static final int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = 1;
199     /** @hide */
200     public static final int CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = 2;
201 
202     @UnsupportedAppUsage
203     private Context mContext;
204     private IStatusBarService mService;
205     @UnsupportedAppUsage
206     private IBinder mToken = new Binder();
207 
208     @UnsupportedAppUsage
StatusBarManager(Context context)209     StatusBarManager(Context context) {
210         mContext = context;
211     }
212 
213     @UnsupportedAppUsage
getService()214     private synchronized IStatusBarService getService() {
215         if (mService == null) {
216             mService = IStatusBarService.Stub.asInterface(
217                     ServiceManager.getService(Context.STATUS_BAR_SERVICE));
218             if (mService == null) {
219                 Slog.w("StatusBarManager", "warning: no STATUS_BAR_SERVICE");
220             }
221         }
222         return mService;
223     }
224 
225     /**
226      * Disable some features in the status bar.  Pass the bitwise-or of the DISABLE_* flags.
227      * To re-enable everything, pass {@link #DISABLE_NONE}.
228      *
229      * @hide
230      */
231     @UnsupportedAppUsage
disable(int what)232     public void disable(int what) {
233         try {
234             final int userId = Binder.getCallingUserHandle().getIdentifier();
235             final IStatusBarService svc = getService();
236             if (svc != null) {
237                 svc.disableForUser(what, mToken, mContext.getPackageName(), userId);
238             }
239         } catch (RemoteException ex) {
240             throw ex.rethrowFromSystemServer();
241         }
242     }
243 
244     /**
245      * Disable additional status bar features. Pass the bitwise-or of the DISABLE2_* flags.
246      * To re-enable everything, pass {@link #DISABLE_NONE}.
247      *
248      * Warning: Only pass DISABLE2_* flags into this function, do not use DISABLE_* flags.
249      *
250      * @hide
251      */
disable2(@isable2Flags int what)252     public void disable2(@Disable2Flags int what) {
253         try {
254             final int userId = Binder.getCallingUserHandle().getIdentifier();
255             final IStatusBarService svc = getService();
256             if (svc != null) {
257                 svc.disable2ForUser(what, mToken, mContext.getPackageName(), userId);
258             }
259         } catch (RemoteException ex) {
260             throw ex.rethrowFromSystemServer();
261         }
262     }
263 
264     /**
265      * Expand the notifications panel.
266      *
267      * @hide
268      */
269     @UnsupportedAppUsage
expandNotificationsPanel()270     public void expandNotificationsPanel() {
271         try {
272             final IStatusBarService svc = getService();
273             if (svc != null) {
274                 svc.expandNotificationsPanel();
275             }
276         } catch (RemoteException ex) {
277             throw ex.rethrowFromSystemServer();
278         }
279     }
280 
281     /**
282      * Collapse the notifications and settings panels.
283      *
284      * @hide
285      */
286     @UnsupportedAppUsage
collapsePanels()287     public void collapsePanels() {
288         try {
289             final IStatusBarService svc = getService();
290             if (svc != null) {
291                 svc.collapsePanels();
292             }
293         } catch (RemoteException ex) {
294             throw ex.rethrowFromSystemServer();
295         }
296     }
297 
298     /**
299      * Expand the settings panel.
300      *
301      * @hide
302      */
303     @UnsupportedAppUsage
expandSettingsPanel()304     public void expandSettingsPanel() {
305         expandSettingsPanel(null);
306     }
307 
308     /**
309      * Expand the settings panel and open a subPanel. If the subpanel is null or does not have a
310      * corresponding tile, the QS panel is simply expanded
311      *
312      * @hide
313      */
314     @UnsupportedAppUsage
expandSettingsPanel(@ullable String subPanel)315     public void expandSettingsPanel(@Nullable String subPanel) {
316         try {
317             final IStatusBarService svc = getService();
318             if (svc != null) {
319                 svc.expandSettingsPanel(subPanel);
320             }
321         } catch (RemoteException ex) {
322             throw ex.rethrowFromSystemServer();
323         }
324     }
325 
326     /** @hide */
327     @UnsupportedAppUsage
setIcon(String slot, int iconId, int iconLevel, String contentDescription)328     public void setIcon(String slot, int iconId, int iconLevel, String contentDescription) {
329         try {
330             final IStatusBarService svc = getService();
331             if (svc != null) {
332                 svc.setIcon(slot, mContext.getPackageName(), iconId, iconLevel,
333                     contentDescription);
334             }
335         } catch (RemoteException ex) {
336             throw ex.rethrowFromSystemServer();
337         }
338     }
339 
340     /** @hide */
341     @UnsupportedAppUsage
removeIcon(String slot)342     public void removeIcon(String slot) {
343         try {
344             final IStatusBarService svc = getService();
345             if (svc != null) {
346                 svc.removeIcon(slot);
347             }
348         } catch (RemoteException ex) {
349             throw ex.rethrowFromSystemServer();
350         }
351     }
352 
353     /** @hide */
354     @UnsupportedAppUsage
setIconVisibility(String slot, boolean visible)355     public void setIconVisibility(String slot, boolean visible) {
356         try {
357             final IStatusBarService svc = getService();
358             if (svc != null) {
359                 svc.setIconVisibility(slot, visible);
360             }
361         } catch (RemoteException ex) {
362             throw ex.rethrowFromSystemServer();
363         }
364     }
365 
366     /**
367      * Enable or disable status bar elements (notifications, clock) which are inappropriate during
368      * device setup.
369      *
370      * @param disabled whether to apply or remove the disabled flags
371      *
372      * @hide
373      */
374     @SystemApi
375     @TestApi
376     @RequiresPermission(android.Manifest.permission.STATUS_BAR)
setDisabledForSetup(boolean disabled)377     public void setDisabledForSetup(boolean disabled) {
378         try {
379             final int userId = Binder.getCallingUserHandle().getIdentifier();
380             final IStatusBarService svc = getService();
381             if (svc != null) {
382                 svc.disableForUser(disabled ? DEFAULT_SETUP_DISABLE_FLAGS : DISABLE_NONE,
383                         mToken, mContext.getPackageName(), userId);
384                 svc.disable2ForUser(disabled ? DEFAULT_SETUP_DISABLE2_FLAGS : DISABLE2_NONE,
385                         mToken, mContext.getPackageName(), userId);
386             }
387         } catch (RemoteException ex) {
388             throw ex.rethrowFromSystemServer();
389         }
390     }
391 
392     /**
393      * Enable or disable expansion of the status bar. When the device is SIM-locked, the status
394      * bar should not be expandable.
395      *
396      * @param disabled If {@code true}, the status bar will be set to non-expandable. If
397      *                 {@code false}, re-enables expansion of the status bar.
398      * @hide
399      */
400     @SystemApi
401     @TestApi
402     @RequiresPermission(android.Manifest.permission.STATUS_BAR)
setDisabledForSimNetworkLock(boolean disabled)403     public void setDisabledForSimNetworkLock(boolean disabled) {
404         try {
405             final int userId = Binder.getCallingUserHandle().getIdentifier();
406             final IStatusBarService svc = getService();
407             if (svc != null) {
408                 svc.disableForUser(disabled ? DEFAULT_SIM_LOCKED_DISABLED_FLAGS : DISABLE_NONE,
409                         mToken, mContext.getPackageName(), userId);
410             }
411         } catch (RemoteException ex) {
412             throw ex.rethrowFromSystemServer();
413         }
414     }
415 
416     /**
417      * Get this app's currently requested disabled components
418      *
419      * @return a new DisableInfo
420      *
421      * @hide
422      */
423     @SystemApi
424     @TestApi
425     @RequiresPermission(android.Manifest.permission.STATUS_BAR)
426     @NonNull
getDisableInfo()427     public DisableInfo getDisableInfo() {
428         try {
429             final int userId = Binder.getCallingUserHandle().getIdentifier();
430             final IStatusBarService svc = getService();
431             int[] flags = new int[] {0, 0};
432             if (svc != null) {
433                 flags = svc.getDisableFlags(mToken, userId);
434             }
435 
436             return new DisableInfo(flags[0], flags[1]);
437         } catch (RemoteException ex) {
438             throw ex.rethrowFromSystemServer();
439         }
440     }
441 
442     /** @hide */
windowStateToString(int state)443     public static String windowStateToString(int state) {
444         if (state == WINDOW_STATE_HIDING) return "WINDOW_STATE_HIDING";
445         if (state == WINDOW_STATE_HIDDEN) return "WINDOW_STATE_HIDDEN";
446         if (state == WINDOW_STATE_SHOWING) return "WINDOW_STATE_SHOWING";
447         return "WINDOW_STATE_UNKNOWN";
448     }
449 
450     /**
451      * DisableInfo describes this app's requested state of the StatusBar with regards to which
452      * components are enabled/disabled
453      *
454      * @hide
455      */
456     @SystemApi
457     @TestApi
458     public static final class DisableInfo {
459 
460         private boolean mStatusBarExpansion;
461         private boolean mNavigateHome;
462         private boolean mNotificationPeeking;
463         private boolean mRecents;
464         private boolean mSearch;
465         private boolean mSystemIcons;
466         private boolean mClock;
467         private boolean mNotificationIcons;
468 
469         /** @hide */
DisableInfo(int flags1, int flags2)470         public DisableInfo(int flags1, int flags2) {
471             mStatusBarExpansion = (flags1 & DISABLE_EXPAND) != 0;
472             mNavigateHome = (flags1 & DISABLE_HOME) != 0;
473             mNotificationPeeking = (flags1 & DISABLE_NOTIFICATION_ALERTS) != 0;
474             mRecents = (flags1 & DISABLE_RECENT) != 0;
475             mSearch = (flags1 & DISABLE_SEARCH) != 0;
476             mSystemIcons = (flags1 & DISABLE_SYSTEM_INFO) != 0;
477             mClock = (flags1 & DISABLE_CLOCK) != 0;
478             mNotificationIcons = (flags1 & DISABLE_NOTIFICATION_ICONS) != 0;
479         }
480 
481         /** @hide */
DisableInfo()482         public DisableInfo() {}
483 
484         /**
485          * @return {@code true} if expanding the notification shade is disabled
486          *
487          * @hide
488          */
489         @SystemApi
490         @TestApi
isStatusBarExpansionDisabled()491         public boolean isStatusBarExpansionDisabled() {
492             return mStatusBarExpansion;
493         }
494 
495         /** * @hide */
setStatusBarExpansionDisabled(boolean disabled)496         public void setStatusBarExpansionDisabled(boolean disabled) {
497             mStatusBarExpansion = disabled;
498         }
499 
500         /**
501          * @return {@code true} if navigation home is disabled
502          *
503          * @hide
504          */
505         @SystemApi
506         @TestApi
isNavigateToHomeDisabled()507         public boolean isNavigateToHomeDisabled() {
508             return mNavigateHome;
509         }
510 
511         /** * @hide */
setNagivationHomeDisabled(boolean disabled)512         public void setNagivationHomeDisabled(boolean disabled) {
513             mNavigateHome = disabled;
514         }
515 
516         /**
517          * @return {@code true} if notification peeking (heads-up notification) is disabled
518          *
519          * @hide
520          */
521         @SystemApi
522         @TestApi
isNotificationPeekingDisabled()523         public boolean isNotificationPeekingDisabled() {
524             return mNotificationPeeking;
525         }
526 
527         /** @hide */
setNotificationPeekingDisabled(boolean disabled)528         public void setNotificationPeekingDisabled(boolean disabled) {
529             mNotificationPeeking = disabled;
530         }
531 
532         /**
533          * @return {@code true} if mRecents/overview is disabled
534          *
535          * @hide
536          */
537         @SystemApi
538         @TestApi
isRecentsDisabled()539         public boolean isRecentsDisabled() {
540             return mRecents;
541         }
542 
543         /**  @hide */
setRecentsDisabled(boolean disabled)544         public void setRecentsDisabled(boolean disabled) {
545             mRecents = disabled;
546         }
547 
548         /**
549          * @return {@code true} if mSearch is disabled
550          *
551          * @hide
552          */
553         @SystemApi
554         @TestApi
isSearchDisabled()555         public boolean isSearchDisabled() {
556             return mSearch;
557         }
558 
559         /** @hide */
setSearchDisabled(boolean disabled)560         public void setSearchDisabled(boolean disabled) {
561             mSearch = disabled;
562         }
563 
564         /**
565          * @return {@code true} if system icons are disabled
566          *
567          * @hide
568          */
areSystemIconsDisabled()569         public boolean areSystemIconsDisabled() {
570             return mSystemIcons;
571         }
572 
573         /** * @hide */
setSystemIconsDisabled(boolean disabled)574         public void setSystemIconsDisabled(boolean disabled) {
575             mSystemIcons = disabled;
576         }
577 
578         /**
579          * @return {@code true} if the clock icon is disabled
580          *
581          * @hide
582          */
isClockDisabled()583         public boolean isClockDisabled() {
584             return mClock;
585         }
586 
587         /** * @hide */
setClockDisabled(boolean disabled)588         public void setClockDisabled(boolean disabled) {
589             mClock = disabled;
590         }
591 
592         /**
593          * @return {@code true} if notification icons are disabled
594          *
595          * @hide
596          */
areNotificationIconsDisabled()597         public boolean areNotificationIconsDisabled() {
598             return mNotificationIcons;
599         }
600 
601         /** * @hide */
setNotificationIconsDisabled(boolean disabled)602         public void setNotificationIconsDisabled(boolean disabled) {
603             mNotificationIcons = disabled;
604         }
605 
606         /**
607          * @return {@code true} if no components are disabled (default state)
608          *
609          * @hide
610          */
611         @SystemApi
612         @TestApi
areAllComponentsEnabled()613         public boolean areAllComponentsEnabled() {
614             return !mStatusBarExpansion && !mNavigateHome && !mNotificationPeeking && !mRecents
615                     && !mSearch && !mSystemIcons && !mClock && !mNotificationIcons;
616         }
617 
618         /** @hide */
setEnableAll()619         public void setEnableAll() {
620             mStatusBarExpansion = false;
621             mNavigateHome = false;
622             mNotificationPeeking = false;
623             mRecents = false;
624             mSearch = false;
625             mSystemIcons = false;
626             mClock = false;
627             mNotificationIcons = false;
628         }
629 
630         /**
631          * @return {@code true} if all status bar components are disabled
632          *
633          * @hide
634          */
areAllComponentsDisabled()635         public boolean areAllComponentsDisabled() {
636             return mStatusBarExpansion && mNavigateHome && mNotificationPeeking
637                     && mRecents && mSearch && mSystemIcons && mClock && mNotificationIcons;
638         }
639 
640         /** @hide */
setDisableAll()641         public void setDisableAll() {
642             mStatusBarExpansion = true;
643             mNavigateHome = true;
644             mNotificationPeeking = true;
645             mRecents = true;
646             mSearch = true;
647             mSystemIcons = true;
648             mClock = true;
649             mNotificationIcons = true;
650         }
651 
652         @NonNull
653         @Override
toString()654         public String toString() {
655             StringBuilder sb = new StringBuilder();
656             sb.append("DisableInfo: ");
657             sb.append(" mStatusBarExpansion=").append(mStatusBarExpansion ? "disabled" : "enabled");
658             sb.append(" mNavigateHome=").append(mNavigateHome ? "disabled" : "enabled");
659             sb.append(" mNotificationPeeking=")
660                     .append(mNotificationPeeking ? "disabled" : "enabled");
661             sb.append(" mRecents=").append(mRecents ? "disabled" : "enabled");
662             sb.append(" mSearch=").append(mSearch ? "disabled" : "enabled");
663             sb.append(" mSystemIcons=").append(mSystemIcons ? "disabled" : "enabled");
664             sb.append(" mClock=").append(mClock ? "disabled" : "enabled");
665             sb.append(" mNotificationIcons=").append(mNotificationIcons ? "disabled" : "enabled");
666 
667             return sb.toString();
668 
669         }
670 
671         /**
672          * Convert a DisableInfo to equivalent flags
673          * @return a pair of equivalent disable flags
674          *
675          * @hide
676          */
toFlags()677         public Pair<Integer, Integer> toFlags() {
678             int disable1 = DISABLE_NONE;
679             int disable2 = DISABLE2_NONE;
680 
681             if (mStatusBarExpansion) disable1 |= DISABLE_EXPAND;
682             if (mNavigateHome) disable1 |= DISABLE_HOME;
683             if (mNotificationPeeking) disable1 |= DISABLE_NOTIFICATION_ALERTS;
684             if (mRecents) disable1 |= DISABLE_RECENT;
685             if (mSearch) disable1 |= DISABLE_SEARCH;
686             if (mSystemIcons) disable1 |= DISABLE_SYSTEM_INFO;
687             if (mClock) disable1 |= DISABLE_CLOCK;
688             if (mNotificationIcons) disable1 |= DISABLE_NOTIFICATION_ICONS;
689 
690             return new Pair<Integer, Integer>(disable1, disable2);
691         }
692     }
693 }
694