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

Commit 2c0f41c8 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Fix side channel information disclosure"

parents caa35d55 0594d55d
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -1928,22 +1928,14 @@ public class WindowManagerService extends IWindowManager.Stub
                    && attachedWindow.mActivityRecord.mTargetSdk >= Build.VERSION_CODES.O;
        } else {
            // Otherwise, look at the package
            try {
                ApplicationInfo appInfo = mContext.getPackageManager()
                        .getApplicationInfoAsUser(packageName, 0,
                                UserHandle.getUserId(callingUid));
                if (appInfo.uid != callingUid) {
            final ApplicationInfo appInfo = mPmInternal.getApplicationInfo(
                    packageName, 0 /* flags */, SYSTEM_UID, UserHandle.getUserId(callingUid));
            if (appInfo == null || appInfo.uid != callingUid) {
                throw new SecurityException("Package " + packageName + " not in UID "
                        + callingUid);
            }
                if (appInfo.targetSdkVersion >= Build.VERSION_CODES.O) {
                    return true;
                }
            } catch (PackageManager.NameNotFoundException e) {
                /* ignore */
            }
            return appInfo.targetSdkVersion >= Build.VERSION_CODES.O;
        }
        return false;
    }

    /**