Loading core/res/res/layout/keyguard_multi_user_selector_widget.xml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ <!-- This is a view that shows general status information in Keyguard. --> <com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyguard_multi_user_selector" android:layout_width="match_parent" android:layout_height="match_parent"> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1299,6 +1299,7 @@ <java-symbol type="id" name="kg_widget_region" /> <java-symbol type="id" name="left_strip" /> <java-symbol type="id" name="right_strip" /> <java-symbol type="id" name="keyguard_multi_user_selector" /> <java-symbol type="integer" name="config_carDockRotation" /> <java-symbol type="integer" name="config_defaultUiModeType" /> Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +4 −0 Original line number Diff line number Diff line Loading @@ -820,4 +820,8 @@ public class KeyguardHostView extends KeyguardViewBase { } } public void goToUserSwitcher() { mAppWidgetContainer.setCurrentPage(getWidgetPosition(R.id.keyguard_multi_user_selector)); } } policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserAvatar.java +5 −5 Original line number Diff line number Diff line Loading @@ -71,10 +71,6 @@ class KeyguardMultiUserAvatar extends FrameLayout { public KeyguardMultiUserAvatar(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); Resources res = context.getResources(); mActiveTextColor = res.getColor(R.color.kg_multi_user_text_active); mInactiveTextColor = res.getColor(R.color.kg_multi_user_text_inactive); } public void setup(UserInfo user, KeyguardMultiUserSelectorView userSelector) { Loading @@ -84,6 +80,10 @@ class KeyguardMultiUserAvatar extends FrameLayout { } private void init() { Resources res = mContext.getResources(); mActiveTextColor = res.getColor(R.color.kg_multi_user_text_active); mInactiveTextColor = res.getColor(R.color.kg_multi_user_text_inactive); mUserImage = (ImageView) findViewById(R.id.keyguard_user_avatar); mUserName = (TextView) findViewById(R.id.keyguard_user_name); Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +21 −7 Original line number Diff line number Diff line Loading @@ -24,9 +24,11 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.Parcelable; import android.os.SystemProperties; import android.util.Log; import android.util.Slog; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading Loading @@ -89,7 +91,7 @@ public class KeyguardViewManager { boolean enableScreenRotation = shouldEnableScreenRotation(); maybeCreateKeyguardLocked(enableScreenRotation); maybeCreateKeyguardLocked(enableScreenRotation, false); maybeEnableScreenRotation(enableScreenRotation); // Disable common aspects of the system/status/navigation bars that are not appropriate or Loading Loading @@ -120,13 +122,19 @@ public class KeyguardViewManager { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); maybeCreateKeyguardLocked(shouldEnableScreenRotation()); maybeCreateKeyguardLocked(shouldEnableScreenRotation(), false); } } private void maybeCreateKeyguardLocked(boolean enableScreenRotation) { SparseArray<Parcelable> mStateContainer = new SparseArray<Parcelable>(); private void maybeCreateKeyguardLocked(boolean enableScreenRotation, boolean userSwitched) { final boolean isActivity = (mContext instanceof Activity); // for test activity if (mKeyguardHost != null) { mKeyguardHost.saveHierarchyState(mStateContainer); } if (mKeyguardHost == null) { if (DEBUG) Log.d(TAG, "keyguard host is null, creating it..."); Loading Loading @@ -161,11 +169,13 @@ public class KeyguardViewManager { mWindowLayoutParams = lp; mViewManager.addView(mKeyguardHost, lp); } inflateKeyguardView(); inflateKeyguardView(userSwitched); mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); mKeyguardHost.restoreHierarchyState(mStateContainer); } private void inflateKeyguardView() { private void inflateKeyguardView(boolean userSwitched) { View v = mKeyguardHost.findViewById(R.id.keyguard_host_view); if (v != null) { mKeyguardHost.removeView(v); Loading @@ -179,6 +189,10 @@ public class KeyguardViewManager { mKeyguardView.setLockPatternUtils(mLockPatternUtils); mKeyguardView.setViewMediatorCallback(mViewMediatorCallback); if (userSwitched) { mKeyguardView.goToUserSwitcher(); } if (mScreenOn) { mKeyguardView.show(); } Loading Loading @@ -219,11 +233,11 @@ public class KeyguardViewManager { /** * Reset the state of the view. */ public synchronized void reset() { public synchronized void reset(boolean userSwitched) { if (DEBUG) Log.d(TAG, "reset()"); // User might have switched, check if we need to go back to keyguard // TODO: It's preferable to stay and show the correct lockscreen or unlock if none maybeCreateKeyguardLocked(shouldEnableScreenRotation()); maybeCreateKeyguardLocked(shouldEnableScreenRotation(), userSwitched); } public synchronized void onScreenTurnedOff() { Loading Loading
core/res/res/layout/keyguard_multi_user_selector_widget.xml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ <!-- This is a view that shows general status information in Keyguard. --> <com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyguard_multi_user_selector" android:layout_width="match_parent" android:layout_height="match_parent"> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1299,6 +1299,7 @@ <java-symbol type="id" name="kg_widget_region" /> <java-symbol type="id" name="left_strip" /> <java-symbol type="id" name="right_strip" /> <java-symbol type="id" name="keyguard_multi_user_selector" /> <java-symbol type="integer" name="config_carDockRotation" /> <java-symbol type="integer" name="config_defaultUiModeType" /> Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +4 −0 Original line number Diff line number Diff line Loading @@ -820,4 +820,8 @@ public class KeyguardHostView extends KeyguardViewBase { } } public void goToUserSwitcher() { mAppWidgetContainer.setCurrentPage(getWidgetPosition(R.id.keyguard_multi_user_selector)); } }
policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserAvatar.java +5 −5 Original line number Diff line number Diff line Loading @@ -71,10 +71,6 @@ class KeyguardMultiUserAvatar extends FrameLayout { public KeyguardMultiUserAvatar(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); Resources res = context.getResources(); mActiveTextColor = res.getColor(R.color.kg_multi_user_text_active); mInactiveTextColor = res.getColor(R.color.kg_multi_user_text_inactive); } public void setup(UserInfo user, KeyguardMultiUserSelectorView userSelector) { Loading @@ -84,6 +80,10 @@ class KeyguardMultiUserAvatar extends FrameLayout { } private void init() { Resources res = mContext.getResources(); mActiveTextColor = res.getColor(R.color.kg_multi_user_text_active); mInactiveTextColor = res.getColor(R.color.kg_multi_user_text_inactive); mUserImage = (ImageView) findViewById(R.id.keyguard_user_avatar); mUserName = (TextView) findViewById(R.id.keyguard_user_name); Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +21 −7 Original line number Diff line number Diff line Loading @@ -24,9 +24,11 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.Parcelable; import android.os.SystemProperties; import android.util.Log; import android.util.Slog; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading Loading @@ -89,7 +91,7 @@ public class KeyguardViewManager { boolean enableScreenRotation = shouldEnableScreenRotation(); maybeCreateKeyguardLocked(enableScreenRotation); maybeCreateKeyguardLocked(enableScreenRotation, false); maybeEnableScreenRotation(enableScreenRotation); // Disable common aspects of the system/status/navigation bars that are not appropriate or Loading Loading @@ -120,13 +122,19 @@ public class KeyguardViewManager { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); maybeCreateKeyguardLocked(shouldEnableScreenRotation()); maybeCreateKeyguardLocked(shouldEnableScreenRotation(), false); } } private void maybeCreateKeyguardLocked(boolean enableScreenRotation) { SparseArray<Parcelable> mStateContainer = new SparseArray<Parcelable>(); private void maybeCreateKeyguardLocked(boolean enableScreenRotation, boolean userSwitched) { final boolean isActivity = (mContext instanceof Activity); // for test activity if (mKeyguardHost != null) { mKeyguardHost.saveHierarchyState(mStateContainer); } if (mKeyguardHost == null) { if (DEBUG) Log.d(TAG, "keyguard host is null, creating it..."); Loading Loading @@ -161,11 +169,13 @@ public class KeyguardViewManager { mWindowLayoutParams = lp; mViewManager.addView(mKeyguardHost, lp); } inflateKeyguardView(); inflateKeyguardView(userSwitched); mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); mKeyguardHost.restoreHierarchyState(mStateContainer); } private void inflateKeyguardView() { private void inflateKeyguardView(boolean userSwitched) { View v = mKeyguardHost.findViewById(R.id.keyguard_host_view); if (v != null) { mKeyguardHost.removeView(v); Loading @@ -179,6 +189,10 @@ public class KeyguardViewManager { mKeyguardView.setLockPatternUtils(mLockPatternUtils); mKeyguardView.setViewMediatorCallback(mViewMediatorCallback); if (userSwitched) { mKeyguardView.goToUserSwitcher(); } if (mScreenOn) { mKeyguardView.show(); } Loading Loading @@ -219,11 +233,11 @@ public class KeyguardViewManager { /** * Reset the state of the view. */ public synchronized void reset() { public synchronized void reset(boolean userSwitched) { if (DEBUG) Log.d(TAG, "reset()"); // User might have switched, check if we need to go back to keyguard // TODO: It's preferable to stay and show the correct lockscreen or unlock if none maybeCreateKeyguardLocked(shouldEnableScreenRotation()); maybeCreateKeyguardLocked(shouldEnableScreenRotation(), userSwitched); } public synchronized void onScreenTurnedOff() { Loading