From deeb41a8521374e4390e32e1f7942c08c8886886 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Mon, 27 Jul 2020 18:49:27 +0000 Subject: Revert "Update IMSI protection notification flow" Revert "Make broadcast protected" Revert submission 12228948-cherrypick-imsiFlow-cq2jn82jd4 Reason for revert: protect broadcast by NETWORK_SETTINGS permission Reverted Changes: I8be7c1b9e:Update IMSI protection notification flow I0cd36cb60:Make broadcast protected Bug: 161932419 Merged-In: I8be7c1b9e66162fdd244946b47367290116a7747 Change-Id: I625df183899e59e9acfc7258518810aff050b35c --- .../android/server/wifi/WifiCarrierInfoManager.java | 18 ++++-------------- service/res/values/strings.xml | 6 +++--- 2 files changed, 7 insertions(+), 17 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiCarrierInfoManager.java b/service/java/com/android/server/wifi/WifiCarrierInfoManager.java index 79441dae5..d483047d2 100644 --- a/service/java/com/android/server/wifi/WifiCarrierInfoManager.java +++ b/service/java/com/android/server/wifi/WifiCarrierInfoManager.java @@ -96,10 +96,6 @@ public class WifiCarrierInfoManager { @VisibleForTesting public static final String NOTIFICATION_USER_DISMISSED_INTENT_ACTION = "com.android.server.wifi.action.CarrierNetwork.USER_DISMISSED"; - /** Intent when user clicked on the notification. */ - @VisibleForTesting - public static final String NOTIFICATION_USER_CLICKED_INTENT_ACTION = - "com.android.server.wifi.action.CarrierNetwork.USER_CLICKED"; @VisibleForTesting public static final String EXTRA_CARRIER_NAME = "com.android.server.wifi.extra.CarrierNetwork.CARRIER_NAME"; @@ -227,16 +223,14 @@ public class WifiCarrierInfoManager { switch (intent.getAction()) { case NOTIFICATION_USER_ALLOWED_CARRIER_INTENT_ACTION: - handleUserAllowCarrierExemptionAction(carrierName, carrierId); - break; - case NOTIFICATION_USER_DISALLOWED_CARRIER_INTENT_ACTION: - handleUserDisallowCarrierExemptionAction(carrierName, carrierId); - break; - case NOTIFICATION_USER_CLICKED_INTENT_ACTION: + Log.i(TAG, "User clicked to allow carrier"); sendImsiPrivacyConfirmationDialog(carrierName, carrierId); // Collapse the notification bar mContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); break; + case NOTIFICATION_USER_DISALLOWED_CARRIER_INTENT_ACTION: + handleUserDisallowCarrierExemptionAction(carrierName, carrierId); + break; case NOTIFICATION_USER_DISMISSED_INTENT_ACTION: handleUserDismissAction(); return; // no need to cancel a dismissed notification, return. @@ -303,7 +297,6 @@ public class WifiCarrierInfoManager { mIntentFilter.addAction(NOTIFICATION_USER_DISMISSED_INTENT_ACTION); mIntentFilter.addAction(NOTIFICATION_USER_ALLOWED_CARRIER_INTENT_ACTION); mIntentFilter.addAction(NOTIFICATION_USER_DISALLOWED_CARRIER_INTENT_ACTION); - mIntentFilter.addAction(NOTIFICATION_USER_CLICKED_INTENT_ACTION); mContext.registerReceiver(mBroadcastReceiver, mIntentFilter, null, handler); configStore.registerStoreData(wifiInjector.makeImsiProtectionExemptionStoreData( @@ -1455,9 +1448,6 @@ public class WifiCarrierInfoManager { .setStyle(new Notification.BigTextStyle() .bigText(mResources.getString( R.string.wifi_suggestion_imsi_privacy_content))) - .setContentIntent(getPrivateBroadcast(NOTIFICATION_USER_CLICKED_INTENT_ACTION, - Pair.create(EXTRA_CARRIER_NAME, carrierName), - Pair.create(EXTRA_CARRIER_ID, carrierId))) .setDeleteIntent(getPrivateBroadcast(NOTIFICATION_USER_DISMISSED_INTENT_ACTION, Pair.create(EXTRA_CARRIER_NAME, carrierName), Pair.create(EXTRA_CARRIER_ID, carrierId))) diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml index ae3f1977b..441ecca15 100644 --- a/service/res/values/strings.xml +++ b/service/res/values/strings.xml @@ -49,11 +49,11 @@ No thanks - Connect to %s Wi\u2011Fi? + %s wants to auto\u2011connect - These networks receive a SIM ID that can be used to track device location + These networks receive a unique ID that can be used to track device location - Connect + Connect anyway Don\u0027t connect -- cgit v1.2.3