Android 11.0 解决设置 OEM unlocking 灰色 无法点击问题

时间:2025-03-30 09:46:11

frameworks\base\services\core\java\com\android\server\pm\

查看 framework/…/ 下 该属性config_defaultFirstUserRestrictions 是否配置了oem_unlock 限制,去除即可。

   @GuardedBy({"mPackagesLock", "mRestrictionsLock"})
    private void fallbackToSingleUserLP() {
...此处省略部分代码
            final String[] defaultFirstUserRestrictions = mContext.getResources().getStringArray(
                    com.android.internal.R.array.config_defaultFirstUserRestrictions);
            for (String userRestriction : defaultFirstUserRestrictions) {
                if (UserRestrictionsUtils.isValidRestriction(userRestriction)) {
                    restrictions.putBoolean(userRestriction, true);
                }
            }
...此处省略部分代码
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11