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

Commit 2ed2906f authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '3546-t-august' into 'v3.1-t'

August security patch updates

See merge request e/os/android_frameworks_base!298
parents 8abd50b8 d6cdd94e
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -6040,13 +6040,17 @@ public class RemoteViews implements Parcelable, Filter {
                    && context.getPackageName().equals(mApplication.packageName)) {
                return context;
            }
            try {
                ApplicationInfo sanitizedApplication = mApplication;
                try {
                    // Use PackageManager as the source of truth for application information, rather
                    // than the parceled ApplicationInfo provided by the app.
                ApplicationInfo sanitizedApplication =
                        context.getPackageManager().getApplicationInfoAsUser(
                                mApplication.packageName, 0,
                                UserHandle.getUserId(mApplication.uid));
                    sanitizedApplication = context.getPackageManager().getApplicationInfoAsUser(
                        mApplication.packageName, 0, UserHandle.getUserId(mApplication.uid));
                } catch(SecurityException se) {
                    Log.d(LOG_TAG, "Unable to fetch appInfo for " + mApplication.packageName);
                }

                Context applicationContext = context.createApplicationContext(
                        sanitizedApplication,
                        Context.CONTEXT_RESTRICTED);
+29 −3
Original line number Diff line number Diff line
@@ -2761,6 +2761,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        attachStartingSurfaceToAssociatedTask();
    }

    /**
     * If the device is locked and the app does not request showWhenLocked,
     * defer removing the starting window until the transition is complete.
     * This prevents briefly appearing the app context and causing secure concern.
     */
    void deferStartingWindowRemovalForKeyguardUnoccluding() {
        if (mStartingData != null && !mStartingData.mRemoveAfterTransition
                && isKeyguardLocked() && !canShowWhenLockedInner(this) && !isVisibleRequested()
                && isAnimating(PARENTS | CHILDREN, ANIMATION_TYPE_APP_TRANSITION)) {
            mStartingData.mRemoveAfterTransition = true;
        }
    }

    void removeStartingWindow() {
        boolean prevEligibleForLetterboxEducation = isEligibleForLetterboxEducation();

@@ -2799,6 +2812,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final StartingData startingData = mStartingData;
        final WindowState startingWindow = mStartingWindow;
        if (mStartingData != null) {
            if (mStartingData.mRemoveAfterTransition) {
                return;
            }
            surface = mStartingSurface;
            mStartingData = null;
            mStartingSurface = null;
@@ -4431,6 +4447,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                tStartingWindow.mToken = this;
                tStartingWindow.mActivityRecord = this;

                mStartingData.mRemoveAfterTransition = false;
                ProtoLog.v(WM_DEBUG_ADD_REMOVE,
                        "Removing starting %s from %s", tStartingWindow, fromActivity);
                mTransitionController.collect(tStartingWindow);
@@ -4585,17 +4602,22 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (r == null || r.getTaskFragment() == null) {
            return false;
        }
        if (!r.inPinnedWindowingMode() && (r.mShowWhenLocked || r.containsShowWhenLockedWindow())) {
        if (canShowWhenLockedInner(r)) {
            return true;
        } else if (r.mInheritShownWhenLocked) {
            final ActivityRecord activity = r.getTaskFragment().getActivityBelow(r);
            return activity != null && !activity.inPinnedWindowingMode()
                    && (activity.mShowWhenLocked || activity.containsShowWhenLockedWindow());
            return activity != null && canShowWhenLockedInner(activity);
        } else {
            return false;
        }
    }

    /** @see #canShowWhenLocked(ActivityRecord) */
    private static boolean canShowWhenLockedInner(@NonNull ActivityRecord r) {
        return !r.inPinnedWindowingMode() &&
                (r.mShowWhenLocked || r.containsShowWhenLockedWindow());
    }

    /**
     *  Determines if the activity can show while lock-screen is displayed. System displays
     *  activities while lock-screen is displayed only if all activities
@@ -7674,6 +7696,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            mThumbnail = null;
        }

        if (mStartingData != null && mStartingData.mRemoveAfterTransition) {
            mStartingData.mRemoveAfterTransition = false;
            removeStartingWindowAnimation(false /* prepareAnimation */);
        }
        // WindowState.onExitAnimationDone might modify the children list, so make a copy and then
        // traverse the copy.
        final ArrayList<WindowState> children = new ArrayList<>(mChildren);
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public abstract class StartingData {
     * when the parent activity of starting window may be put in a partial area of the task.
     */
    Task mAssociatedTask;
    boolean mRemoveAfterTransition;

    /** Whether the starting window is drawn. */
    boolean mIsDisplayed;
+13 −0
Original line number Diff line number Diff line
@@ -2004,6 +2004,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        final ActivityRecord atoken = mActivityRecord;
        if (atoken != null) {
            if (atoken.mStartingData != null && mAttrs.type != TYPE_APPLICATION_STARTING
                    && atoken.mStartingData.mRemoveAfterTransition) {
                // Preventing app window from visible during un-occluding animation playing due to
                // alpha blending.
                return false;
            }
            return ((!isParentWindowHidden() && atoken.isVisible())
                    || isAnimating(TRANSITION | PARENTS));
        }
@@ -3090,7 +3096,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            final int mask = FLAG_SHOW_WHEN_LOCKED | FLAG_DISMISS_KEYGUARD
                    | FLAG_ALLOW_LOCK_WHILE_SCREEN_ON;
            WindowManager.LayoutParams sa = mActivityRecord.mStartingWindow.mAttrs;
            final boolean wasShowWhenLocked = (sa.flags & FLAG_SHOW_WHEN_LOCKED) != 0;
            final boolean removeShowWhenLocked = (mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) == 0;
            sa.flags = (sa.flags & ~mask) | (mAttrs.flags & mask);
            if (wasShowWhenLocked && removeShowWhenLocked) {
                // Trigger unoccluding animation if needed.
                mActivityRecord.checkKeyguardFlagsChanged();
                mActivityRecord.deferStartingWindowRemovalForKeyguardUnoccluding();
            }
        }
    }