summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Pontoriero <diegs@google.com>2014-08-21 04:08:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-21 04:08:51 +0000
commit561f7f438352f70fbefb9c7606269162527e7fe5 (patch)
tree066465d168a1575f2a7a112403b9237a4aca168c
parentb818431016422e7b4f5e147030794f652f15babe (diff)
parent2d21ec47ca46b2c037278afe4558b405a0eed63c (diff)
downloadframeworks_base-561f7f438352f70fbefb9c7606269162527e7fe5.zip
frameworks_base-561f7f438352f70fbefb9c7606269162527e7fe5.tar.gz
frameworks_base-561f7f438352f70fbefb9c7606269162527e7fe5.tar.bz2
am d0cf89eb: am 744a16e4: am dede6854: Merge "Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API for determining carrier app instead of MCC/MNC." into lmp-dev
* commit 'd0cf89eb08c2839fa2609e59b932923076b6aca3': Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API for determining carrier app instead of MCC/MNC.
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 67c01e5..5b216ed 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -3490,10 +3490,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mIsProvisioningNetwork.set(false);
// Check for apps that can handle provisioning first
Intent provisioningIntent = new Intent(TelephonyIntents.ACTION_CARRIER_SETUP);
- provisioningIntent.addCategory(TelephonyIntents.CATEGORY_MCCMNC_PREFIX
- + mTelephonyManager.getSimOperator());
- if (mContext.getPackageManager().resolveActivity(provisioningIntent, 0 /* flags */)
- != null) {
+ List<String> carrierPackages =
+ mTelephonyManager.getCarrierPackageNamesForBroadcastIntent(provisioningIntent);
+ if (carrierPackages != null && !carrierPackages.isEmpty()) {
+ if (carrierPackages.size() != 1) {
+ if (DBG) log("Multiple matching carrier apps found, launching the first.");
+ }
+ provisioningIntent.setPackage(carrierPackages.get(0));
provisioningIntent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(provisioningIntent);