Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da30ca5e authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Move HsumConfigOverlay to frameworks/base

Provides the basic framework config overlay for adopting HSUM.

Bug: 331960280
Bug: 347341495
Flag: EXEMPT refactor
Test: builds with correct config

Change-Id: Id01e027e6e814c30cc1b0604b2f51a6c52475deb
parent 28f6a526
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -3061,10 +3061,13 @@
        frameworks/base/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java -->
    <integer name="config_userTypePackageWhitelistMode">13</integer> <!-- 1+4+8 -->

    <!-- Whether the main user is a permanent admin user. If the main user is a permanent admin user
     it can't be deleted or downgraded to non-admin status.
     This is generally only relevant on headless system user mode devices; on other devices, the
     main user is the system user which is always a permanent admin anyway. -->
    <!-- Whether the device will automatically (at first boot) have a designated main user and treat
         it as a permanent admin.
         Since the main user is a permanent admin user it can't be deleted or downgraded to
         non-admin status.
         This is generally only relevant on headless system user mode (HSUM) devices; on other
         devices, the main user is the system user which is always a permanent admin anyway.
         Note that HSUM devices without this enabled will not automatically have a main user. -->
    <bool name="config_isMainUserPermanentAdmin">true</bool>

    <!-- Whether switch to headless system user is allowed. If allowed,
+16 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

runtime_resource_overlay {
    name: "HsumConfigOverlay",
    certificate: "platform",

    product_specific: true,
    sdk_version: "current",
}
+22 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.internal.overlay.hsumconfig"
    android:versionCode="1"
    android:versionName="1.0">
    <overlay android:targetPackage="android" android:priority="2" android:isStatic="true" />
</manifest>
+2 −0
Original line number Diff line number Diff line
# People who can approve submission
include platform/frameworks/base:/MULTIUSER_OWNERS
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!-- Default configuration for Headless System User Mode (HSUM) builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

  <!-- Whether multiple admins are allowed on the device. If set to true, new users can be created
       with admin privileges and admin privileges can be granted/revoked from existing users. -->
  <bool name="config_enableMultipleAdmins">true</bool>

  <!-- Whether the device will automatically (at first boot) have a designated main user and treat
       it as a permanent admin.
       Since the main user is a permanent admin user it can't be deleted or downgraded to
       non-admin status.
       This is generally only relevant on headless system user mode (HSUM) devices; on other
       devices, the main user is the system user which is always a permanent admin anyway.
       Note that HSUM devices without this enabled will not automatically have a main user. -->
  <bool name="config_isMainUserPermanentAdmin">true</bool>

  <!-- Maximum number of users we allow to be running at a time.
       Note that this includes the headless system user. -->
  <integer name="config_multiuserMaxRunningUsers">4</integer>

</resources>