diff options
5 files changed, 37 insertions, 26 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index abe3b7ee617a..4866fca05916 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1706,6 +1706,23 @@ public abstract class BaseStatusBar extends SystemUI implements sbn.getPackageContext(mContext), contentContainerPublic, mOnClickHandler); } + + if (contentViewLocal != null) { + contentViewLocal.setIsRootNamespace(true); + contentContainer.setContractedChild(contentViewLocal); + } + if (bigContentViewLocal != null) { + bigContentViewLocal.setIsRootNamespace(true); + contentContainer.setExpandedChild(bigContentViewLocal); + } + if (headsUpContentViewLocal != null) { + headsUpContentViewLocal.setIsRootNamespace(true); + contentContainer.setHeadsUpChild(headsUpContentViewLocal); + } + if (publicViewLocal != null) { + publicViewLocal.setIsRootNamespace(true); + contentContainerPublic.setContractedChild(publicViewLocal); + } } catch (RuntimeException e) { final String ident = sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()); @@ -1713,23 +1730,6 @@ public abstract class BaseStatusBar extends SystemUI implements return false; } - if (contentViewLocal != null) { - contentViewLocal.setIsRootNamespace(true); - contentContainer.setContractedChild(contentViewLocal); - } - if (bigContentViewLocal != null) { - bigContentViewLocal.setIsRootNamespace(true); - contentContainer.setExpandedChild(bigContentViewLocal); - } - if (headsUpContentViewLocal != null) { - headsUpContentViewLocal.setIsRootNamespace(true); - contentContainer.setHeadsUpChild(headsUpContentViewLocal); - } - if (publicViewLocal != null) { - publicViewLocal.setIsRootNamespace(true); - contentContainerPublic.setContractedChild(publicViewLocal); - } - // Extract target SDK version. try { ApplicationInfo info = pmUser.getApplicationInfo(sbn.getPackageName(), 0); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index bc89db221511..f3e5c94be032 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1056,7 +1056,7 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public int getMaxExpandHeight(ExpandableView view) { int maxContentHeight = view.getMaxContentHeight(); - if (view.isSummaryWithChildren()) { + if (view.isSummaryWithChildren() && view.getParent() == this) { // Faking a measure with the group expanded to simulate how the group would look if // it was. Doing a calculation here would be highly non-trivial because of the // algorithm @@ -1071,8 +1071,11 @@ public class NotificationStackScrollLayout extends ViewGroup row.getStatusBarNotification()); mGroupExpandedForMeasure = false; row.setForceUnlocked(false); - int height = mCurrentStackScrollState.getViewStateForView(view).height; - return Math.min(height, maxContentHeight); + StackViewState viewState = mCurrentStackScrollState.getViewStateForView(view); + if (viewState != null) { + // The view could have been removed + return Math.min(viewState.height, maxContentHeight); + } } return maxContentHeight; } diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 1b552b5375e7..8c07e01d1163 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -4406,7 +4406,7 @@ final class ActivityStack { mStackSupervisor.getStack(FULLSCREEN_WORKSPACE_STACK_ID); if (fullscreenStack != null && fullscreenStack.hasVisibleBehindActivity()) { final ActivityRecord visibleBehind = fullscreenStack.getVisibleBehindActivity(); - mService.setFocusedActivityLocked(visibleBehind, "moveTaskToBack"); + mService.setFocusedActivityLocked(visibleBehind, "moveHomeTaskToBack"); mStackSupervisor.resumeFocusedStackTopActivityLocked(); return true; } @@ -4459,9 +4459,11 @@ final class ActivityStack { } final int taskToReturnTo = tr.getTaskToReturnTo(); tr.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); - return mStackSupervisor.resumeHomeStackTask(taskToReturnTo, null, "moveTaskToBack"); + return mStackSupervisor.resumeHomeStackTask(taskToReturnTo, null, + "moveTaskToBackAndShowHome"); } + adjustFocusedActivityLocked(mResumedActivity, "moveTaskToBack"); mStackSupervisor.resumeFocusedStackTopActivityLocked(); return true; } diff --git a/services/core/java/com/android/server/emergency/EmergencyAffordanceService.java b/services/core/java/com/android/server/emergency/EmergencyAffordanceService.java index cca9f10c630b..353f4506e1e9 100644 --- a/services/core/java/com/android/server/emergency/EmergencyAffordanceService.java +++ b/services/core/java/com/android/server/emergency/EmergencyAffordanceService.java @@ -99,6 +99,7 @@ public class EmergencyAffordanceService extends SystemService { }; private boolean mSimNeedsEmergencyAffordance; private boolean mNetworkNeedsEmergencyAffordance; + private boolean mVoiceCapable; private void requestCellScan() { mHandler.obtainMessage(CELL_INFO_STATE_CHANGED).sendToTarget(); @@ -125,8 +126,8 @@ public class EmergencyAffordanceService extends SystemService { private void updateEmergencyAffordanceNeeded() { synchronized (mLock) { - mEmergencyAffordanceNeeded = mSimNeedsEmergencyAffordance || - mNetworkNeedsEmergencyAffordance; + mEmergencyAffordanceNeeded = mVoiceCapable && (mSimNeedsEmergencyAffordance || + mNetworkNeedsEmergencyAffordance); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.EMERGENCY_AFFORDANCE_NEEDED, mEmergencyAffordanceNeeded ? 1 : 0); @@ -157,6 +158,11 @@ public class EmergencyAffordanceService extends SystemService { public void onBootPhase(int phase) { if (phase == PHASE_THIRD_PARTY_APPS_CAN_START) { mTelephonyManager = mContext.getSystemService(TelephonyManager.class); + mVoiceCapable = mTelephonyManager.isVoiceCapable(); + if (!mVoiceCapable) { + updateEmergencyAffordanceNeeded(); + return; + } mSubscriptionManager = SubscriptionManager.from(mContext); HandlerThread thread = new HandlerThread(TAG); thread.start(); diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 7a73759f0388..ca2610af3f66 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6831,7 +6831,8 @@ public class WindowManagerService extends IWindowManager.Stub final WindowList windows = displayContent.getWindowList(); final int oldRotation = mRotation; - boolean rotateSeamlessly = mPolicy.shouldRotateSeamlessly(oldRotation, mRotation); + int rotation = mPolicy.rotationForOrientationLw(mLastOrientation, mRotation); + boolean rotateSeamlessly = mPolicy.shouldRotateSeamlessly(oldRotation, rotation); if (rotateSeamlessly) { for (int i = windows.size() - 1; i >= 0; i--) { @@ -6864,7 +6865,6 @@ public class WindowManagerService extends IWindowManager.Stub // an orientation that has different metrics than it expected. // eg. Portrait instead of Landscape. - int rotation = mPolicy.rotationForOrientationLw(mLastOrientation, mRotation); boolean altOrientation = !mPolicy.rotationHasCompatibleMetricsLw( mLastOrientation, rotation); |