Loading src/com/android/settings/security/CredentialStorage.java +14 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public final class CredentialStorage extends FragmentActivity { final String action = intent.getAction(); final UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (!userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { if (ACTION_RESET.equals(action)) { if (ACTION_RESET.equals(action) && checkCallerIsSelf()) { new ResetDialog(); } else { if (ACTION_INSTALL.equals(action) && checkCallerIsCertInstallerOrSelfInProfile()) { Loading Loading @@ -341,6 +341,19 @@ public final class CredentialStorage extends FragmentActivity { } } /** * Check that the caller is Settings. */ private boolean checkCallerIsSelf() { try { return Process.myUid() == android.app.ActivityManager.getService() .getLaunchedFromUid(getActivityToken()); } catch (RemoteException re) { // Error talking to ActivityManager, just give up return false; } } /** * Check that the caller is either certinstaller or Settings running in a profile of this user. */ Loading Loading
src/com/android/settings/security/CredentialStorage.java +14 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public final class CredentialStorage extends FragmentActivity { final String action = intent.getAction(); final UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (!userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { if (ACTION_RESET.equals(action)) { if (ACTION_RESET.equals(action) && checkCallerIsSelf()) { new ResetDialog(); } else { if (ACTION_INSTALL.equals(action) && checkCallerIsCertInstallerOrSelfInProfile()) { Loading Loading @@ -341,6 +341,19 @@ public final class CredentialStorage extends FragmentActivity { } } /** * Check that the caller is Settings. */ private boolean checkCallerIsSelf() { try { return Process.myUid() == android.app.ActivityManager.getService() .getLaunchedFromUid(getActivityToken()); } catch (RemoteException re) { // Error talking to ActivityManager, just give up return false; } } /** * Check that the caller is either certinstaller or Settings running in a profile of this user. */ Loading