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