diff options
Diffstat (limited to 'packages/SystemUI')
9 files changed, 105 insertions, 90 deletions
diff --git a/packages/SystemUI/res/drawable/ic_account_circle.xml b/packages/SystemUI/res/drawable/ic_account_circle.xml deleted file mode 100644 index d8649e5..0000000 --- a/packages/SystemUI/res/drawable/ic_account_circle.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!-- -Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - - <group - android:scaleX="1.2" - android:scaleY="1.2" - android:pivotX="12.0" - android:pivotY="12.0"> - <path - android:fillColor="#FFFFFFFF" - android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,5.0c1.7,0.0 3.0,1.3 3.0,3.0c0.0,1.7 -1.3,3.0 -3.0,3.0c-1.7,0.0 -3.0,-1.3 -3.0,-3.0C9.0,6.3 10.3,5.0 12.0,5.0zM12.0,19.2c-2.5,0.0 -4.7,-1.3 -6.0,-3.2c0.0,-2.0 4.0,-3.1 6.0,-3.1c2.0,0.0 6.0,1.1 6.0,3.1C16.7,17.9 14.5,19.2 12.0,19.2z"/> - </group> -</vector> diff --git a/packages/SystemUI/res/drawable/ic_account_circle_qs.xml b/packages/SystemUI/res/drawable/ic_account_circle_qs.xml deleted file mode 100644 index d10a96d..0000000 --- a/packages/SystemUI/res/drawable/ic_account_circle_qs.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> - -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - - <group - android:scaleX="1.2" - android:scaleY="1.2" - android:pivotX="12.0" - android:pivotY="12.0"> - <path - android:fillColor="@color/qs_user_detail_icon_muted" - android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,5.0c1.7,0.0 3.0,1.3 3.0,3.0c0.0,1.7 -1.3,3.0 -3.0,3.0c-1.7,0.0 -3.0,-1.3 -3.0,-3.0C9.0,6.3 10.3,5.0 12.0,5.0zM12.0,19.2c-2.5,0.0 -4.7,-1.3 -6.0,-3.2c0.0,-2.0 4.0,-3.1 6.0,-3.1c2.0,0.0 6.0,1.1 6.0,3.1C16.7,17.9 14.5,19.2 12.0,19.2z"/> - </group> -</vector> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index f7e0c83..ce3739c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -92,6 +92,7 @@ import com.android.systemui.SwipeHelper; import com.android.systemui.SystemUI; import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.phone.KeyguardTouchDelegate; +import com.android.systemui.statusbar.phone.PhoneStatusBar; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.HeadsUpNotificationView; import com.android.systemui.statusbar.policy.PreviewInflater; @@ -288,6 +289,10 @@ public abstract class BaseStatusBar extends SystemUI implements // close the shade if it was open if (handled) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from mOnClickHandler after keyguard" + + "dismiss"); + } animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); visibilityChanged(false); } @@ -334,6 +339,9 @@ public abstract class BaseStatusBar extends SystemUI implements Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.SHOW_NOTE_ABOUT_NOTIFICATION_HIDING, 0); if (BANNER_ACTION_SETUP.equals(action)) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Animating collapse because of BANNER_ACTION_SETUP"); + } animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); mContext.startActivity(new Intent(Settings.ACTION_APP_NOTIFICATION_REDACTION) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) @@ -759,6 +767,10 @@ public abstract class BaseStatusBar extends SystemUI implements } } }); + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from startNotificationGutsIntent after keyguard" + + "dismiss"); + } animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index e84ca52..20eed3f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -128,6 +128,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL public boolean performAccessibilityAction(View host, int action, Bundle args) { if (action == ACTION_CLICK) { if (host == mLockIcon) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from lock icon accessibility click"); + } mPhoneStatusBar.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); return true; @@ -373,7 +376,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL return; } // TODO: Real icon for facelock. - int iconRes = mUnlockMethodCache.isFaceUnlockRunning() ? R.drawable.ic_account_circle + int iconRes = mUnlockMethodCache.isFaceUnlockRunning() + ? com.android.internal.R.drawable.ic_account_circle : mUnlockMethodCache.isMethodInsecure() ? R.drawable.ic_lock_open_24dp : R.drawable.ic_lock_24dp; mLockIcon.setImageResource(iconRes); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index f74d2f4..ccafbd1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -140,6 +140,9 @@ public class PanelBar extends FrameLayout { mPanelHolder.setSelectedPanel(mTouchingPanel); for (PanelView pv : mPanels) { if (pv != panel) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing because opening another panel"); + } pv.collapse(false /* delayed */); } } @@ -191,9 +194,15 @@ public class PanelBar extends FrameLayout { boolean waiting = false; for (PanelView pv : mPanels) { if (animate && !pv.isFullyCollapsed()) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Animating collapse, delayed"); + } pv.collapse(true /* delayed */); waiting = true; } else { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing without animation"); + } pv.resetViews(); pv.setExpandedFraction(0); // just in case pv.setVisibility(View.GONE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 006e480..c3b263d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -134,6 +134,9 @@ public abstract class PanelView extends FrameLayout { } private void runPeekAnimation() { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Starting peek animation"); + } mPeekHeight = getPeekHeight(); if (DEBUG) logf("peek to height=%.1f", mPeekHeight); if (mHeightAnimator != null) { @@ -154,9 +157,15 @@ public abstract class PanelView extends FrameLayout { public void onAnimationEnd(Animator animation) { mPeekAnimator = null; if (mCollapseAfterPeek && !mCancelled) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Peek animation finished, posting collapse"); + } postOnAnimation(new Runnable() { @Override public void run() { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Peek animation finished, collapsing"); + } collapse(false /* delayed */); } }); @@ -330,6 +339,9 @@ public abstract class PanelView extends FrameLayout { } boolean expand = flingExpands(vel, vectorVel); onTrackingStopped(expand); + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Flinging: expand=" + expand); + } fling(vel, expand); mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown; if (mUpdateFlingOnLayout) { @@ -510,6 +522,9 @@ public abstract class PanelView extends FrameLayout { notifyExpandingFinished(); return; } + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Executing fling: expand=" + expand + " vel=" + vel); + } mOverExpandedBeforeFling = getOverExpansionAmount() > 0f; ValueAnimator animator = createHeightAnimator(target); if (expand) { @@ -691,8 +706,14 @@ public abstract class PanelView extends FrameLayout { mClosing = true; notifyExpandingStarted(); if (delayed) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Posting collapse runnable, will be run in 120ms"); + } postDelayed(mFlingCollapseRunnable, 120); } else { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Animating collapsing now"); + } fling(0, false /* expand */); } } @@ -701,6 +722,9 @@ public abstract class PanelView extends FrameLayout { private final Runnable mFlingCollapseRunnable = new Runnable() { @Override public void run() { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Executing collapse runnable, animating collapsing now"); + } fling(0, false /* expand */); } }; @@ -729,6 +753,11 @@ public abstract class PanelView extends FrameLayout { } public void instantExpand() { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Before instant expanding" + + " mTracking=" + mTracking + + " mExpanding=" + mExpanding); + } mInstantExpanding = true; mUpdateFlingOnLayout = false; abortAnimations(); @@ -749,6 +778,11 @@ public abstract class PanelView extends FrameLayout { public void onGlobalLayout() { if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Now instant expanding after layout" + + " mTracking=" + mTracking + + " mExpanding=" + mExpanding); + } getViewTreeObserver().removeOnGlobalLayoutListener(this); setExpandedFraction(1f); mInstantExpanding = false; @@ -895,6 +929,9 @@ public abstract class PanelView extends FrameLayout { private final Runnable mPostCollapseRunnable = new Runnable() { @Override public void run() { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing after middle clicked"); + } collapse(false /* delayed */); } }; @@ -907,6 +944,9 @@ public abstract class PanelView extends FrameLayout { mStatusBar.goToKeyguard(); return true; case StatusBarState.SHADE: + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Middle clicked in shade state, posting collapsing runnable"); + } // This gets called in the middle of the touch handling, where the state is still // that we are tracking the panel. Collapse the panel after this is done. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 271383f..fd60ac4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -177,6 +177,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public static final boolean DEBUG_GESTURES = false; public static final boolean DEBUG_MEDIA = false; public static final boolean DEBUG_MEDIA_FAKE_ARTWORK = false; + public static final boolean DEBUG_EMPTY_KEYGUARD = true; public static final boolean DEBUG_WINDOW_STATE = false; @@ -2238,6 +2239,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowManager.setStatusBarFocusable(false); mStatusBarWindow.cancelExpandHelper(); + if (DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from animateCollapsePanels:" + + " force=" + force + + " mState=" + mState); + } mStatusBarView.collapseAllPanels(true); } } @@ -2325,6 +2331,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } public void animateCollapseQuickSettings() { + if (DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from animateCollapseQuickSettings"); + } mStatusBarView.collapseAllPanels(true); } @@ -2337,6 +2346,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } // Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868) + if (DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from makeExpandedInvisible"); + } mStatusBarView.collapseAllPanels(/*animate=*/ false); // reset things to their proper state @@ -2430,6 +2442,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowState = state; if (DEBUG_WINDOW_STATE) Log.d(TAG, "Status bar " + windowStateToString(state)); if (!showing) { + if (DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from setWindowState"); + } mStatusBarView.collapseAllPanels(false); } } @@ -2987,6 +3002,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } }); if (dismissShade) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel startActivityDismissKeyguard after keyguard" + + "dismiss"); + } animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); } return true; @@ -3654,6 +3673,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public boolean onSpacePressed() { if (mScreenOn != null && mScreenOn && (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { + Log.i(TAG, "Collapsing panel from onSpacePressed"); + } animateCollapsePanels(0 /* flags */, true /* force */); return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoController.java index 8cbe272..d50e39f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoController.java @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.policy; import android.app.ActivityManagerNative; -import android.bluetooth.BluetoothAdapter; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -26,33 +25,21 @@ import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.database.Cursor; import android.graphics.Bitmap; -import android.graphics.BitmapShader; -import android.graphics.Canvas; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.graphics.PorterDuff; -import android.graphics.PorterDuffXfermode; -import android.graphics.Rect; -import android.graphics.RectF; -import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.hardware.display.DisplayManager; import android.os.AsyncTask; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.ContactsContract; -import android.security.KeyChain; import android.util.Log; import android.util.Pair; -import com.android.internal.view.RotationPolicy; import com.android.systemui.BitmapHelper; import com.android.systemui.R; +import com.android.internal.util.UserIcons; import java.util.ArrayList; -import java.util.concurrent.CopyOnWriteArrayList; public final class UserInfoController { @@ -142,6 +129,7 @@ public final class UserInfoController { throw new RuntimeException(e); } final int userId = userInfo.id; + final boolean isGuest = userInfo.isGuest(); final String userName = userInfo.name; final int avatarSize = mContext.getResources().getDimensionPixelSize(R.dimen.max_avatar_size); @@ -161,7 +149,8 @@ public final class UserInfoController { avatar = new BitmapDrawable(mContext.getResources(), BitmapHelper.createCircularClip(rawAvatar, avatarSize, avatarSize)); } else { - avatar = mContext.getResources().getDrawable(R.drawable.ic_account_circle); + avatar = UserIcons.getDefaultUserIcon(isGuest? UserHandle.USER_NULL : userId, + /* light= */ true); mUseDefaultAvatar = true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index d02826f..e8f35fd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -16,13 +16,6 @@ package com.android.systemui.statusbar.policy; -import com.android.systemui.BitmapHelper; -import com.android.systemui.GuestResumeSessionReceiver; -import com.android.systemui.R; -import com.android.systemui.qs.QSTile; -import com.android.systemui.qs.tiles.UserDetailView; -import com.android.systemui.statusbar.phone.SystemUIDialog; - import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.Dialog; @@ -45,9 +38,16 @@ import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManagerGlobal; import android.widget.BaseAdapter; +import com.android.internal.util.UserIcons; +import com.android.systemui.BitmapHelper; +import com.android.systemui.GuestResumeSessionReceiver; +import com.android.systemui.R; +import com.android.systemui.qs.QSTile; +import com.android.systemui.qs.tiles.UserDetailView; +import com.android.systemui.statusbar.phone.SystemUIDialog; + import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.ref.WeakReference; @@ -425,7 +425,8 @@ public class UserSwitcherController { if (item.isAddUser) { return context.getDrawable(R.drawable.ic_add_circle_qs); } - return context.getDrawable(R.drawable.ic_account_circle_qs); + return UserIcons.getDefaultUserIcon(item.isGuest ? UserHandle.USER_NULL : item.info.id, + /* light= */ true); } } @@ -565,6 +566,9 @@ public class UserSwitcherController { dismiss(); int id = mUserManager.createUser( mContext.getString(R.string.user_new_user_name), 0 /* flags */).id; + Bitmap icon = UserIcons.convertToBitmap(UserIcons.getDefaultUserIcon( + id, /* light= */ false)); + mUserManager.setUserIcon(id, icon); switchToUserId(id); } } |
