summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorHai Zhang <zhanghai@google.com>2019-07-11 17:30:58 -0700
committerHai Zhang <zhanghai@google.com>2019-07-12 00:39:12 +0000
commitdc683d3001a13ac69f428960dd9ef052e33ae9f6 (patch)
treee34b9f5a30aff2dd9261851ba0401075fddcc5c5 /src/com
parent7887f34d1e15c7528205f6d5c49a86c292ba59ab (diff)
downloadandroid_packages_apps_PackageInstaller-dc683d3001a13ac69f428960dd9ef052e33ae9f6.tar.gz
android_packages_apps_PackageInstaller-dc683d3001a13ac69f428960dd9ef052e33ae9f6.tar.bz2
android_packages_apps_PackageInstaller-dc683d3001a13ac69f428960dd9ef052e33ae9f6.zip
Use EXTRA_CALLING_PACKAGE for legacy change default dialer/SMS intents.
So that RequestRoleActivity can always know the calling package. This is required to keep supporting pre-Q apps calling with startActivity(). Bug: 137054465 Test: manual Change-Id: I10c758fcadde8157a2d360a192accea75550a1dd
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/packageinstaller/role/ui/RequestRoleActivity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/packageinstaller/role/ui/RequestRoleActivity.java b/src/com/android/packageinstaller/role/ui/RequestRoleActivity.java
index 8b56a221..c57dfef2 100644
--- a/src/com/android/packageinstaller/role/ui/RequestRoleActivity.java
+++ b/src/com/android/packageinstaller/role/ui/RequestRoleActivity.java
@@ -199,7 +199,9 @@ public class RequestRoleActivity extends FragmentActivity {
mRoleName = RoleManager.ROLE_DIALER;
mPackageName = null;
- String callingPackageName = getCallingPackage();
+ // Intent.EXTRA_CALLING_PACKAGE is set in PermissionPolicyService.Internal
+ // .isActionRemovedForCallingPackage() and can be trusted.
+ String callingPackageName = intent.getStringExtra(Intent.EXTRA_CALLING_PACKAGE);
String extraPackageName = intent.getStringExtra(
TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME);
if (Objects.equals(extraPackageName, callingPackageName)) {
@@ -240,7 +242,9 @@ public class RequestRoleActivity extends FragmentActivity {
mRoleName = RoleManager.ROLE_SMS;
mPackageName = null;
- String callingPackageName = getCallingPackage();
+ // Intent.EXTRA_CALLING_PACKAGE is set in PermissionPolicyService.Internal
+ // .isActionRemovedForCallingPackage() and can be trusted.
+ String callingPackageName = intent.getStringExtra(Intent.EXTRA_CALLING_PACKAGE);
String extraPackageName = intent.getStringExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME);
if (extraPackageName == null) {
// Launch the settings activity to show the list.