diff options
| author | Robin Lee <rgl@google.com> | 2018-02-09 19:27:18 +0100 |
|---|---|---|
| committer | Robin Lee <rgl@google.com> | 2018-02-23 18:43:18 +0100 |
| commit | 83c79317cc8e000fabc5ce82961a2b5e6f3b0ab3 (patch) | |
| tree | d19e9e24b5f220f7becd78ead3d87b5a69b2e934 /core/java/android/os/UserManager.java | |
| parent | 9c43e89bed52615bf2f7ab4ef85ade61f0cb1470 (diff) | |
lowRamDevice TVs can have multi-user
Svelte phones in single-user mode don't pose any problems. TVs in many
regions need multi-user in order to support a restricted profile mode.
Adds a special case for devices with UI_MODE_TYPE_TELEVISION to be able
to enable multi-user (ie. max_users will not be ignored in low_ram cases
as it is on other form factors).
Bug: 71626497
Bug: 67965409
Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
Change-Id: I6d18b9dca472b9d971d9e51a9d0f4be7403bc26a
Diffstat (limited to 'core/java/android/os/UserManager.java')
| -rw-r--r-- | core/java/android/os/UserManager.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 185620066454..cca52ac86638 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -36,6 +36,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.IntentSender; import android.content.pm.UserInfo; +import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -2530,8 +2531,13 @@ public class UserManager { public static int getMaxSupportedUsers() { // Don't allow multiple users on certain builds if (android.os.Build.ID.startsWith("JVP")) return 1; - // Svelte devices don't get multi-user. - if (ActivityManager.isLowRamDeviceStatic()) return 1; + if (ActivityManager.isLowRamDeviceStatic()) { + // Low-ram devices are Svelte. Most of the time they don't get multi-user. + if ((Resources.getSystem().getConfiguration().uiMode & Configuration.UI_MODE_TYPE_MASK) + != Configuration.UI_MODE_TYPE_TELEVISION) { + return 1; + } + } return SystemProperties.getInt("fw.max_users", Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers)); } |
