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(); } }
本文来自博客园,作者:小汀,转载请注明原文链接:https://www.cnblogs.com/1118zjg/p/16106592.html