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

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

Merge "Don't call platformCompat on system apps."

parents 68f6d6f3 685cbc12
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -55,15 +55,20 @@ public class AndroidTestBaseUpdater extends PackageSharedLibraryUpdater {
    private static final long REMOVE_ANDROID_TEST_BASE = 133396946L;

    private static boolean isChangeEnabled(Package pkg) {
        // Do not ask platform compat for system apps to prevent a boot time regression in tests.
        // b/142558883.
        if (!pkg.applicationInfo.isSystemApp()) {
            IPlatformCompat platformCompat = IPlatformCompat.Stub.asInterface(
                    ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE));
            try {
            return platformCompat.isChangeEnabled(REMOVE_ANDROID_TEST_BASE, pkg.applicationInfo);
                return platformCompat.isChangeEnabled(REMOVE_ANDROID_TEST_BASE,
                        pkg.applicationInfo);
            } catch (RemoteException | NullPointerException e) {
                Log.e(TAG, "Failed to get a response from PLATFORM_COMPAT_SERVICE", e);
            }
        }
        // Fall back to previous behaviour.
        return pkg.applicationInfo.targetSdkVersion <= Build.VERSION_CODES.Q;
        return pkg.applicationInfo.targetSdkVersion > Build.VERSION_CODES.Q;
    }

    @Override