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

Commit f17894f3 authored by Michael Groover's avatar Michael Groover
Browse files

Clean up device identifier access logging

This commit removes the log message from DevicePolicyManagerService
when a caller fails the access requirements as it can be confusing
if the caller subsequently passes a carrier privilege check and can
access identifiers, or in the case where the caller does not have
access a similar entry is logged by TelephonyPermissions. The subId
for which the carrier privilege check is performed is also logged
to facilitate debugging.

Bug: 152117976
Test: atest SubscriptionControllerTest
Change-Id: I6d88d739a0d9053e8eff32d74d90009699abe8fc
parent 2f54a864
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -9182,8 +9182,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            return true;
            return true;
        }
        }
        Log.w(LOG_TAG, String.format("Package %s (uid=%d, pid=%d) cannot access Device IDs",
                    packageName, uid, pid));
        return false;
        return false;
    }
    }
+2 −1
Original line number Original line Diff line number Diff line
@@ -361,7 +361,8 @@ public final class TelephonyPermissions {
            TelephonyCommonStatsLog.write(TelephonyCommonStatsLog.DEVICE_IDENTIFIER_ACCESS_DENIED,
            TelephonyCommonStatsLog.write(TelephonyCommonStatsLog.DEVICE_IDENTIFIER_ACCESS_DENIED,
                    callingPackage, message, /* isPreinstalled= */ false, false);
                    callingPackage, message, /* isPreinstalled= */ false, false);
        }
        }
        Log.w(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message);
        Log.w(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message + ":"
                + subId);
        // if the target SDK is pre-Q then check if the calling package would have previously
        // if the target SDK is pre-Q then check if the calling package would have previously
        // had access to device identifiers.
        // had access to device identifiers.
        if (callingPackageInfo != null && (
        if (callingPackageInfo != null && (