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

@@ -202,7 +202,7 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings {
super.onCreate(icicle);
final Context context = getContext();
mUserManager = context.getSystemService(UserManager.class);
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mTelephonyManager = context.getSystemService(TelephonyManager.class)
.createForSubscriptionId(mSubId);

View File

@@ -106,8 +106,8 @@ public class NetworkSelectSettings extends DashboardFragment {
.createForSubscriptionId(mSubId);
mNetworkScanHelper = new NetworkScanHelper(
mTelephonyManager, mCallback, mNetworkScanExecutor);
PersistableBundle bundle = (getContext().getSystemService(
CarrierConfigManager.class)).getConfigForSubId(mSubId);
PersistableBundle bundle = ((CarrierConfigManager) getContext().getSystemService(
Context.CARRIER_CONFIG_SERVICE)).getConfigForSubId(mSubId);
if (bundle != null) {
mShow4GForLTE = bundle.getBoolean(
CarrierConfigManager.KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL);

View File

@@ -212,8 +212,8 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final LayoutInflater inflater =
mContext.getSystemService(LayoutInflater.class);
final LayoutInflater inflater = (LayoutInflater)
mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = inflater.inflate(mItemResId, null);