Set package name on ACTION_PICK intent
This prevents the disambiguation dialog from appearing. As
a result, the user no longer has the ability to decide
whether to use their Work or Personal Contacts app. This
prevents the intent from becoming cross-profile.
Bug: 17472472
Change-Id: Ica5a9bf960a016f735caf933da5cc8fa6aa7614c
diff --git a/src/com/android/contacts/activities/AttachPhotoActivity.java b/src/com/android/contacts/activities/AttachPhotoActivity.java
index cf3bfc8..9dad2e7 100644
--- a/src/com/android/contacts/activities/AttachPhotoActivity.java
+++ b/src/com/android/contacts/activities/AttachPhotoActivity.java
@@ -103,6 +103,7 @@
mCroppedPhotoUri = ContactPhotoUtils.generateTempCroppedImageUri(this);
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(Contacts.CONTENT_TYPE);
+ intent.setPackage(getPackageName());
startActivityForResult(intent, REQUEST_PICK_CONTACT);
}