Loading packages/CarrierDefaultApp/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ <!-- Telephony notification channel name for performance boost notifications. --> <string name="performance_boost_notification_channel">Performance boost</string> <!-- Notification title text for the performance boost notification. --> <string name="performance_boost_notification_title">%s recommends a performance boost</string> <string name="performance_boost_notification_title">Improve your 5G experience</string> <!-- Notification detail text for the performance boost notification. --> <string name="performance_boost_notification_detail">Buy a performance boost for better network performance</string> <string name="performance_boost_notification_detail">%1$s recommends buying a performance boost plan. Tap to buy through %2$s.</string> <!-- Notification button text to cancel the performance boost notification. --> <string name="performance_boost_notification_button_not_now">Not now</string> <!-- Notification button text to manage the performance boost notification. --> Loading packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/SlicePurchaseBroadcastReceiver.java +9 −9 Original line number Diff line number Diff line Loading @@ -178,9 +178,9 @@ public class SlicePurchaseBroadcastReceiver extends BroadcastReceiver{ return false; } String appName = intent.getStringExtra(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME); if (TextUtils.isEmpty(appName)) { loge("isIntentValid: empty requesting application name: " + appName); String carrier = intent.getStringExtra(SlicePurchaseController.EXTRA_CARRIER); if (TextUtils.isEmpty(carrier)) { loge("isIntentValid: empty carrier: " + carrier); return false; } Loading Loading @@ -310,14 +310,14 @@ public class SlicePurchaseBroadcastReceiver extends BroadcastReceiver{ channel.setBlockable(true); context.getSystemService(NotificationManager.class).createNotificationChannel(channel); String carrier = intent.getStringExtra(SlicePurchaseController.EXTRA_CARRIER); Notification notification = new Notification.Builder(context, PERFORMANCE_BOOST_NOTIFICATION_CHANNEL_ID) .setContentTitle(String.format(res.getString( R.string.performance_boost_notification_title), intent.getStringExtra( SlicePurchaseController.EXTRA_REQUESTING_APP_NAME))) .setContentText(res.getString( R.string.performance_boost_notification_detail)) .setContentTitle(res.getString( R.string.performance_boost_notification_title)) .setContentText(String.format(res.getString( R.string.performance_boost_notification_detail), carrier, carrier)) .setSmallIcon(R.drawable.ic_performance_boost) .setContentIntent(createContentIntent(context, intent, 1)) .setDeleteIntent(intent.getParcelableExtra( Loading packages/CarrierDefaultApp/tests/unit/src/com/android/carrierdefaultapp/SlicePurchaseActivityTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ import org.mockito.MockitoAnnotations; @RunWith(AndroidJUnit4.class) public class SlicePurchaseActivityTest extends ActivityUnitTestCase<SlicePurchaseActivity> { private static final String TAG = "SlicePurchaseActivityTest"; private static final String CARRIER = "Some Carrier"; private static final String URL = "file:///android_asset/slice_purchase_test.html"; private static final int PHONE_ID = 0; Loading Loading @@ -95,7 +95,7 @@ public class SlicePurchaseActivityTest extends ActivityUnitTestCase<SlicePurchas TelephonyManager.PREMIUM_CAPABILITY_PRIORITIZE_LATENCY); intent.putExtra(SlicePurchaseController.EXTRA_PURCHASE_URL, SlicePurchaseController.SLICE_PURCHASE_TEST_FILE); intent.putExtra(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME, TAG); intent.putExtra(SlicePurchaseController.EXTRA_CARRIER, CARRIER); Intent spiedIntent = spy(intent); // set up pending intents Loading packages/CarrierDefaultApp/tests/unit/src/com/android/carrierdefaultapp/SlicePurchaseBroadcastReceiverTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ import java.util.Locale; @RunWith(AndroidJUnit4.class) public class SlicePurchaseBroadcastReceiverTest { private static final int PHONE_ID = 0; private static final String TAG = "SlicePurchaseBroadcastReceiverTest"; private static final String CARRIER = "Some Carrier"; private static final String EXTRA = "EXTRA"; @Mock Intent mIntent; Loading Loading @@ -136,8 +136,7 @@ public class SlicePurchaseBroadcastReceiverTest { eq(SlicePurchaseController.EXTRA_PREMIUM_CAPABILITY), anyInt()); doReturn(SlicePurchaseController.SLICE_PURCHASE_TEST_FILE).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_PURCHASE_URL)); doReturn(TAG).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME)); doReturn(CARRIER).when(mIntent).getStringExtra(eq(SlicePurchaseController.EXTRA_CARRIER)); assertFalse(SlicePurchaseBroadcastReceiver.isIntentValid(mIntent)); // set up pending intent Loading Loading @@ -229,8 +228,7 @@ public class SlicePurchaseBroadcastReceiverTest { eq(SlicePurchaseController.EXTRA_PREMIUM_CAPABILITY), anyInt()); doReturn(SlicePurchaseController.SLICE_PURCHASE_TEST_FILE).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_PURCHASE_URL)); doReturn(TAG).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME)); doReturn(CARRIER).when(mIntent).getStringExtra(eq(SlicePurchaseController.EXTRA_CARRIER)); mSlicePurchaseBroadcastReceiver.onReceive(mContext, mIntent); } Loading Loading
packages/CarrierDefaultApp/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ <!-- Telephony notification channel name for performance boost notifications. --> <string name="performance_boost_notification_channel">Performance boost</string> <!-- Notification title text for the performance boost notification. --> <string name="performance_boost_notification_title">%s recommends a performance boost</string> <string name="performance_boost_notification_title">Improve your 5G experience</string> <!-- Notification detail text for the performance boost notification. --> <string name="performance_boost_notification_detail">Buy a performance boost for better network performance</string> <string name="performance_boost_notification_detail">%1$s recommends buying a performance boost plan. Tap to buy through %2$s.</string> <!-- Notification button text to cancel the performance boost notification. --> <string name="performance_boost_notification_button_not_now">Not now</string> <!-- Notification button text to manage the performance boost notification. --> Loading
packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/SlicePurchaseBroadcastReceiver.java +9 −9 Original line number Diff line number Diff line Loading @@ -178,9 +178,9 @@ public class SlicePurchaseBroadcastReceiver extends BroadcastReceiver{ return false; } String appName = intent.getStringExtra(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME); if (TextUtils.isEmpty(appName)) { loge("isIntentValid: empty requesting application name: " + appName); String carrier = intent.getStringExtra(SlicePurchaseController.EXTRA_CARRIER); if (TextUtils.isEmpty(carrier)) { loge("isIntentValid: empty carrier: " + carrier); return false; } Loading Loading @@ -310,14 +310,14 @@ public class SlicePurchaseBroadcastReceiver extends BroadcastReceiver{ channel.setBlockable(true); context.getSystemService(NotificationManager.class).createNotificationChannel(channel); String carrier = intent.getStringExtra(SlicePurchaseController.EXTRA_CARRIER); Notification notification = new Notification.Builder(context, PERFORMANCE_BOOST_NOTIFICATION_CHANNEL_ID) .setContentTitle(String.format(res.getString( R.string.performance_boost_notification_title), intent.getStringExtra( SlicePurchaseController.EXTRA_REQUESTING_APP_NAME))) .setContentText(res.getString( R.string.performance_boost_notification_detail)) .setContentTitle(res.getString( R.string.performance_boost_notification_title)) .setContentText(String.format(res.getString( R.string.performance_boost_notification_detail), carrier, carrier)) .setSmallIcon(R.drawable.ic_performance_boost) .setContentIntent(createContentIntent(context, intent, 1)) .setDeleteIntent(intent.getParcelableExtra( Loading
packages/CarrierDefaultApp/tests/unit/src/com/android/carrierdefaultapp/SlicePurchaseActivityTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ import org.mockito.MockitoAnnotations; @RunWith(AndroidJUnit4.class) public class SlicePurchaseActivityTest extends ActivityUnitTestCase<SlicePurchaseActivity> { private static final String TAG = "SlicePurchaseActivityTest"; private static final String CARRIER = "Some Carrier"; private static final String URL = "file:///android_asset/slice_purchase_test.html"; private static final int PHONE_ID = 0; Loading Loading @@ -95,7 +95,7 @@ public class SlicePurchaseActivityTest extends ActivityUnitTestCase<SlicePurchas TelephonyManager.PREMIUM_CAPABILITY_PRIORITIZE_LATENCY); intent.putExtra(SlicePurchaseController.EXTRA_PURCHASE_URL, SlicePurchaseController.SLICE_PURCHASE_TEST_FILE); intent.putExtra(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME, TAG); intent.putExtra(SlicePurchaseController.EXTRA_CARRIER, CARRIER); Intent spiedIntent = spy(intent); // set up pending intents Loading
packages/CarrierDefaultApp/tests/unit/src/com/android/carrierdefaultapp/SlicePurchaseBroadcastReceiverTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ import java.util.Locale; @RunWith(AndroidJUnit4.class) public class SlicePurchaseBroadcastReceiverTest { private static final int PHONE_ID = 0; private static final String TAG = "SlicePurchaseBroadcastReceiverTest"; private static final String CARRIER = "Some Carrier"; private static final String EXTRA = "EXTRA"; @Mock Intent mIntent; Loading Loading @@ -136,8 +136,7 @@ public class SlicePurchaseBroadcastReceiverTest { eq(SlicePurchaseController.EXTRA_PREMIUM_CAPABILITY), anyInt()); doReturn(SlicePurchaseController.SLICE_PURCHASE_TEST_FILE).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_PURCHASE_URL)); doReturn(TAG).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME)); doReturn(CARRIER).when(mIntent).getStringExtra(eq(SlicePurchaseController.EXTRA_CARRIER)); assertFalse(SlicePurchaseBroadcastReceiver.isIntentValid(mIntent)); // set up pending intent Loading Loading @@ -229,8 +228,7 @@ public class SlicePurchaseBroadcastReceiverTest { eq(SlicePurchaseController.EXTRA_PREMIUM_CAPABILITY), anyInt()); doReturn(SlicePurchaseController.SLICE_PURCHASE_TEST_FILE).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_PURCHASE_URL)); doReturn(TAG).when(mIntent).getStringExtra( eq(SlicePurchaseController.EXTRA_REQUESTING_APP_NAME)); doReturn(CARRIER).when(mIntent).getStringExtra(eq(SlicePurchaseController.EXTRA_CARRIER)); mSlicePurchaseBroadcastReceiver.onReceive(mContext, mIntent); } Loading