Revert "[Settings] Support getSystemService(Class<T>)"

This reverts commit d5ccde31a8.

Reason for revert: failure on test cases

Change-Id: I0a179a6ebb5ef1dec566ce6e8facd5f3b82d7c8a
This commit is contained in:
Bonian Chen
2021-03-30 00:51:15 +00:00
parent d5ccde31a8
commit 234b698fb2
63 changed files with 103 additions and 103 deletions

View File

@@ -104,8 +104,8 @@ public class SimSelectNotification extends BroadcastReceiver {
subId = SubscriptionManager.getDefaultSmsSubscriptionId();
}
SubscriptionManager subscriptionManager = (context.getSystemService(
SubscriptionManager.class));
SubscriptionManager subscriptionManager = ((SubscriptionManager) context.getSystemService(
Context.TELEPHONY_SUBSCRIPTION_SERVICE));
if (!subscriptionManager.isActiveSubscriptionId(subId)) {
Log.w(TAG, "onEnableMmsDataRequest invalid sub ID " + subId);
return;
@@ -130,8 +130,8 @@ public class SimSelectNotification extends BroadcastReceiver {
return;
}
TelephonyManager tm = (context.getSystemService(
TelephonyManager.class)).createForSubscriptionId(subId);
TelephonyManager tm = ((TelephonyManager) context.getSystemService(
Context.TELEPHONY_SERVICE)).createForSubscriptionId(subId);
if (tm.isDataEnabledForApn(TYPE_MMS)) {
Log.w(TAG, "onEnableMmsDataRequest MMS data already enabled on sub ID " + subId);
@@ -230,14 +230,14 @@ public class SimSelectNotification extends BroadcastReceiver {
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
builder.setContentIntent(resultPendingIntent);
NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(notificationChannel);
notificationManager.notify(SIM_SELECT_NOTIFICATION_ID, builder.build());
}
public static void cancelSimSelectNotification(Context context) {
NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(SIM_SELECT_NOTIFICATION_ID);
}
@@ -270,14 +270,14 @@ public class SimSelectNotification extends BroadcastReceiver {
// Notify the notification.
NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(notificationChannel);
notificationManager.notify(ENABLE_MMS_NOTIFICATION_ID, builder.build());
}
private void cancelEnableMmsNotification(Context context) {
NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(ENABLE_MMS_NOTIFICATION_ID);
}