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

Commit 48d81ecc authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Introduce concept of DockUser

Dreams and docking often refers to "user zero" or "system user".
But more generally, the special user for dreams or switching-to-on-docking
need not be user 0, and in fact won't be in certain modes. So this needs updating.

Test: the files mentioned in the topic
Bug: 257333623
Change-Id: Ic671c91c32e9bf24695b067ff97cf9fa65534b1e
parent 502b19b3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -10400,11 +10400,11 @@ public final class Settings {
        public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
        /**
         * The duration of timeout, in milliseconds, to switch from a non-primary user to the
         * primary user when the device is docked.
         * The duration of timeout, in milliseconds, to switch from a non-Dock User to the
         * Dock User when the device is docked.
         * @hide
         */
        public static final String TIMEOUT_TO_USER_ZERO = "timeout_to_user_zero";
        public static final String TIMEOUT_TO_DOCK_USER = "timeout_to_dock_user";
        /**
         * Backup manager behavioral parameters.
+5 −5
Original line number Diff line number Diff line
@@ -2438,8 +2438,8 @@
    <integer name="config_dreamsBatteryLevelDrainCutoff">5</integer>
    <!-- Limit of how long the device can remain unlocked due to attention checking.  -->
    <integer name="config_attentionMaximumExtension">900000</integer> <!-- 15 minutes.  -->
    <!-- Is the system user the only user allowed to dream. -->
    <bool name="config_dreamsOnlyEnabledForSystemUser">false</bool>
    <!-- Whether there is to be a chosen Dock User who is the only user allowed to dream. -->
    <bool name="config_dreamsOnlyEnabledForDockUser">false</bool>
    <!-- Whether dreams are disabled when ambient mode is suppressed. -->
    <bool name="config_dreamsDisabledByAmbientModeSuppressionConfig">false</bool>

@@ -2688,9 +2688,9 @@
         Should be false for most devices, except automotive vehicle with passenger displays. -->
    <bool name="config_multiuserUsersOnSecondaryDisplays">false</bool>

    <!-- Whether to automatically switch a non-primary user back to the primary user after a
         timeout when the device is docked.  -->
    <bool name="config_enableTimeoutToUserZeroWhenDocked">false</bool>
    <!-- Whether to automatically switch to the designated Dock User (the user chosen for
         displaying dreams, etc.) after a timeout when the device is docked.  -->
    <bool name="config_enableTimeoutToDockUserWhenDocked">false</bool>

    <!-- Whether to only install system packages on a user if they're allowlisted for that user
         type. These are flags and can be freely combined.
+2 −2
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@
  <java-symbol type="integer" name="config_multiuserMaxRunningUsers" />
  <java-symbol type="bool" name="config_multiuserDelayUserDataLocking" />
  <java-symbol type="bool" name="config_multiuserUsersOnSecondaryDisplays" />
  <java-symbol type="bool" name="config_enableTimeoutToUserZeroWhenDocked" />
  <java-symbol type="bool" name="config_enableTimeoutToDockUserWhenDocked" />
  <java-symbol type="integer" name="config_userTypePackageWhitelistMode"/>
  <java-symbol type="xml" name="config_user_types" />
  <java-symbol type="integer" name="config_safe_media_volume_index" />
@@ -2237,7 +2237,7 @@
  <java-symbol type="integer" name="config_dreamsBatteryLevelDrainCutoff" />
  <java-symbol type="string" name="config_dreamsDefaultComponent" />
  <java-symbol type="bool" name="config_dreamsDisabledByAmbientModeSuppressionConfig" />
  <java-symbol type="bool" name="config_dreamsOnlyEnabledForSystemUser" />
  <java-symbol type="bool" name="config_dreamsOnlyEnabledForDockUser" />
  <java-symbol type="integer" name="config_dreamOpenAnimationDuration" />
  <java-symbol type="integer" name="config_dreamCloseAnimationDuration" />
  <java-symbol type="array" name="config_supportedDreamComplications" />
+1 −1
Original line number Diff line number Diff line
@@ -884,7 +884,7 @@ public class SettingsBackupTest {
                        Settings.Secure.SHOW_QR_CODE_SCANNER_SETTING,
                        Settings.Secure.SKIP_ACCESSIBILITY_SHORTCUT_DIALOG_TIMEOUT_RESTRICTION,
                        Settings.Secure.SPATIAL_AUDIO_ENABLED,
                        Settings.Secure.TIMEOUT_TO_USER_ZERO,
                        Settings.Secure.TIMEOUT_TO_DOCK_USER,
                        Settings.Secure.UI_NIGHT_MODE_LAST_COMPUTED,
                        Settings.Secure.UI_NIGHT_MODE_OVERRIDE_OFF,
                        Settings.Secure.UI_NIGHT_MODE_OVERRIDE_ON);
+4 −4
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ import dagger.Provides;
            DreamOverlayComponent.class,
        })
public interface DreamModule {
    String DREAM_ONLY_ENABLED_FOR_SYSTEM_USER = "dream_only_enabled_for_system_user";
    String DREAM_ONLY_ENABLED_FOR_DOCK_USER = "dream_only_enabled_for_dock_user";

    String DREAM_SUPPORTED = "dream_supported";

@@ -70,10 +70,10 @@ public interface DreamModule {

    /** */
    @Provides
    @Named(DREAM_ONLY_ENABLED_FOR_SYSTEM_USER)
    static boolean providesDreamOnlyEnabledForSystemUser(@Main Resources resources) {
    @Named(DREAM_ONLY_ENABLED_FOR_DOCK_USER)
    static boolean providesDreamOnlyEnabledForDockUser(@Main Resources resources) {
        return resources.getBoolean(
                com.android.internal.R.bool.config_dreamsOnlyEnabledForSystemUser);
                com.android.internal.R.bool.config_dreamsOnlyEnabledForDockUser);
    }

    /** */
Loading