summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/os/UserManager.java17
-rw-r--r--core/java/android/view/HardwareRenderer.java53
-rw-r--r--core/res/res/layout-land/keyguard_host_view.xml9
-rw-r--r--core/res/res/layout-port/keyguard_host_view.xml7
-rw-r--r--core/res/res/layout-sw600dp-port/keyguard_host_view.xml11
-rw-r--r--core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml6
-rw-r--r--core/res/res/values-sw720dp/dimens.xml3
-rwxr-xr-xcore/res/res/values/attrs.xml37
8 files changed, 87 insertions, 56 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 898c766..d73f99a 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -122,7 +122,7 @@ public class UserManager {
* @param userHandle the user handle of the user whose information is being requested.
* @return the UserInfo object for a specific user.
* @hide
- * */
+ */
public UserInfo getUserInfo(int userHandle) {
try {
return mService.getUserInfo(userHandle);
@@ -134,10 +134,11 @@ public class UserManager {
/**
* Return the serial number for a user. This is a device-unique
- * number assigned to that user; if the user is deleted and new users
- * created, the new users will not be given the same serial number.
+ * number assigned to that user; if the user is deleted and then a new
+ * user created, the new users will not be given the same serial number.
* @param user The user whose serial number is to be retrieved.
- * @return The serial number of the given user.
+ * @return The serial number of the given user; returns -1 if the
+ * given UserHandle does not exist.
* @see #getUserForSerialNumber(long)
*/
public long getSerialNumberForUser(UserHandle user) {
@@ -179,6 +180,14 @@ public class UserManager {
}
/**
+ * Return the number of users currently created on the device.
+ */
+ public int getUserCount() {
+ List<UserInfo> users = getUsers();
+ return users != null ? users.size() : 1;
+ }
+
+ /**
* Returns information for all users on this device.
* Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
* @return the list of users that were created.
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 59f941d..1c613245 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -1526,30 +1526,6 @@ public abstract class HardwareRenderer {
}
@Override
- void destroyLayers(View view) {
- if (view != null && isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) {
- if (mCanvas != null) {
- mCanvas.clearLayerUpdates();
- }
- destroyHardwareLayer(view);
- GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
- }
- }
-
- private static void destroyHardwareLayer(View view) {
- view.destroyLayer(true);
-
- if (view instanceof ViewGroup) {
- ViewGroup group = (ViewGroup) view;
-
- int count = group.getChildCount();
- for (int i = 0; i < count; i++) {
- destroyHardwareLayer(group.getChildAt(i));
- }
- }
- }
-
- @Override
boolean safelyRun(Runnable action) {
boolean needsContext = true;
if (isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) needsContext = false;
@@ -1574,6 +1550,35 @@ public abstract class HardwareRenderer {
}
@Override
+ void destroyLayers(final View view) {
+ if (view != null) {
+ safelyRun(new Runnable() {
+ @Override
+ public void run() {
+ if (mCanvas != null) {
+ mCanvas.clearLayerUpdates();
+ }
+ destroyHardwareLayer(view);
+ GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
+ }
+ });
+ }
+ }
+
+ private static void destroyHardwareLayer(View view) {
+ view.destroyLayer(true);
+
+ if (view instanceof ViewGroup) {
+ ViewGroup group = (ViewGroup) view;
+
+ int count = group.getChildCount();
+ for (int i = 0; i < count; i++) {
+ destroyHardwareLayer(group.getChildAt(i));
+ }
+ }
+ }
+
+ @Override
void destroyHardwareResources(final View view) {
if (view != null) {
safelyRun(new Runnable() {
diff --git a/core/res/res/layout-land/keyguard_host_view.xml b/core/res/res/layout-land/keyguard_host_view.xml
index 4365a88..e76951b 100644
--- a/core/res/res/layout-land/keyguard_host_view.xml
+++ b/core/res/res/layout-land/keyguard_host_view.xml
@@ -41,6 +41,13 @@
androidprv:layout_maxWidth="480dp"
androidprv:layout_maxHeight="480dp" />
+ <include layout="@layout/keyguard_multi_user_selector"/>
+
+ <View android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_childType="scrim"
+ android:background="#99000000" />
+
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
@@ -61,8 +68,6 @@
</com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
</com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
- <include layout="@layout/keyguard_multi_user_selector"/>
-
</com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout>
</com.android.internal.policy.impl.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-port/keyguard_host_view.xml b/core/res/res/layout-port/keyguard_host_view.xml
index 74b136a..9809135 100644
--- a/core/res/res/layout-port/keyguard_host_view.xml
+++ b/core/res/res/layout-port/keyguard_host_view.xml
@@ -43,11 +43,16 @@
android:layout_gravity="center"/>
</FrameLayout>
+ <View android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ androidprv:layout_childType="scrim"
+ android:background="#99000000" />
+
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- androidprv:layout_isChallenge="true"
+ androidprv:layout_childType="challenge"
android:gravity="bottom|center_horizontal"
android:background="@drawable/security_frame">
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
diff --git a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
index e100788..9e5fc48 100644
--- a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
+++ b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
@@ -42,12 +42,19 @@
androidprv:layout_maxWidth="480dp"
androidprv:layout_maxHeight="480dp" />
+ <include layout="@layout/keyguard_multi_user_selector"/>
+
+ <View android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ androidprv:layout_childType="scrim"
+ android:background="#99000000" />
+
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androidprv:layout_childType="challenge"
- androidprv:layout_centerWithinArea="0.55">
+ android:layout_gravity="center_horizontal|bottom">
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="wrap_content"
@@ -62,7 +69,5 @@
</com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
</com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
- <include layout="@layout/keyguard_multi_user_selector"/>
-
</com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout>
</com.android.internal.policy.impl.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml b/core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml
index 1eef099..207bc57 100644
--- a/core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml
+++ b/core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml
@@ -18,7 +18,7 @@
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<include layout="@layout/keyguard_glow_pad_view"
- android:layout_width="@dimen/kg_glow_pad_size"
- android:layout_height="@dimen/kg_glow_pad_size"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center" />
-</merge> \ No newline at end of file
+</merge>
diff --git a/core/res/res/values-sw720dp/dimens.xml b/core/res/res/values-sw720dp/dimens.xml
index 67fe2c0..d6d2b66 100644
--- a/core/res/res/values-sw720dp/dimens.xml
+++ b/core/res/res/values-sw720dp/dimens.xml
@@ -101,9 +101,6 @@
<dimen name="kg_runway_lights_top_margin">-30dp</dimen>
<!-- Margin around the various security views -->
- <dimen name="keyguard_security_view_margin">100dp</dimen>
-
- <!-- Margin around the various security views -->
<dimen name="keyguard_muliuser_selector_margin">24dp</dimen>
<!-- Stroke width of the frame for the circular avatars. -->
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 30e1b9e..176103d 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -5776,12 +5776,31 @@
<attr name="leftToRight" format="boolean" />
</declare-styleable>
+ <!-- Some child types have special behavior. -->
+ <attr name="layout_childType">
+ <!-- No special behavior. Layout will proceed as normal. -->
+ <enum name="none" value="0" />
+ <!-- Widget container.
+ This will be resized in response to certain events. -->
+ <enum name="widget" value="1" />
+ <!-- Security challenge container.
+ This will be dismissed/shown in response to certain events,
+ possibly obscuring widget elements. -->
+ <enum name="challenge" value="2" />
+ <!-- User switcher.
+ This will consume space from the total layout area. -->
+ <enum name="userSwitcher" value="3" />
+ <!-- Scrim. This will block access to child views that
+ come before it in the child list in bouncer mode. -->
+ <enum name="scrim" value="4" />
+ </attr>
+
<declare-styleable name="SlidingChallengeLayout">
<attr name="dragHandle" format="reference" />
</declare-styleable>
<declare-styleable name="SlidingChallengeLayout_Layout">
- <attr name="layout_isChallenge" format="boolean" />
+ <attr name="layout_childType" />
</declare-styleable>
<!-- Attributes that can be used with <code>&lt;FragmentBreadCrumbs&gt;</code>
@@ -5800,21 +5819,7 @@
If 0/default, the view will be measured by standard rules
as if this were a FrameLayout. -->
<attr name="layout_centerWithinArea" format="float" />
- <!-- Some child types have special behavior. -->
- <attr name="layout_childType">
- <!-- No special behavior. Layout will proceed as normal. -->
- <enum name="none" value="0" />
- <!-- Widget container.
- This will be resized in response to certain events. -->
- <enum name="widget" value="1" />
- <!-- Security challenge container.
- This will be dismissed/shown in response to certain events,
- possibly obscuring widget elements. -->
- <enum name="challenge" value="2" />
- <!-- User switcher.
- This will consume space from the total layout area. -->
- <enum name="userSwitcher" value="3" />
- </attr>
+ <attr name="layout_childType" />
<attr name="layout_gravity" />
<attr name="layout_maxWidth" format="dimension" />
<attr name="layout_maxHeight" />