Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 429a1dd0 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6743184 from 484f9ac9 to rvc-qpr1-release

Change-Id: Ic5b252c9ab3566b56c046df8e7890ea547ce1a0f
parents 23e3db4e 484f9ac9
Loading
Loading
Loading
Loading
+5 −20
Original line number Diff line number Diff line
@@ -1824,19 +1824,13 @@ public final class ViewRootImpl implements ViewParent,
    /**
     * Called after window layout to update the bounds surface. If the surface insets have changed
     * or the surface has resized, update the bounds surface.
     *
     * @param shouldReparent Whether it should reparent the bounds layer to the main SurfaceControl.
     */
    private void updateBoundsLayer(boolean shouldReparent) {
    private void updateBoundsLayer() {
        if (mBoundsLayer != null) {
            setBoundsLayerCrop();
            mTransaction.deferTransactionUntil(mBoundsLayer, getRenderSurfaceControl(),
                    mSurface.getNextFrameNumber());

            if (shouldReparent) {
                mTransaction.reparent(mBoundsLayer, getRenderSurfaceControl());
            }
            mTransaction.apply();
            mTransaction.deferTransactionUntil(mBoundsLayer,
                    getRenderSurfaceControl(), mSurface.getNextFrameNumber())
                    .apply();
        }
    }

@@ -2919,16 +2913,7 @@ public final class ViewRootImpl implements ViewParent,
        }

        if (surfaceSizeChanged || surfaceReplaced || surfaceCreated || windowAttributesChanged) {
            // If the surface has been replaced, there's a chance the bounds layer is not parented
            // to the new layer. When updating bounds layer, also reparent to the main VRI
            // SurfaceControl to ensure it's correctly placed in the hierarchy.
            //
            // This needs to be done on the client side since WMS won't reparent the children to the
            // new surface if it thinks the app is closing. WMS gets the signal that the app is
            // stopping, but on the client side it doesn't get stopped since it's restarted quick
            // enough. WMS doesn't want to keep around old children since they will leak when the
            // client creates new children.
            updateBoundsLayer(surfaceReplaced);
            updateBoundsLayer();
        }

        final boolean didLayout = layoutRequested && (!mStopped || mReportNextDraw);
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class GnssNetworkConnectivityHandler {

    // Default time limit in milliseconds for the ConnectivityManager to find a suitable
    // network with SUPL connectivity or report an error.
    private static final int SUPL_NETWORK_REQUEST_TIMEOUT_MILLIS = 10 * 1000;
    private static final int SUPL_NETWORK_REQUEST_TIMEOUT_MILLIS = 20 * 1000;

    private static final int HASH_MAP_INITIAL_CAPACITY_TO_TRACK_CONNECTED_NETWORKS = 5;

+25 −7
Original line number Diff line number Diff line
@@ -2709,7 +2709,7 @@ public final class Settings {

    private void writePackageListLPrInternal(int creatingUserId) {
        // Only derive GIDs for active users (not dying)
        final List<UserInfo> users = getUsers(UserManagerService.getInstance(), true);
        final List<UserInfo> users = getActiveUsers(UserManagerService.getInstance(), true);
        int[] userIds = new int[users.size()];
        for (int i = 0; i < userIds.length; i++) {
            userIds[i] = users.get(i).id;
@@ -4449,25 +4449,43 @@ public final class Settings {
    }

    /**
     * Return all users on the device, including partial or dying users.
     * Returns all users on the device, including pre-created and dying users.
     *
     * @param userManager UserManagerService instance
     * @return the list of users
     */
    private static List<UserInfo> getAllUsers(UserManagerService userManager) {
        return getUsers(userManager, false);
        return getUsers(userManager, /* excludeDying= */ false, /* excludePreCreated= */ false);
    }

    /**
     * Returns the list of users on the device, excluding pre-created ones.
     *
     * @param userManager UserManagerService instance
     * @param excludeDying Indicates whether to exclude any users marked for deletion.
     *
     * @return the list of users
     */
    private static List<UserInfo> getActiveUsers(UserManagerService userManager,
            boolean excludeDying) {
        return getUsers(userManager, excludeDying, /* excludePreCreated= */ true);
    }

    /**
     * Return the list of users on the device. Clear the calling identity before calling into
     * UserManagerService.
     * Returns the list of users on the device.
     *
     * @param userManager UserManagerService instance
     * @param excludeDying Indicates whether to exclude any users marked for deletion.
     * @param excludePreCreated Indicates whether to exclude any pre-created users.
     *
     * @return the list of users
     */
    private static List<UserInfo> getUsers(UserManagerService userManager, boolean excludeDying) {
    private static List<UserInfo> getUsers(UserManagerService userManager, boolean excludeDying,
            boolean excludePreCreated) {
        long id = Binder.clearCallingIdentity();
        try {
            return userManager.getUsers(excludeDying);
            return userManager.getUsers(/* excludePartial= */ true, excludeDying,
                    excludePreCreated);
        } catch (NullPointerException npe) {
            // packagemanager not yet initialized
        } finally {
+11 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.graphics.Color.WHITE;
import static android.graphics.Color.alpha;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
@@ -142,6 +143,7 @@ class TaskSnapshotSurface implements StartingSurface {
    private final Handler mHandler;
    private boolean mSizeMismatch;
    private final Paint mBackgroundPaint = new Paint();
    private final int mActivityType;
    private final int mStatusBarColor;
    @VisibleForTesting final SystemBarBackgroundPainter mSystemBarBackgroundPainter;
    private final int mOrientationOnCreation;
@@ -173,6 +175,7 @@ class TaskSnapshotSurface implements StartingSurface {
        final int windowFlags;
        final int windowPrivateFlags;
        final int currentOrientation;
        final int activityType;
        final InsetsState insetsState;
        synchronized (service.mGlobalLock) {
            final WindowState mainWindow = activity.findMainWindow();
@@ -241,6 +244,7 @@ class TaskSnapshotSurface implements StartingSurface {
            taskBounds = new Rect();
            task.getBounds(taskBounds);
            currentOrientation = topFullscreenOpaqueWindow.getConfiguration().orientation;
            activityType = activity.getActivityType();

            final InsetsPolicy insetsPolicy = topFullscreenOpaqueWindow.getDisplayContent()
                    .getInsetsPolicy();
@@ -261,7 +265,8 @@ class TaskSnapshotSurface implements StartingSurface {
        }
        final TaskSnapshotSurface snapshotSurface = new TaskSnapshotSurface(service, window,
                surfaceControl, snapshot, layoutParams.getTitle(), taskDescription, sysUiVis,
                windowFlags, windowPrivateFlags, taskBounds, currentOrientation, insetsState);
                windowFlags, windowPrivateFlags, taskBounds, currentOrientation, activityType,
                insetsState);
        window.setOuter(snapshotSurface);
        try {
            session.relayout(window, window.mSeq, layoutParams, -1, -1, View.VISIBLE, 0, -1,
@@ -282,7 +287,7 @@ class TaskSnapshotSurface implements StartingSurface {
    TaskSnapshotSurface(WindowManagerService service, Window window, SurfaceControl surfaceControl,
            TaskSnapshot snapshot, CharSequence title, TaskDescription taskDescription,
            int sysUiVis, int windowFlags, int windowPrivateFlags, Rect taskBounds,
            int currentOrientation, InsetsState insetsState) {
            int currentOrientation, int activityType, InsetsState insetsState) {
        mService = service;
        mSurface = service.mSurfaceFactory.get();
        mHandler = new Handler(mService.mH.getLooper());
@@ -298,6 +303,7 @@ class TaskSnapshotSurface implements StartingSurface {
                windowPrivateFlags, sysUiVis, taskDescription, 1f, insetsState);
        mStatusBarColor = taskDescription.getStatusBarColor();
        mOrientationOnCreation = currentOrientation;
        mActivityType = activityType;
        mTransaction = mService.mTransactionFactory.get();
    }

@@ -305,7 +311,9 @@ class TaskSnapshotSurface implements StartingSurface {
    public void remove() {
        synchronized (mService.mGlobalLock) {
            final long now = SystemClock.uptimeMillis();
            if (mSizeMismatch && now - mShownTime < SIZE_MISMATCH_MINIMUM_TIME_MS) {
            if (mSizeMismatch && now - mShownTime < SIZE_MISMATCH_MINIMUM_TIME_MS
                    // Show the latest content as soon as possible for unlocking to home.
                    && mActivityType != ACTIVITY_TYPE_HOME) {
                mHandler.postAtTime(this::remove, mShownTime + SIZE_MISMATCH_MINIMUM_TIME_MS);
                ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
                        "Defer removing snapshot surface in %dms", (now - mShownTime));
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
@@ -88,7 +89,7 @@ public class TaskSnapshotSurfaceTest extends WindowTestsBase {
                0 /* systemUiVisibility */, false /* isTranslucent */);
        mSurface = new TaskSnapshotSurface(mWm, new Window(), new SurfaceControl(), snapshot, "Test",
                createTaskDescription(Color.WHITE, Color.RED, Color.BLUE), sysuiVis, windowFlags, 0,
                taskBounds, ORIENTATION_PORTRAIT, new InsetsState());
                taskBounds, ORIENTATION_PORTRAIT, ACTIVITY_TYPE_STANDARD, new InsetsState());
    }

    private static TaskDescription createTaskDescription(int background, int statusBar,