Allow importing contacts from mulitple sims

SimContacts should parse the subscription_id extra in order
to restrict which SIM card to examine.

Bug: 16525652
Change-Id: I40c0cc6052a7ab25e102c7842f4630f0352e3173
diff --git a/src/com/android/phone/SimContacts.java b/src/com/android/phone/SimContacts.java
index a069e41..8192795 100644
--- a/src/com/android/phone/SimContacts.java
+++ b/src/com/android/phone/SimContacts.java
@@ -39,6 +39,7 @@
 import android.provider.ContactsContract.Data;
 import android.provider.ContactsContract.RawContacts;
 import android.telecom.PhoneAccount;
+import android.telephony.SubscriptionManager;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.ContextMenu;
@@ -242,8 +243,13 @@
 
     @Override
     protected Uri resolveIntent() {
-        Intent intent = getIntent();
-        intent.setData(Uri.parse("content://icc/adn"));
+        final Intent intent = getIntent();
+        if (intent.hasExtra("subscription_id")) {
+            final long subId = intent.getLongExtra("subscription_id", -1);
+            intent.setData(Uri.parse("content://icc/adn/subId/" + subId));
+        } else {
+            intent.setData(Uri.parse("content://icc/adn"));
+        }
         if (Intent.ACTION_PICK.equals(intent.getAction())) {
             // "index" is 1-based
             mInitialSelection = intent.getIntExtra("index", 0) - 1;