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

Commit d7c6939d authored by sunjian's avatar sunjian Committed by android-build-merger
Browse files

Fix Android O: AccountManager API not working in managed profile. am: 9ae597b6

am: 6e6af8af

Change-Id: Ie8697a99f5423627c3e6ac72094a89de9d6f25c6
parents 3649721e 6e6af8af
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -5330,16 +5330,14 @@ public class AccountManagerService
        long identityToken = Binder.clearCallingIdentity();
        try {
            packages = mPackageManager.getPackagesForUid(callingUid);
        } finally {
            Binder.restoreCallingIdentity(identityToken);
        }
            if (packages == null) {
                Log.d(TAG, "No packages for callingUid " + callingUid);
                return false;
            }
            for (String name : packages) {
                try {
                PackageInfo packageInfo = mPackageManager.getPackageInfo(name, 0 /* flags */);
                    PackageInfo packageInfo =
                        mPackageManager.getPackageInfo(name, 0 /* flags */);
                    if (packageInfo != null
                        && (packageInfo.applicationInfo.privateFlags
                            & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0) {
@@ -5347,9 +5345,11 @@ public class AccountManagerService
                    }
                } catch (PackageManager.NameNotFoundException e) {
                    Log.d(TAG, "Package not found " + e.getMessage());
                return false;
                }
            }
        } finally {
            Binder.restoreCallingIdentity(identityToken);
        }
        return false;
    }