Android開機向導後notification應為不可點擊狀態

notification為SystemUI部分,控制notification的狀態是在如下文件中

frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\tablet\TabletStatusBar.java

 

TabletStatusBar.java文件中的disable()方法是禁止點擊的

想要禁止notification的響應,就要知道開機向導(SetupWizard)的狀態

 

boolean provisioned = Settings.Secure.getInt(mContext.getContentResolver(),
                      Settings.Secure.DEVICE_PROVISIONED, 0) != 0;                      // !=0的值為fasle說明開機向導已經完成,!=0的值為true說明正在執行開機向導
                  Slog.i(TAG, "provisioned = " + provisioned);
 if(!provisioned){
     mDisabled = mDisabled | StatusBarManager.DISABLE_EXPAND | StatusBarManager.DISABLE_NOTIFICATION_TICKER;
 }

 

You May Also Like