diff options
Diffstat (limited to 'packages/SystemUI/src')
10 files changed, 83 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java index 111484b..a318efc 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java @@ -42,14 +42,21 @@ public class QSDetailClipper { } final int w = mDetail.getWidth() - x; final int h = mDetail.getHeight() - y; + int innerR = 0; + if (x < 0 || w < 0 || y < 0 || h < 0) { + innerR = Math.abs(x); + innerR = Math.min(innerR, Math.abs(y)); + innerR = Math.min(innerR, Math.abs(w)); + innerR = Math.min(innerR, Math.abs(h)); + } int r = (int) Math.ceil(Math.sqrt(x * x + y * y)); r = (int) Math.max(r, Math.ceil(Math.sqrt(w * w + y * y))); r = (int) Math.max(r, Math.ceil(Math.sqrt(w * w + h * h))); r = (int) Math.max(r, Math.ceil(Math.sqrt(x * x + h * h))); if (in) { - mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, 0, r); + mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, innerR, r); } else { - mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, r, 0); + mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, r, innerR); } mAnimator.setDuration((long)(mAnimator.getDuration() * 1.5)); if (listener != null) { diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index b4ae20d..cd4f299 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -215,9 +215,19 @@ public class QSPanel extends ViewGroup { mFooter.refreshState(); } - public void showDetailAdapter(boolean show, DetailAdapter adapter) { + public void showDetailAdapter(boolean show, DetailAdapter adapter, int[] locationInWindow) { + int xInWindow = locationInWindow[0]; + int yInWindow = locationInWindow[1]; + mDetail.getLocationInWindow(locationInWindow); + Record r = new Record(); r.detailAdapter = adapter; + r.x = xInWindow - locationInWindow[0]; + r.y = yInWindow - locationInWindow[1]; + + locationInWindow[0] = xInWindow; + locationInWindow[1] = yInWindow; + showDetail(show, r); } @@ -337,7 +347,13 @@ public class QSPanel extends ViewGroup { if (r instanceof TileRecord) { handleShowDetailTile((TileRecord) r, show); } else { - handleShowDetailImpl(r, show, getWidth() /* x */, 0/* y */); + int x = 0; + int y = 0; + if (r != null) { + x = r.x; + y = r.y; + } + handleShowDetailImpl(r, show, x, y); } } @@ -558,6 +574,8 @@ public class QSPanel extends ViewGroup { private static class Record { View detailView; DetailAdapter detailAdapter; + int x; + int y; } protected static final class TileRecord extends Record { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java index 82f5a9e..f11d83c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java @@ -42,6 +42,8 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener private boolean mKeyguardMode; final UserManager mUserManager; + private final int[] mTmpInt2 = new int[2]; + public MultiUserSwitch(Context context, AttributeSet attrs) { super(context, attrs); mUserManager = UserManager.get(getContext()); @@ -77,7 +79,15 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener UserSwitcherController userSwitcherController = mQsPanel.getHost().getUserSwitcherController(); if (userSwitcherController != null) { - mQsPanel.showDetailAdapter(true, userSwitcherController.userDetailAdapter); + View center = getChildCount() > 0 ? getChildAt(0) : this; + + center.getLocationInWindow(mTmpInt2); + mTmpInt2[0] += center.getWidth() / 2; + mTmpInt2[1] += center.getHeight() / 2; + + mQsPanel.showDetailAdapter(true, + userSwitcherController.userDetailAdapter, + mTmpInt2); } } } 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 9ef9211..c10be7c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -117,6 +117,7 @@ public class NotificationPanelView extends PanelView implements * intercepted yet. */ private boolean mIntercepting; + private boolean mPanelExpanded; private boolean mQsExpanded; private boolean mQsExpandedWhenExpandingStarted; private boolean mQsFullyExpanded; @@ -1496,13 +1497,22 @@ public class NotificationPanelView extends PanelView implements updateHeader(); updateUnlockIcon(); updateNotificationTranslucency(); - mHeadsUpManager.setIsExpanded(!isFullyCollapsed()); + updatePanelExpanded(); mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed()); if (DEBUG) { invalidate(); } } + private void updatePanelExpanded() { + boolean isExpanded = !isFullyCollapsed(); + if (mPanelExpanded != isExpanded) { + mHeadsUpManager.setIsExpanded(isExpanded); + mStatusBar.setPanelExpanded(isExpanded); + mPanelExpanded = isExpanded; + } + } + /** * @return a temporary override of {@link #mQsMaxExpansionHeight}, which is needed when * collapsing QS / the panel when QS was scrolled diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java index 1186a33..9e5cefd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java @@ -99,7 +99,7 @@ public class ObservableScrollView extends ScrollView { } else if (!mTouchEnabled) { MotionEvent cancel = MotionEvent.obtain(ev); cancel.setAction(MotionEvent.ACTION_CANCEL); - super.dispatchTouchEvent(ev); + super.dispatchTouchEvent(cancel); cancel.recycle(); mTouchCancelled = true; return false; 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 1361038..9fe591e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1967,6 +1967,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, return !mUnlockMethodCache.isCurrentlyInsecure(); } + public void setPanelExpanded(boolean isExpanded) { + mStatusBarWindowManager.setPanelExpanded(isExpanded); + } + /** * All changes to the status bar and notifications funnel through here and are batched. */ @@ -2027,7 +2031,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Expand the window to encompass the full screen in anticipation of the drag. // This is only possible to do atomically because the status bar is at the top of the screen! - mStatusBarWindowManager.setStatusBarExpanded(true); + mStatusBarWindowManager.setPanelVisible(true); mStatusBarView.setFocusable(false); visibilityChanged(true); @@ -2156,7 +2160,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, visibilityChanged(false); // Shrink the window to the size of the status bar only - mStatusBarWindowManager.setStatusBarExpanded(false); + mStatusBarWindowManager.setPanelVisible(false); mStatusBarWindowManager.setForceStatusBarVisible(false); mStatusBarView.setFocusable(true); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index 422d868..4f1c652 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -114,12 +114,12 @@ public class StatusBarWindowManager { } private void applyFocusableFlag(State state) { + boolean panelFocusable = state.statusBarFocusable && state.panelExpanded; if (state.isKeyguardShowingAndNotOccluded() && state.keyguardNeedsInput - && state.bouncerShowing - || BaseStatusBar.ENABLE_REMOTE_INPUT && state.statusBarExpanded) { + && state.bouncerShowing || BaseStatusBar.ENABLE_REMOTE_INPUT && panelFocusable) { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; - } else if (state.isKeyguardShowingAndNotOccluded() || state.statusBarFocusable) { + } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mLpChanged.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; } else { @@ -130,7 +130,7 @@ public class StatusBarWindowManager { private void applyHeight(State state) { boolean expanded = !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() - || state.statusBarExpanded || state.keyguardFadingAway || state.bouncerShowing + || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing || state.headsUpShowing); if (expanded) { mLpChanged.height = ViewGroup.LayoutParams.MATCH_PARENT; @@ -213,9 +213,9 @@ public class StatusBarWindowManager { apply(mCurrentState); } - public void setStatusBarExpanded(boolean expanded) { - mCurrentState.statusBarExpanded = expanded; - mCurrentState.statusBarFocusable = expanded; + public void setPanelVisible(boolean visible) { + mCurrentState.panelVisible = visible; + mCurrentState.statusBarFocusable = visible; apply(mCurrentState); } @@ -267,11 +267,17 @@ public class StatusBarWindowManager { apply(mCurrentState); } + public void setPanelExpanded(boolean isExpanded) { + mCurrentState.panelExpanded = isExpanded; + apply(mCurrentState); + } + private static class State { boolean keyguardShowing; boolean keyguardOccluded; boolean keyguardNeedsInput; - boolean statusBarExpanded; + boolean panelVisible; + boolean panelExpanded; boolean statusBarFocusable; boolean bouncerShowing; boolean keyguardFadingAway; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java index 114427c..ed98a15 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java @@ -59,6 +59,9 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("BluetoothController state:"); pw.print(" mLocalBluetoothManager="); pw.println(mLocalBluetoothManager); + if (mLocalBluetoothManager == null) { + return; + } pw.print(" mEnabled="); pw.println(mEnabled); pw.print(" mConnecting="); pw.println(mConnecting); pw.print(" mLastDevice="); pw.println(mLastDevice); diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index 23813d1..ad21555 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -148,6 +148,11 @@ public class StorageNotification extends SystemUI { android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS, null); // Kick current state into place + final List<DiskInfo> disks = mStorageManager.getDisks(); + for (DiskInfo disk : disks) { + onDiskScannedInternal(disk, disk.volumeCount); + } + final List<VolumeInfo> vols = mStorageManager.getVolumes(); for (VolumeInfo vol : vols) { onVolumeStateChangedInternal(vol); @@ -194,7 +199,7 @@ public class StorageNotification extends SystemUI { } private void onDiskScannedInternal(DiskInfo disk, int volumeCount) { - if (volumeCount == 0) { + if (volumeCount == 0 && disk.size > 0) { // No supported volumes found, give user option to format final CharSequence title = mContext.getString( R.string.ext_media_unmountable_notification_title, disk.getDescription()); diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index 1c6462e..09f7074 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -312,6 +312,8 @@ public class VolumeDialog { writer.print(" mShowHeaders: "); writer.println(mShowHeaders); writer.print(" mAutomute: "); writer.println(mAutomute); writer.print(" mSilentMode: "); writer.println(mSilentMode); + writer.print(" mAccessibility.mFeedbackEnabled: "); + writer.println(mAccessibility.mFeedbackEnabled); } private static int getImpliedLevel(SeekBar seekBar, int progress) { |
