diff options
Diffstat (limited to 'packages')
10 files changed, 74 insertions, 12 deletions
diff --git a/packages/SystemUI/res/layout/volume_panel.xml b/packages/SystemUI/res/layout/volume_panel.xml index bc7288d..046862f 100644 --- a/packages/SystemUI/res/layout/volume_panel.xml +++ b/packages/SystemUI/res/layout/volume_panel.xml @@ -24,6 +24,7 @@ android:id="@+id/slider_panel" android:layout_width="match_parent" android:layout_height="wrap_content" + android:minHeight="64dip" android:layout_toLeftOf="@+id/expand_button_divider" /> <ImageView diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml index ae04bf5..0936cc2 100644 --- a/packages/SystemUI/res/layout/zen_mode_panel.xml +++ b/packages/SystemUI/res/layout/zen_mode_panel.xml @@ -21,7 +21,9 @@ android:layout_height="wrap_content" android:background="@color/system_primary_color" android:orientation="vertical" - android:padding="@dimen/qs_panel_padding" > + android:paddingTop="@dimen/qs_panel_padding" + android:paddingLeft="@dimen/qs_panel_padding" + android:paddingRight="@dimen/qs_panel_padding" > <TextView android:id="@android:id/title" diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index 41c0e78..4c7f3df 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -202,6 +202,12 @@ public class KeyguardService extends Service { checkPermission(); mKeyguardViewMediator.onBootCompleted(); } + + @Override + public void startKeyguardExitAnimation(long fadeoutDuration) { + checkPermission(); + mKeyguardViewMediator.startKeyguardExitAnimation(fadeoutDuration); + } }; } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index b2872fa..7110d8d 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -46,7 +46,8 @@ import android.util.EventLog; import android.util.Log; import android.util.Slog; import android.view.ViewGroup; -import android.view.WindowManager; +import android.view.IWindowManager; +import android.view.WindowManagerGlobal; import android.view.WindowManagerPolicy; import com.android.internal.policy.IKeyguardExitCallback; @@ -137,6 +138,7 @@ public class KeyguardViewMediator extends SystemUI { private static final int SET_OCCLUDED = 12; private static final int KEYGUARD_TIMEOUT = 13; private static final int DISMISS = 17; + private static final int START_KEYGUARD_EXIT_ANIM = 18; /** * The default amount of time we stay awake (used for all key input) @@ -180,6 +182,9 @@ public class KeyguardViewMediator extends SystemUI { /** High level access to the power manager for WakeLocks */ private PowerManager mPM; + /** High level access to the window manager for dismissing keyguard animation */ + private IWindowManager mWM; + /** UserManager for querying number of users */ private UserManager mUserManager; @@ -440,6 +445,7 @@ public class KeyguardViewMediator extends SystemUI { private void setup() { mPM = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); + mWM = WindowManagerGlobal.getWindowManagerService(); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); mShowKeyguardWakeLock = mPM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "show keyguard"); mShowKeyguardWakeLock.setReferenceCounted(false); @@ -1076,6 +1082,9 @@ public class KeyguardViewMediator extends SystemUI { case DISMISS: handleDismiss(); break; + case START_KEYGUARD_EXIT_ANIM: + handleStartKeyguardExitAnimation((Long) msg.obj); + break; } } }; @@ -1207,6 +1216,19 @@ public class KeyguardViewMediator extends SystemUI { private void handleHide() { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleHide"); + try { + + // Don't actually hide the Keyguard at the moment, wait for window manager until + // it tells us it's safe to do so with startKeyguardExitAnimation. + mWM.keyguardGoingAway(); + } catch (RemoteException e) { + Log.e(TAG, "Error while calling WindowManager", e); + } + } + } + + private void handleStartKeyguardExitAnimation(long fadeoutDuration) { + synchronized (KeyguardViewMediator.this) { // only play "unlock" noises if not on a call (since the incall UI // disables the keyguard) @@ -1324,6 +1346,11 @@ public class KeyguardViewMediator extends SystemUI { return mStatusBarKeyguardViewManager; } + public void startKeyguardExitAnimation(long fadeoutDuration) { + Message msg = mHandler.obtainMessage(START_KEYGUARD_EXIT_ANIM, fadeoutDuration); + mHandler.sendMessage(msg); + } + public ViewMediatorCallback getViewMediatorCallback() { return mViewMediatorCallback; } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index bdac7a0..626fc0d 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -191,15 +191,23 @@ public class QSPanel extends ViewGroup { final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight; record.tileView.measure(exactly(cw), exactly(ch)); } - final int actualHeight = rows == 0 ? 0 : getRowTop(rows); - mDetail.measure(exactly(width), exactly(actualHeight)); - setMeasuredDimension(width, actualHeight); + int h = rows == 0 ? 0 : getRowTop(rows); + mDetail.measure(exactly(width), unspecified()); + if (mDetail.getVisibility() == VISIBLE && mDetail.getChildCount() > 0) { + final int dmh = mDetail.getMeasuredHeight(); + if (dmh > 0) h = dmh; + } + setMeasuredDimension(width, h); } private static int exactly(int size) { return MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY); } + private static int unspecified() { + return MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); + } + @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int w = getWidth(); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NotificationsTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NotificationsTile.java index 267786b..20bbf8b 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NotificationsTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NotificationsTile.java @@ -108,11 +108,7 @@ public class NotificationsTile extends QSTile<NotificationsTile.NotificationsSta @Override protected void handleClick() { - if (mState.zen) { - mZenController.setZen(false); - } else { - showDetail(true); - } + showDetail(true); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index fbe76f9..21b41c7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -182,6 +182,7 @@ public abstract class BaseStatusBar extends SystemUI implements */ protected int mState; protected boolean mBouncerShowing; + protected boolean mShowLockscreenNotifications; protected NotificationOverflowContainer mKeyguardIconOverflowContainer; @@ -201,6 +202,9 @@ public abstract class BaseStatusBar extends SystemUI implements final int mode = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF); setZenMode(mode); + final boolean show = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1) != 0; + setShowLockscreenNotifications(show); } }; @@ -362,6 +366,9 @@ public abstract class BaseStatusBar extends SystemUI implements mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.ZEN_MODE), false, mSettingsObserver); + mContext.getContentResolver().registerContentObserver( + Settings.Global.getUriFor(Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS), false, + mSettingsObserver); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS), @@ -1247,6 +1254,10 @@ public abstract class BaseStatusBar extends SystemUI implements updateNotifications(); } + protected void setShowLockscreenNotifications(boolean show) { + mShowLockscreenNotifications = show; + } + protected abstract void haltTicker(); protected abstract void setAreThereNotifications(); protected abstract void updateNotifications(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 0c27ab0..802e5e5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -164,7 +164,9 @@ public class NotificationPanelView extends PanelView implements // Calculate quick setting heights. mQsMinExpansionHeight = mHeader.getCollapsedHeight() + mQsPeekHeight; mQsMaxExpansionHeight = mHeader.getExpandedHeight() + mQsContainer.getHeight(); - if (!mQsExpanded) { + if (mQsExpanded) { + setQsStackScrollerPadding(mQsMaxExpansionHeight); + } else { setQsExpansion(mQsMinExpansionHeight); positionClockAndNotifications(); mNotificationStackScroller.setStackHeight(getExpandedHeight()); 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 5dcd61c..0e5b7e1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -505,6 +505,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } @Override + protected void setShowLockscreenNotifications(boolean show) { + super.setShowLockscreenNotifications(show); + updateStackScrollerState(); + } + + @Override public void start() { mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); @@ -2851,7 +2857,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } public void updateStackScrollerState() { + if (mStackScroller == null) return; mStackScroller.setDimmed(mState == StatusBarState.KEYGUARD, false /* animate */); + mStackScroller.setVisibility(!mShowLockscreenNotifications && mState == StatusBarState.KEYGUARD + ? View.INVISIBLE : View.VISIBLE); } public void userActivity() { diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java index 06f4c2e..67f3a3d 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java @@ -1035,8 +1035,8 @@ public class VolumePanel extends Handler { if (isShowing()) { if (mDialog != null) { mDialog.dismiss(); + mActiveStreamType = -1; } - mActiveStreamType = -1; } synchronized (sConfirmSafeVolumeLock) { if (sConfirmSafeVolumeDialog != null) { |