diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-06 03:09:51 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-06 03:16:59 +0000 |
commit | a2b1ca56512fe09cdff0d1c6da8c48dab5d3b6fd (patch) | |
tree | e280fff13c53c10441137dce1d7fe6f0bb849673 | |
parent | 911525fe21d65867e954ab366ace5e42fc2f310b (diff) | |
parent | 7509d8ecf9d69ea25bbcab22c565aebeab3ecb31 (diff) |
Make change and version bump to r_aml_300900400 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I538efbc8e379b929f50ad1762bdf759ca31cdbb8
-rw-r--r-- | apex/extservices/apex_manifest.json | 2 | ||||
-rw-r--r-- | apex/permission/apex_manifest.json | 2 | ||||
-rw-r--r-- | apex/statsd/apex_manifest.json | 2 | ||||
-rw-r--r-- | packages/Tethering/apex/manifest.json | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 38 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/DisplayPolicy.java | 10 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/TaskDisplayArea.java | 83 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowContainer.java | 1 |
8 files changed, 90 insertions, 50 deletions
diff --git a/apex/extservices/apex_manifest.json b/apex/extservices/apex_manifest.json index e6eac1775a59..4ac3f779166f 100644 --- a/apex/extservices/apex_manifest.json +++ b/apex/extservices/apex_manifest.json @@ -1,4 +1,4 @@ { "name": "com.android.extservices", - "version": 300900300 + "version": 300900400 } diff --git a/apex/permission/apex_manifest.json b/apex/permission/apex_manifest.json index 27aa8bfb18b2..69870534cf36 100644 --- a/apex/permission/apex_manifest.json +++ b/apex/permission/apex_manifest.json @@ -1,4 +1,4 @@ { "name": "com.android.permission", - "version": 300900300 + "version": 300900400 } diff --git a/apex/statsd/apex_manifest.json b/apex/statsd/apex_manifest.json index f4af92b31127..820d3039f17a 100644 --- a/apex/statsd/apex_manifest.json +++ b/apex/statsd/apex_manifest.json @@ -1,5 +1,5 @@ { "name": "com.android.os.statsd", - "version": 300900300 + "version": 300900400 } diff --git a/packages/Tethering/apex/manifest.json b/packages/Tethering/apex/manifest.json index 94508a3d357f..d747cc882f0d 100644 --- a/packages/Tethering/apex/manifest.json +++ b/packages/Tethering/apex/manifest.json @@ -1,4 +1,4 @@ { "name": "com.android.tethering", - "version": 300900300 + "version": 300900400 } diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 2e9f70448488..360e40bdf4ff 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -268,6 +268,7 @@ import android.os.storage.StorageManager; import android.service.dreams.DreamActivity; import android.service.dreams.DreamManagerInternal; import android.service.voice.IVoiceInteractionSession; +import android.text.TextUtils; import android.util.ArraySet; import android.util.EventLog; import android.util.Log; @@ -2054,23 +2055,28 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } static boolean canLaunchDreamActivity(String packageName) { - final DreamManagerInternal dreamManager = - LocalServices.getService(DreamManagerInternal.class); - - // Verify that the package is the current active dream. The getActiveDreamComponent() - // call path does not acquire the DreamManager lock and thus is safe to use. - final ComponentName activeDream = dreamManager.getActiveDreamComponent(false /* doze */); - if (activeDream == null || activeDream.getPackageName() == null - || !activeDream.getPackageName().equals(packageName)) { + if (packageName == null) { return false; } - // Verify that the device is dreaming. if (!LocalServices.getService(ActivityTaskManagerInternal.class).isDreaming()) { return false; } - return true; + final DreamManagerInternal dreamManager = + LocalServices.getService(DreamManagerInternal.class); + + // Verify that the package is the current active dream or doze component. The + // getActiveDreamComponent() call path does not acquire the DreamManager lock and thus + // is safe to use. + final ComponentName activeDream = dreamManager.getActiveDreamComponent(false /* doze */); + final ComponentName activeDoze = dreamManager.getActiveDreamComponent(true /* doze */); + return TextUtils.equals(packageName, getPackageName(activeDream)) + || TextUtils.equals(packageName, getPackageName(activeDoze)); + } + + private static String getPackageName(ComponentName componentName) { + return componentName != null ? componentName.getPackageName() : null; } private void setActivityType(boolean componentSpecified, int launchedFromUid, Intent intent, @@ -2560,7 +2566,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (mayAdjustTop && ((ActivityStack) task).topRunningActivity(true /* focusableOnly */) == null) { task.adjustFocusToNextFocusableTask("finish-top", false /* allowFocusSelf */, - shouldAdjustGlobalFocus); + shouldAdjustGlobalFocus); } finishActivityResults(resultCode, resultData, resultGrants); @@ -2580,7 +2586,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (DEBUG_VISIBILITY || DEBUG_TRANSITION) { Slog.v(TAG_TRANSITION, "Prepare close transition: finishing " + this); } - getDisplay().mDisplayContent.prepareAppTransition(transit, false); + mDisplayContent.prepareAppTransition(transit, false); // When finishing the activity preemptively take the snapshot before the app window // is marked as hidden and any configuration changes take place @@ -2605,6 +2611,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (endTask) { mAtmService.getLockTaskController().clearLockedTask(task); + // This activity was in the top focused stack and this is the last activity in + // that task, give this activity a higher layer so it can stay on top before the + // closing task transition be executed. + if (mayAdjustTop) { + mNeedsZBoost = true; + mDisplayContent.assignWindowLayers(false /* setLayoutNeeded */); + } } } else if (!isState(PAUSING)) { if (mVisibleRequested) { @@ -6105,7 +6118,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AR#onAnimationFinished"); mTransit = TRANSIT_UNSET; mTransitFlags = 0; - mNeedsZBoost = false; mNeedsAnimationBoundsLayer = false; setAppLayoutChanges(FINISH_LAYOUT_REDO_ANIM | FINISH_LAYOUT_REDO_WALLPAPER, diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index 72b014cab2bb..68051ab59599 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -3300,16 +3300,6 @@ public class DisplayPolicy { } } final WindowState win = winCandidate; - if (win.getAttrs().type == TYPE_NOTIFICATION_SHADE && isKeyguardShowing() - && isKeyguardOccluded()) { - // We are updating at a point where the keyguard has gotten - // focus, but we were last in a state where the top window is - // hiding it. This is probably because the keyguard as been - // shown while the top window was displayed, so we want to ignore - // it here because this is just a very transient change and it - // will quickly lose focus once it correctly gets hidden. - return 0; - } mDisplayContent.getInsetsPolicy().updateBarControlTarget(win); diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index 205a8d2aeeac..c3acb16dda49 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -52,6 +52,7 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.os.UserHandle; +import android.util.IntArray; import android.util.Slog; import android.view.SurfaceControl; import android.window.WindowContainerTransaction; @@ -106,6 +107,9 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> { private final ArrayList<ActivityStack> mTmpAlwaysOnTopStacks = new ArrayList<>(); private final ArrayList<ActivityStack> mTmpNormalStacks = new ArrayList<>(); private final ArrayList<ActivityStack> mTmpHomeStacks = new ArrayList<>(); + private final IntArray mTmpNeedsZBoostIndexes = new IntArray(); + private int mTmpLayerForSplitScreenDividerAnchor; + private int mTmpLayerForAnimationLayer; private ArrayList<Task> mTmpTasks = new ArrayList<>(); @@ -633,39 +637,72 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> { int layer = 0; // Place home stacks to the bottom. - for (int i = 0; i < mTmpHomeStacks.size(); i++) { - mTmpHomeStacks.get(i).assignLayer(t, layer++); - } + layer = adjustRootTaskLayer(t, mTmpHomeStacks, layer, false /* normalStacks */); // The home animation layer is between the home stacks and the normal stacks. final int layerForHomeAnimationLayer = layer++; - int layerForSplitScreenDividerAnchor = layer++; - int layerForAnimationLayer = layer++; - for (int i = 0; i < mTmpNormalStacks.size(); i++) { - final ActivityStack s = mTmpNormalStacks.get(i); - s.assignLayer(t, layer++); - if (s.inSplitScreenWindowingMode()) { - // The split screen divider anchor is located above the split screen window. - layerForSplitScreenDividerAnchor = layer++; - } - if (s.isTaskAnimating() || s.isAppTransitioning()) { - // The animation layer is located above the highest animating stack and no - // higher. - layerForAnimationLayer = layer++; - } - } + mTmpLayerForSplitScreenDividerAnchor = layer++; + mTmpLayerForAnimationLayer = layer++; + layer = adjustRootTaskLayer(t, mTmpNormalStacks, layer, true /* normalStacks */); + // The boosted animation layer is between the normal stacks and the always on top // stacks. final int layerForBoostedAnimationLayer = layer++; - for (int i = 0; i < mTmpAlwaysOnTopStacks.size(); i++) { - mTmpAlwaysOnTopStacks.get(i).assignLayer(t, layer++); - } + adjustRootTaskLayer(t, mTmpAlwaysOnTopStacks, layer, false /* normalStacks */); t.setLayer(mHomeAppAnimationLayer, layerForHomeAnimationLayer); - t.setLayer(mAppAnimationLayer, layerForAnimationLayer); - t.setLayer(mSplitScreenDividerAnchor, layerForSplitScreenDividerAnchor); + t.setLayer(mAppAnimationLayer, mTmpLayerForAnimationLayer); + t.setLayer(mSplitScreenDividerAnchor, mTmpLayerForSplitScreenDividerAnchor); t.setLayer(mBoostedAppAnimationLayer, layerForBoostedAnimationLayer); } + private int adjustNormalStackLayer(ActivityStack s, int layer) { + if (s.inSplitScreenWindowingMode()) { + // The split screen divider anchor is located above the split screen window. + mTmpLayerForSplitScreenDividerAnchor = layer++; + } + if (s.isTaskAnimating() || s.isAppTransitioning()) { + // The animation layer is located above the highest animating stack and no + // higher. + mTmpLayerForAnimationLayer = layer++; + } + return layer; + } + + /** + * Adjusts the layer of the stack which belongs to the same group. + * Note that there are three stack groups: home stacks, always on top stacks, and normal stacks. + * + * @param startLayer The beginning layer of this group of stacks. + * @param normalStacks Set {@code true} if this group is neither home nor always on top. + * @return The adjusted layer value. + */ + private int adjustRootTaskLayer(SurfaceControl.Transaction t, ArrayList<ActivityStack> stacks, + int startLayer, boolean normalStacks) { + mTmpNeedsZBoostIndexes.clear(); + final int stackSize = stacks.size(); + for (int i = 0; i < stackSize; i++) { + final ActivityStack stack = stacks.get(i); + if (!stack.needsZBoost()) { + stack.assignLayer(t, startLayer++); + if (normalStacks) { + startLayer = adjustNormalStackLayer(stack, startLayer); + } + } else { + mTmpNeedsZBoostIndexes.add(i); + } + } + + final int zBoostSize = mTmpNeedsZBoostIndexes.size(); + for (int i = 0; i < zBoostSize; i++) { + final ActivityStack stack = stacks.get(mTmpNeedsZBoostIndexes.get(i)); + stack.assignLayer(t, startLayer++); + if (normalStacks) { + startLayer = adjustNormalStackLayer(stack, startLayer); + } + } + return startLayer; + } + @Override SurfaceControl getAppAnimationLayer(@AnimationLayer int animationLayer) { switch (animationLayer) { diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index 5a73fabaf9d0..f984a8b024c1 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -2440,6 +2440,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< protected void onAnimationFinished(@AnimationType int type, AnimationAdapter anim) { doAnimationFinished(type, anim); mWmService.onAnimationFinished(); + mNeedsZBoost = false; } /** |