Loading packages/CarrierDefaultApp/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ <application android:label="@string/app_name" android:directBootAware="true" android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true" android:icon="@mipmap/ic_launcher_android"> <receiver android:name="com.android.carrierdefaultapp.CarrierDefaultBroadcastReceiver"> <intent-filter> <action android:name="com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED" /> Loading @@ -45,6 +46,7 @@ <activity android:name="com.android.carrierdefaultapp.CaptivePortalLoginActivity" android:label="@string/action_bar_label" android:exported="true" android:theme="@style/AppTheme" android:configChanges="keyboardHidden|orientation|screenSize"> <intent-filter> Loading packages/CarrierDefaultApp/res/mipmap/ic_launcher_android.png 0 → 100644 +3.21 KiB Loading image diff... packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java +1 −13 Original line number Diff line number Diff line Loading @@ -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(); Loading packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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); } Loading Loading @@ -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); Loading telephony/java/android/telephony/CarrierConfigManager.java +3 −6 Original line number Diff line number Diff line Loading @@ -2307,12 +2307,9 @@ public class CarrierConfigManager { //6: CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER }); sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE, new String[] { String.valueOf(false) + ": 7", //7: CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER String.valueOf(true) + ": 8" //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE, new String[] { String.valueOf(false) + ": 7", //7: CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER String.valueOf(true) + ": 8" //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER }); sDefaults.putStringArray(KEY_CARRIER_DEFAULT_REDIRECTION_URL_STRING_ARRAY, null); Loading Loading
packages/CarrierDefaultApp/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ <application android:label="@string/app_name" android:directBootAware="true" android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true" android:icon="@mipmap/ic_launcher_android"> <receiver android:name="com.android.carrierdefaultapp.CarrierDefaultBroadcastReceiver"> <intent-filter> <action android:name="com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED" /> Loading @@ -45,6 +46,7 @@ <activity android:name="com.android.carrierdefaultapp.CaptivePortalLoginActivity" android:label="@string/action_bar_label" android:exported="true" android:theme="@style/AppTheme" android:configChanges="keyboardHidden|orientation|screenSize"> <intent-filter> Loading
packages/CarrierDefaultApp/res/mipmap/ic_launcher_android.png 0 → 100644 +3.21 KiB Loading image diff...
packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java +1 −13 Original line number Diff line number Diff line Loading @@ -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(); Loading
packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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); } Loading Loading @@ -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); Loading
telephony/java/android/telephony/CarrierConfigManager.java +3 −6 Original line number Diff line number Diff line Loading @@ -2307,12 +2307,9 @@ public class CarrierConfigManager { //6: CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER }); sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE, new String[] { String.valueOf(false) + ": 7", //7: CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER String.valueOf(true) + ": 8" //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE, new String[] { String.valueOf(false) + ": 7", //7: CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER String.valueOf(true) + ": 8" //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER }); sDefaults.putStringArray(KEY_CARRIER_DEFAULT_REDIRECTION_URL_STRING_ARRAY, null); Loading