Android代碼 禁用Adb、狀態欄、導航欄


public void setAdbDisabled(boolean disabled) {
    try {
        if (disabled) {
            Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ADB_ENABLED, 0);
        } else {
            Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ADB_ENABLED, 1);
        }
    } catch (Exception e) {
        Slog.e(TAG, "setAdbDisabled", e);
    }
}
public void setStatusBarExpandPanelDisabled(boolean disabled) {
        Settings.Secure.putInt(mContext.getContentResolver(), STATUSBAR_EXPAND_KEY, disabled ? 1 : 0);
    }
    public void disableNavigation(){
        IStatusBarService mISs = IStatusBarService.Stub.asInterface(ServiceManager.
                getService(Context.STATUS_BAR_SERVICE));
        try {
            mISs.disable(StatusBarManager.DISABLE_NAVIGATION, new Binder(), getApplicationContext().getPackageName());
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM