Merge "Added UserManager.isUsersOnSecondaryDisplaysSupported()"

This commit is contained in:
TreeHugger Robot
2022-08-08 21:54:32 +00:00
committed by Android (Google) Code Review
4 changed files with 29 additions and 0 deletions

View File

@@ -2837,6 +2837,26 @@ public class UserManager {
}
}
/**
* @hide
*/
public static boolean isUsersOnSecondaryDisplaysEnabled() {
return SystemProperties.getBoolean("fw.users_on_secondary_displays",
Resources.getSystem()
.getBoolean(R.bool.config_multiuserUsersOnSecondaryDisplays));
}
/**
* Returns whether the device allows users to run (and launch activities) on secondary displays.
*
* @return {@code false} for most devices, except automotive vehicles with passenger displays.
*
* @hide
*/
public boolean isUsersOnSecondaryDisplaysSupported() {
return isUsersOnSecondaryDisplaysEnabled();
}
/**
* Return whether the context user is running in an "unlocked" state.
* <p>

View File

@@ -2629,6 +2629,10 @@
will be locked. -->
<bool name="config_multiuserDelayUserDataLocking">false</bool>
<!-- Whether the device allows users to start in background on secondary displays.
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>

View File

@@ -453,6 +453,7 @@
<java-symbol type="integer" name="config_multiuserMaximumUsers" />
<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="integer" name="config_userTypePackageWhitelistMode"/>
<java-symbol type="xml" name="config_user_types" />

View File

@@ -6010,6 +6010,10 @@ public class UserManagerService extends IUserManager.Stub {
} // synchronized (mPackagesLock)
// Multiple Users on Multiple Display info
pw.println(" Supports users on secondary displays: "
+ UserManager.isUsersOnSecondaryDisplaysEnabled());
// Dump some capabilities
pw.println();
pw.print(" Max users: " + UserManager.getMaxSupportedUsers());