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

Commit 6d0a8875 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7233335 from 4221ca48 to rvc-qpr3-release

Change-Id: If0aeeeb86996f5c74c0f2196b99de36ef72b5573
parents 0acc6bb4 4221ca48
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -440,4 +440,11 @@ public abstract class ActivityManagerInternal {
     * @return true if exists, false otherwise.
     */
    public abstract boolean isPendingTopUid(int uid);

    public abstract void tempAllowWhileInUsePermissionInFgs(int uid, long duration);

    public abstract boolean isTempAllowlistedForFgsWhileInUse(int uid);

    public abstract boolean canAllowWhileInUsePermissionInFgs(int pid, int uid,
            @NonNull String packageName);
}
+4 −4
Original line number Diff line number Diff line
@@ -141,14 +141,14 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor
    @ImeAnimationFlags
    public int onImeStartPositioning(int displayId, int hiddenTop, int shownTop,
            boolean imeShouldShow, boolean imeIsFloating, SurfaceControl.Transaction t) {
        mHiddenTop = hiddenTop;
        mShownTop = shownTop;
        mTargetShown = imeShouldShow;
        if (!isDividerVisible()) {
            return 0;
        }
        final boolean splitIsVisible = !getView().isHidden();
        mHiddenTop = hiddenTop;
        mShownTop = shownTop;
        mTargetShown = imeShouldShow;
        mSecondaryHasFocus = getSecondaryHasFocus(displayId);
        final boolean splitIsVisible = !getView().isHidden();
        final boolean targetAdjusted = splitIsVisible && imeShouldShow && mSecondaryHasFocus
                && !imeIsFloating && !getLayout().mDisplayLayout.isLandscape()
                && !mSplits.mDivider.isMinimized();
+6 −11
Original line number Diff line number Diff line
@@ -845,15 +845,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    }

    void enterSplitMode(boolean isHomeStackResizable) {
        post(() -> {
            final SurfaceControl sc = getWindowSurfaceControl();
            if (sc == null) {
                return;
            }
            Transaction t = mTiles.getTransaction();
            t.show(sc).apply();
            mTiles.releaseTransaction(t);
        });
        setHidden(false);

        SnapTarget miniMid =
                mSplitLayout.getMinimizedSnapAlgorithm(isHomeStackResizable).getMiddleTarget();
@@ -880,14 +872,17 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    }

    void exitSplitMode() {
        // Reset tile bounds
        final SurfaceControl sc = getWindowSurfaceControl();
        if (sc == null) {
            return;
        }
        Transaction t = mTiles.getTransaction();
        t.hide(sc).apply();
        t.hide(sc);
        mImeController.setDimsHidden(t, true);
        t.apply();
        mTiles.releaseTransaction(t);

        // Reset tile bounds
        int midPos = mSplitLayout.getSnapAlgorithm().getMiddleTarget().position;
        mWindowManagerProxy.applyResizeSplits(midPos, mSplitLayout);
    }
+18 −5
Original line number Diff line number Diff line
@@ -4878,18 +4878,21 @@ public final class ActiveServices {
            return true;
        }

        if (r.app != null) {
        if (r != null && r.app != null) {
            ActiveInstrumentation instr = r.app.getActiveInstrumentation();
            if (instr != null && instr.mHasBackgroundActivityStartsPermission) {
                return true;
            }
        }

        final boolean hasAllowBackgroundActivityStartsToken = r.app != null
                ? !r.app.mAllowBackgroundActivityStartsTokens.isEmpty() : false;
        if (hasAllowBackgroundActivityStartsToken) {
        for (int i = mAm.mProcessList.mLruProcesses.size() - 1; i >= 0; i--) {
            final ProcessRecord pr = mAm.mProcessList.mLruProcesses.get(i);
            if (pr.uid == callingUid) {
                if (!pr.mAllowBackgroundActivityStartsTokens.isEmpty()) {
                    return true;
                }
            }
        }

        if (mAm.checkPermission(START_ACTIVITIES_FROM_BACKGROUND, callingPid, callingUid)
                == PERMISSION_GRANTED) {
@@ -4907,6 +4910,10 @@ public final class ActiveServices {
            return true;
        }

        if (mAm.mInternal.isTempAllowlistedForFgsWhileInUse(callingUid)) {
            return true;
        }

        final boolean isWhiteListedPackage =
                mWhiteListAllowWhileInUsePermissionInFgs.contains(callingPackage);
        if (isWhiteListedPackage) {
@@ -4920,4 +4927,10 @@ public final class ActiveServices {
        }
        return false;
    }

    boolean canAllowWhileInUsePermissionInFgsLocked(int callingPid, int callingUid,
            String callingPackage) {
        return shouldAllowWhileInUsePermissionInFgsLocked(
                callingPackage, callingPid, callingUid, null, null, false);
    }
}
+25 −0
Original line number Diff line number Diff line
@@ -1261,6 +1261,13 @@ public class ActivityManagerService extends IActivityManager.Stub
    final PendingTempWhitelists mPendingTempWhitelist = new PendingTempWhitelists(this);
    /**
     * List of uids that are allowed to have while-in-use permission when FGS is started from
     * background.
     */
    private final FgsWhileInUseTempAllowList mFgsWhileInUseTempAllowList =
            new FgsWhileInUseTempAllowList();
    /**
     * Information about and control over application operations
     */
@@ -19773,6 +19780,24 @@ public class ActivityManagerService extends IActivityManager.Stub
        public boolean isPendingTopUid(int uid) {
            return mPendingStartActivityUids.isPendingTopUid(uid);
        }
        @Override
        public void tempAllowWhileInUsePermissionInFgs(int uid, long duration) {
            mFgsWhileInUseTempAllowList.add(uid, duration);
        }
        @Override
        public boolean isTempAllowlistedForFgsWhileInUse(int uid) {
            return mFgsWhileInUseTempAllowList.isAllowed(uid);
        }
        @Override
        public boolean canAllowWhileInUsePermissionInFgs(int pid, int uid,
                @NonNull String packageName) {
            synchronized (ActivityManagerService.this) {
                return mServices.canAllowWhileInUsePermissionInFgsLocked(pid, uid, packageName);
            }
        }
    }
    long inputDispatchingTimedOut(int pid, final boolean aboveSystem, String reason) {
Loading