summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java52
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java24
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java28
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java69
-rw-r--r--services/core/java/com/android/server/notification/NotificationRecord.java16
-rw-r--r--services/core/java/com/android/server/storage/FileCollector.java8
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerDebugConfig.java2
-rw-r--r--services/core/java/com/android/server/wm/WindowSurfacePlacer.java4
12 files changed, 141 insertions, 77 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 5cb3c1f1f7cd..8368143b176d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -165,7 +165,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
openedAmount = Math.min(1.0f, openedAmount);
mShelfState.openedAmount = openedAmount;
mShelfState.clipTopAmount = 0;
- mShelfState.alpha = mAmbientState.isPulsing() ? 0 : 1;
+ mShelfState.alpha = mAmbientState.hasPulsingNotifications() ? 0 : 1;
mShelfState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0;
mShelfState.shadowAlpha = 1.0f;
mShelfState.hideSensitive = false;
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 4b1d7d7e4508..b1d82b1198a3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -55,6 +55,7 @@ public abstract class PanelView extends FrameLayout {
private long mDownTime;
private float mMinExpandHeight;
private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
+ private boolean mPanelUpdateWhenAnimatorEnds;
private final void logf(String fmt, Object... args) {
Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
@@ -507,7 +508,7 @@ public abstract class PanelView extends FrameLayout {
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
- if (mInstantExpanding || !mNotificationsDragEnabled
+ if (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled
|| (mMotionAborted && event.getActionMasked() != MotionEvent.ACTION_DOWN)) {
return false;
}
@@ -758,14 +759,14 @@ public abstract class PanelView extends FrameLayout {
if (clearAllExpandHack && !mCancelled) {
setExpandedHeightInternal(getMaxPanelHeight());
}
- mHeightAnimator = null;
+ setAnimator(null);
if (!mCancelled) {
notifyExpandingFinished();
}
notifyBarPanelExpansionChanged();
}
});
- mHeightAnimator = animator;
+ setAnimator(animator);
animator.start();
}
@@ -802,15 +803,28 @@ public abstract class PanelView extends FrameLayout {
protected void requestPanelHeightUpdate() {
float currentMaxPanelHeight = getMaxPanelHeight();
- // If the user isn't actively poking us, let's update the height
- if ((!mTracking || isTrackingBlocked())
- && mHeightAnimator == null
- && !isFullyCollapsed()
- && currentMaxPanelHeight != mExpandedHeight
- && mPeekAnimator == null
- && !mPeekTouching) {
- setExpandedHeight(currentMaxPanelHeight);
+ if (isFullyCollapsed()) {
+ return;
+ }
+
+ if (currentMaxPanelHeight == mExpandedHeight) {
+ return;
+ }
+
+ if (mPeekAnimator != null || mPeekTouching) {
+ return;
+ }
+
+ if (mTracking && !isTrackingBlocked()) {
+ return;
+ }
+
+ if (mHeightAnimator != null) {
+ mPanelUpdateWhenAnimatorEnds = true;
+ return;
}
+
+ setExpandedHeight(currentMaxPanelHeight);
}
public void setExpandedHeightInternal(float h) {
@@ -1062,7 +1076,7 @@ public abstract class PanelView extends FrameLayout {
@Override
public void onAnimationEnd(Animator animation) {
if (mCancelled) {
- mHeightAnimator = null;
+ setAnimator(null);
onAnimationFinished.run();
} else {
startUnlockHintAnimationPhase2(onAnimationFinished);
@@ -1070,7 +1084,7 @@ public abstract class PanelView extends FrameLayout {
}
});
animator.start();
- mHeightAnimator = animator;
+ setAnimator(animator);
mKeyguardBottomArea.getIndicationArea().animate()
.translationY(-mHintDistance)
.setDuration(250)
@@ -1088,6 +1102,14 @@ public abstract class PanelView extends FrameLayout {
.start();
}
+ private void setAnimator(ValueAnimator animator) {
+ mHeightAnimator = animator;
+ if (animator == null && mPanelUpdateWhenAnimatorEnds) {
+ mPanelUpdateWhenAnimatorEnds = false;
+ requestPanelHeightUpdate();
+ }
+ }
+
/**
* Phase 2: Bounce down.
*/
@@ -1098,13 +1120,13 @@ public abstract class PanelView extends FrameLayout {
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- mHeightAnimator = null;
+ setAnimator(null);
onAnimationFinished.run();
notifyBarPanelExpansionChanged();
}
});
animator.start();
- mHeightAnimator = animator;
+ setAnimator(animator);
}
private ValueAnimator createHeightAnimator(float targetHeight) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 24c19282a4f6..4e28e90a1402 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -4940,7 +4940,6 @@ public class StatusBar extends SystemUI implements DemoMode,
where.getLocationInWindow(mTmpInt2);
mWakeUpTouchLocation = new PointF(mTmpInt2[0] + where.getWidth() / 2,
mTmpInt2[1] + where.getHeight() / 2);
- mNotificationPanel.setTouchDisabled(false);
mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested();
mFalsingManager.onScreenOnFromTouch();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index f050be4720b7..236e008d4296 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -277,7 +277,7 @@ public class StatusBarWindowView extends FrameLayout {
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (mService.isDozing() && !mService.isPulsing()) {
+ if (mService.isDozing() && !mStackScrollLayout.hasPulsingNotifications()) {
// Capture all touch events in always-on.
return true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
index e409b9c4454f..41ef78121c12 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
@@ -59,7 +59,7 @@ public class AmbientState {
private boolean mPanelTracking;
private boolean mExpansionChanging;
private boolean mPanelFullWidth;
- private boolean mPulsing;
+ private boolean mHasPulsingNotifications;
private boolean mUnlockHintRunning;
public AmbientState(Context context) {
@@ -287,12 +287,12 @@ public class AmbientState {
mPanelTracking = panelTracking;
}
- public boolean isPulsing() {
- return mPulsing;
+ public boolean hasPulsingNotifications() {
+ return mHasPulsingNotifications;
}
- public void setPulsing(boolean pulsing) {
- mPulsing = pulsing;
+ public void setHasPulsingNotifications(boolean hasPulsing) {
+ mHasPulsingNotifications = hasPulsing;
}
public boolean isPanelTracking() {
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 431f646163f5..3cc3604e296c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -53,7 +53,6 @@ import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
-import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.OverScroller;
@@ -816,7 +815,8 @@ public class NotificationStackScrollLayout extends ViewGroup
*/
private float getAppearEndPosition() {
int appearPosition;
- if (mEmptyShadeView.getVisibility() == GONE) {
+ int notGoneChildCount = getNotGoneChildCount();
+ if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) {
int minNotificationsForShelf = 1;
if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) {
appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight();
@@ -824,7 +824,7 @@ public class NotificationStackScrollLayout extends ViewGroup
} else {
appearPosition = 0;
}
- if (getNotGoneChildCount() >= minNotificationsForShelf) {
+ if (notGoneChildCount >= minNotificationsForShelf) {
appearPosition += mShelf.getIntrinsicHeight();
}
} else {
@@ -1941,7 +1941,7 @@ public class NotificationStackScrollLayout extends ViewGroup
int numShownItems = 0;
boolean finish = false;
int maxDisplayedNotifications = mAmbientState.isDark()
- ? (isPulsing() ? 1 : 0)
+ ? (hasPulsingNotifications() ? 1 : 0)
: mMaxDisplayedNotifications;
for (int i = 0; i < getChildCount(); i++) {
@@ -1950,7 +1950,8 @@ public class NotificationStackScrollLayout extends ViewGroup
&& !expandableView.hasNoContentHeight()) {
boolean limitReached = maxDisplayedNotifications != -1
&& numShownItems >= maxDisplayedNotifications;
- boolean notificationOnAmbientThatIsNotPulsing = isPulsing()
+ boolean notificationOnAmbientThatIsNotPulsing = mAmbientState.isDark()
+ && hasPulsingNotifications()
&& expandableView instanceof ExpandableNotificationRow
&& !isPulsing(((ExpandableNotificationRow) expandableView).getEntry());
if (limitReached || notificationOnAmbientThatIsNotPulsing) {
@@ -2008,7 +2009,7 @@ public class NotificationStackScrollLayout extends ViewGroup
return false;
}
- private boolean isPulsing() {
+ public boolean hasPulsingNotifications() {
return mPulsing != null;
}
@@ -2220,14 +2221,15 @@ public class NotificationStackScrollLayout extends ViewGroup
ActivatableNotificationView firstView = mFirstVisibleBackgroundChild;
int top = 0;
if (firstView != null) {
- int finalTranslationY = (int) ViewState.getFinalTranslationY(firstView);
+ // Round Y up to avoid seeing the background during animation
+ int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
if (mAnimateNextBackgroundTop
|| mTopAnimator == null && mCurrentBounds.top == finalTranslationY
|| mTopAnimator != null && mEndAnimationRect.top == finalTranslationY) {
// we're ending up at the same location as we are now, lets just skip the animation
top = finalTranslationY;
} else {
- top = (int) firstView.getTranslationY();
+ top = (int) Math.ceil(firstView.getTranslationY());
}
}
ActivatableNotificationView lastView = mShelf.hasItemsInStableShelf()
@@ -2837,7 +2839,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private void updateNotificationAnimationStates() {
- boolean running = mAnimationsEnabled || isPulsing();
+ boolean running = mAnimationsEnabled || hasPulsingNotifications();
mShelf.setAnimationsEnabled(running);
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -2848,7 +2850,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private void updateAnimationState(View child) {
- updateAnimationState((mAnimationsEnabled || isPulsing())
+ updateAnimationState((mAnimationsEnabled || hasPulsingNotifications())
&& (mIsExpanded || isPinnedHeadsUp(child)), child);
}
@@ -4117,7 +4119,7 @@ public class NotificationStackScrollLayout extends ViewGroup
return;
}
mPulsing = pulsing;
- mAmbientState.setPulsing(isPulsing());
+ mAmbientState.setHasPulsingNotifications(hasPulsingNotifications());
updateNotificationAnimationStates();
updateContentHeight();
notifyHeightChangeListener(mShelf);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index c92c36052e72..f3ecfeb40498 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -20180,6 +20180,11 @@ public class ActivityManagerService extends IActivityManager.Stub
mTempConfig.setTo(getGlobalConfiguration());
final int changes = mTempConfig.updateFrom(values);
if (changes == 0) {
+ // Since calling to Activity.setRequestedOrientation leads to freezing the window with
+ // setting WindowManagerService.mWaitingForConfig to true, it is important that we call
+ // performDisplayOverrideConfigUpdate in order to send the new display configuration
+ // (even if there are no actual changes) to unfreeze the window.
+ performDisplayOverrideConfigUpdate(values, deferResume, DEFAULT_DISPLAY);
return 0;
}
@@ -20368,20 +20373,19 @@ public class ActivityManagerService extends IActivityManager.Stub
int displayId) {
mTempConfig.setTo(mStackSupervisor.getDisplayOverrideConfiguration(displayId));
final int changes = mTempConfig.updateFrom(values);
- if (changes == 0) {
- return 0;
- }
-
- Slog.i(TAG, "Override config changes=" + Integer.toHexString(changes) + " " + mTempConfig
- + " for displayId=" + displayId);
- mStackSupervisor.setDisplayOverrideConfiguration(mTempConfig, displayId);
+ if (changes != 0) {
+ Slog.i(TAG, "Override config changes=" + Integer.toHexString(changes) + " "
+ + mTempConfig + " for displayId=" + displayId);
+ mStackSupervisor.setDisplayOverrideConfiguration(mTempConfig, displayId);
- final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0;
- if (isDensityChange && displayId == DEFAULT_DISPLAY) {
- // Reset the unsupported display size dialog.
- mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG);
+ final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0;
+ if (isDensityChange && displayId == DEFAULT_DISPLAY) {
+ // Reset the unsupported display size dialog.
+ mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG);
- killAllBackgroundProcessesExcept(N, ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE);
+ killAllBackgroundProcessesExcept(N,
+ ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE);
+ }
}
// Update the configuration with WM first and check if any of the stacks need to be resized
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index e828d38ef249..b55bae91da8d 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -470,7 +470,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
}
Configuration getDisplayOverrideConfiguration(int displayId) {
- final ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
throw new IllegalArgumentException("No display found with id: " + displayId);
}
@@ -479,7 +479,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
}
void setDisplayOverrideConfiguration(Configuration overrideConfiguration, int displayId) {
- final ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
throw new IllegalArgumentException("No display found with id: " + displayId);
}
@@ -507,7 +507,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
if (displayId == INVALID_DISPLAY) {
return false;
}
- final ActivityDisplay targetDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay targetDisplay = getActivityDisplayOrCreateLocked(displayId);
if (targetDisplay == null) {
throw new IllegalArgumentException("No display found with id: " + displayId);
}
@@ -1672,7 +1672,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
if (DEBUG_TASKS) Slog.d(TAG, "Launch on display check: displayId=" + launchDisplayId
+ " callingPid=" + callingPid + " callingUid=" + callingUid);
- final ActivityDisplay activityDisplay = mActivityDisplays.get(launchDisplayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(launchDisplayId);
if (activityDisplay == null) {
Slog.w(TAG, "Launch on display check: display not found");
return false;
@@ -2191,7 +2191,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
* @return Existing stack if there is a valid one, new dynamic stack if it is valid or null.
*/
ActivityStack getValidLaunchStackOnDisplay(int displayId, @NonNull ActivityRecord r) {
- final ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
throw new IllegalArgumentException(
"Display with displayId=" + displayId + " not found.");
@@ -2242,10 +2242,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
for (int i = mTmpOrderedDisplayIds.size() - 1; i >= 0; --i) {
final int displayId = mTmpOrderedDisplayIds.get(i);
- final List<ActivityStack> stacks = mActivityDisplays.get(displayId).mStacks;
- if (stacks == null) {
- continue;
- }
+ // If a display is registered in WM, it must also be available in AM.
+ @SuppressWarnings("ConstantConditions")
+ final List<ActivityStack> stacks = getActivityDisplayOrCreateLocked(displayId).mStacks;
for (int j = stacks.size() - 1; j >= 0; --j) {
final ActivityStack stack = stacks.get(j);
if (stack != currentFocus && stack.isFocusable()
@@ -2576,7 +2575,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
}
ActivityStack createStackOnDisplay(int stackId, int displayId, boolean onTop) {
- final ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
return null;
}
@@ -2808,7 +2807,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
* @param onTop Indicates whether container should be place on top or on bottom.
*/
void moveStackToDisplayLocked(int stackId, int displayId, boolean onTop) {
- final ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
throw new IllegalArgumentException("moveStackToDisplayLocked: Unknown displayId="
+ displayId);
@@ -3915,25 +3914,44 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
}
private void handleDisplayAdded(int displayId) {
- boolean newDisplay;
synchronized (mService) {
- newDisplay = mActivityDisplays.get(displayId) == null;
- if (newDisplay) {
- ActivityDisplay activityDisplay = new ActivityDisplay(displayId);
- if (activityDisplay.mDisplay == null) {
- Slog.w(TAG, "Display " + displayId + " gone before initialization complete");
- return;
- }
- mActivityDisplays.put(displayId, activityDisplay);
- calculateDefaultMinimalSizeOfResizeableTasks(activityDisplay);
- mWindowManager.onDisplayAdded(displayId);
- }
+ getActivityDisplayOrCreateLocked(displayId);
}
}
/** Check if display with specified id is added to the list. */
boolean isDisplayAdded(int displayId) {
- return mActivityDisplays.get(displayId) != null;
+ return getActivityDisplayOrCreateLocked(displayId) != null;
+ }
+
+ /**
+ * Get an existing instance of {@link ActivityDisplay} or create new if there is a
+ * corresponding record in display manager.
+ */
+ private ActivityDisplay getActivityDisplayOrCreateLocked(int displayId) {
+ ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ if (activityDisplay != null) {
+ return activityDisplay;
+ }
+ if (mDisplayManager == null) {
+ // The system isn't fully initialized yet.
+ return null;
+ }
+ final Display display = mDisplayManager.getDisplay(displayId);
+ if (display == null) {
+ // The display is not registered in DisplayManager.
+ return null;
+ }
+ // The display hasn't been added to ActivityManager yet, create a new record now.
+ activityDisplay = new ActivityDisplay(displayId);
+ if (activityDisplay.mDisplay == null) {
+ Slog.w(TAG, "Display " + displayId + " gone before initialization complete");
+ return null;
+ }
+ mActivityDisplays.put(displayId, activityDisplay);
+ calculateDefaultMinimalSizeOfResizeableTasks(activityDisplay);
+ mWindowManager.onDisplayAdded(displayId);
+ return activityDisplay;
}
private void calculateDefaultMinimalSizeOfResizeableTasks(ActivityDisplay display) {
@@ -3991,6 +4009,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
info.stackId = stack.mStackId;
info.userId = stack.mCurrentUser;
info.visible = stack.shouldBeVisible(null) == STACK_VISIBLE;
+ // A stack might be not attached to a display.
info.position = display != null
? display.mStacks.indexOf(stack)
: 0;
@@ -4618,7 +4637,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
@Override
public void addToDisplay(int displayId) {
synchronized (mService) {
- ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
+ final ActivityDisplay activityDisplay = getActivityDisplayOrCreateLocked(displayId);
if (activityDisplay == null) {
return;
}
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index 803b0dc0ee5e..95e1db7a3a4c 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -45,6 +45,7 @@ import android.util.Log;
import android.util.Slog;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;
+import android.widget.RemoteViews;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
@@ -359,8 +360,13 @@ public final class NotificationRecord {
}
}
+ String formatRemoteViews(RemoteViews rv) {
+ if (rv == null) return "null";
+ return String.format("%s/0x%08x (%d bytes): %s",
+ rv.getPackage(), rv.getLayoutId(), rv.estimateMemoryUsage(), rv.toString());
+ }
+
void dump(PrintWriter pw, String prefix, Context baseContext, boolean redact) {
- prefix = prefix + " ";
final Notification notification = sbn.getNotification();
final Icon icon = notification.getSmallIcon();
String iconStr = String.valueOf(icon);
@@ -368,6 +374,7 @@ public final class NotificationRecord {
iconStr += " / " + idDebugString(baseContext, icon.getResPackage(), icon.getResId());
}
pw.println(prefix + this);
+ prefix = prefix + " ";
pw.println(prefix + "uid=" + sbn.getUid() + " userId=" + sbn.getUserId());
pw.println(prefix + "icon=" + iconStr);
pw.println(prefix + "pri=" + notification.priority);
@@ -391,8 +398,11 @@ public final class NotificationRecord {
} else {
pw.println("null");
}
- pw.println(prefix + "contentView=" + notification.contentView);
- pw.println(prefix + String.format("color=0x%08x", notification.color));
+ pw.println(prefix + "contentView=" + formatRemoteViews(notification.contentView));
+ pw.println(prefix + "bigContentView=" + formatRemoteViews(notification.bigContentView));
+ pw.println(prefix + "headsUpContentView="
+ + formatRemoteViews(notification.headsUpContentView));
+ pw.print(prefix + String.format("color=0x%08x", notification.color));
pw.println(prefix + "timeout="
+ TimeUtils.formatForLogging(notification.getTimeoutAfter()));
if (notification.actions != null && notification.actions.length > 0) {
diff --git a/services/core/java/com/android/server/storage/FileCollector.java b/services/core/java/com/android/server/storage/FileCollector.java
index 0c119a72e7f9..96e358402a97 100644
--- a/services/core/java/com/android/server/storage/FileCollector.java
+++ b/services/core/java/com/android/server/storage/FileCollector.java
@@ -203,7 +203,13 @@ public class FileCollector {
return 0;
}
- final long sharedDataSize = shared.getPath().getTotalSpace();
+ // In some cases, the path may be null -- we can't determine the size in this case.
+ final File sharedPath = shared.getPath();
+ if (sharedPath == null) {
+ return 0;
+ }
+
+ final long sharedDataSize = sharedPath.getTotalSpace();
long systemSize = sm.getPrimaryStorageSize() - sharedDataSize;
// This case is not exceptional -- we just fallback to the shared data volume in this case.
diff --git a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
index c080f344c186..4da9c060fc4d 100644
--- a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
+++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
@@ -52,7 +52,7 @@ public class WindowManagerDebugConfig {
static final boolean DEBUG_CONFIGURATION = false;
static final boolean DEBUG_APP_TRANSITIONS = false;
static final boolean DEBUG_STARTING_WINDOW_VERBOSE = false;
- static final boolean DEBUG_STARTING_WINDOW = DEBUG_STARTING_WINDOW_VERBOSE || true;
+ static final boolean DEBUG_STARTING_WINDOW = DEBUG_STARTING_WINDOW_VERBOSE || false;
static final boolean DEBUG_WALLPAPER = false;
static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER;
static final boolean DEBUG_DRAG = false;
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
index cb1b2e6abc58..4442bb87ec33 100644
--- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
+++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
@@ -41,6 +41,7 @@ import android.content.res.Configuration;
import android.graphics.GraphicBuffer;
import android.graphics.PixelFormat;
import android.graphics.Rect;
+import android.os.Binder;
import android.os.Debug;
import android.os.Trace;
import android.util.ArraySet;
@@ -693,7 +694,8 @@ class WindowSurfacePlacer {
SurfaceControl surfaceControl = new SurfaceControl(mService.mFxSession,
"thumbnail anim", dirty.width(), dirty.height(),
PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN,
- appToken.windowType, window.mOwnerUid);
+ appToken.windowType,
+ window != null ? window.mOwnerUid : Binder.getCallingUid());
surfaceControl.setLayerStack(display.getLayerStack());
if (SHOW_TRANSACTIONS) {
Slog.i(TAG, " THUMBNAIL " + surfaceControl + ": CREATE");