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

Commit 7a80e94c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not use hidden isPrivilegedApp"

parents 4d1c3e71 22b53f41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6362,7 +6362,8 @@ message DeviceIdentifierAccessDenied {
    optional bool is_preinstalled = 3;

    // True if the package is privileged.
    optional bool is_priv_app = 4;
    // Starting from Android 11, this boolean is not set and will always be false.
    optional bool is_priv_app = 4 [deprecated = true];
}

/**
+2 −6
Original line number Diff line number Diff line
@@ -390,7 +390,6 @@ public final class TelephonyPermissions {
    private static boolean reportAccessDeniedToReadIdentifiers(Context context, int subId, int pid,
            int uid, String callingPackage, String message) {
        boolean isPreinstalled = false;
        boolean isPrivApp = false;
        ApplicationInfo callingPackageInfo = null;
        try {
            callingPackageInfo = context.getPackageManager().getApplicationInfoAsUser(
@@ -398,9 +397,6 @@ public final class TelephonyPermissions {
            if (callingPackageInfo != null) {
                if (callingPackageInfo.isSystemApp()) {
                    isPreinstalled = true;
                    if (callingPackageInfo.isPrivilegedApp()) {
                        isPrivApp = true;
                    }
                }
            }
        } catch (PackageManager.NameNotFoundException e) {
@@ -423,10 +419,10 @@ public final class TelephonyPermissions {
            }
            invokedMethods.add(message);
            StatsLog.write(StatsLog.DEVICE_IDENTIFIER_ACCESS_DENIED, callingPackage, message,
                    isPreinstalled, isPrivApp);
                    isPreinstalled, false);
        }
        Log.w(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message
                + ":isPreinstalled=" + isPreinstalled + ":isPrivApp=" + isPrivApp);
                + ":isPreinstalled=" + isPreinstalled);
        // if the target SDK is pre-Q then check if the calling package would have previously
        // had access to device identifiers.
        if (callingPackageInfo != null && (