summaryrefslogtreecommitdiff
path: root/packages/CarrierDefaultApp/src
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-02-21 10:45:07 -0800
committerXin Li <delphij@google.com>2019-02-21 16:02:06 -0800
commitb455c3a7f3e98f7a576cdc21bdc96ae8ec30c8f0 (patch)
treeb4a52eded53b6be40273ee5d61e4911b48165d03 /packages/CarrierDefaultApp/src
parenta96e3dfb81a90d5daaabaa6e8a19cc401b780a76 (diff)
parentd83144070c3f6a2472d858714f955398aa894bb3 (diff)
DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293 Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
Diffstat (limited to 'packages/CarrierDefaultApp/src')
-rw-r--r--packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java14
-rw-r--r--packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java12
2 files changed, 13 insertions, 13 deletions
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
index 31549fa0d1bb..55c9361ce6c4 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
@@ -196,19 +196,7 @@ public class CaptivePortalLoginActivity extends Activity {
if (success) {
// Trigger re-evaluation upon success http response code
CarrierActionUtils.applyCarrierAction(
- CarrierActionUtils.CARRIER_ACTION_ENABLE_RADIO, getIntent(),
- getApplicationContext());
- CarrierActionUtils.applyCarrierAction(
- CarrierActionUtils.CARRIER_ACTION_ENABLE_METERED_APNS, getIntent(),
- getApplicationContext());
- CarrierActionUtils.applyCarrierAction(
- CarrierActionUtils.CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS, getIntent(),
- getApplicationContext());
- CarrierActionUtils.applyCarrierAction(
- CarrierActionUtils.CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER, getIntent(),
- getApplicationContext());
- CarrierActionUtils.applyCarrierAction(
- CarrierActionUtils.CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL, getIntent(),
+ CarrierActionUtils.CARRIER_ACTION_RESET_ALL, getIntent(),
getApplicationContext());
}
finishAndRemoveTask();
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
index 4518d79ff611..3258d57ba8e0 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
@@ -56,6 +56,7 @@ public class CarrierActionUtils {
public static final int CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER = 8;
public static final int CARRIER_ACTION_REGISTER_DEFAULT_NETWORK_AVAIL = 9;
public static final int CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL = 10;
+ public static final int CARRIER_ACTION_RESET_ALL = 11;
public static void applyCarrierAction(int actionIdx, Intent intent, Context context) {
switch (actionIdx) {
@@ -92,6 +93,9 @@ public class CarrierActionUtils {
case CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL:
onDeregisterDefaultNetworkAvail(intent, context);
break;
+ case CARRIER_ACTION_RESET_ALL:
+ onResetAllCarrierActions(intent, context);
+ break;
default:
loge("unsupported carrier action index: " + actionIdx);
}
@@ -196,6 +200,14 @@ public class CarrierActionUtils {
context.getSystemService(NotificationManager.class).cancelAll();
}
+ private static void onResetAllCarrierActions(Intent intent, Context context) {
+ int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
+ SubscriptionManager.getDefaultVoiceSubscriptionId());
+ logd("onResetAllCarrierActions subId: " + subId);
+ final TelephonyManager telephonyMgr = context.getSystemService(TelephonyManager.class);
+ telephonyMgr.carrierActionResetAll(subId);
+ }
+
private static Notification getNotification(Context context, int titleId, int textId,
PendingIntent pendingIntent) {
final TelephonyManager telephonyMgr = context.getSystemService(TelephonyManager.class);