Merge "Revert "[Settings] Support getSystemService(Class<T>)"" into sc-dev
This commit is contained in:
@@ -43,7 +43,7 @@ public final class EthernetTetherPreferenceController extends TetherBasePreferen
|
||||
super(context, preferenceKey);
|
||||
mEthernetRegex = context.getString(
|
||||
com.android.internal.R.string.config_ethernet_iface_regex);
|
||||
mEthernetManager = context.getSystemService(EthernetManager.class);
|
||||
mEthernetManager = (EthernetManager) context.getSystemService(Context.ETHERNET_SERVICE);
|
||||
}
|
||||
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_START)
|
||||
|
@@ -73,9 +73,9 @@ public class MobilePlanPreferenceController extends AbstractPreferenceController
|
||||
MobilePlanPreferenceHost host) {
|
||||
super(context);
|
||||
mHost = host;
|
||||
mCm = context.getSystemService(ConnectivityManager.class);
|
||||
mTm = context.getSystemService(TelephonyManager.class);
|
||||
mUserManager = context.getSystemService(UserManager.class);
|
||||
mCm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
mTm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
mIsSecondaryUser = !mUserManager.isAdminUser();
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public class NetworkResetRestrictionChecker {
|
||||
|
||||
public NetworkResetRestrictionChecker(Context context) {
|
||||
mContext = context;
|
||||
mUserManager = context.getSystemService(UserManager.class);
|
||||
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
}
|
||||
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
||||
|
@@ -140,6 +140,6 @@ public class NetworkScorerPicker extends InstrumentedPreferenceFragment implemen
|
||||
|
||||
@VisibleForTesting
|
||||
NetworkScoreManager createNetworkScorerManager(Context context) {
|
||||
return context.getSystemService(NetworkScoreManager.class);
|
||||
return (NetworkScoreManager) context.getSystemService(Context.NETWORK_SCORE_SERVICE);
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class NetworkScorerPickerPreferenceController extends BasePreferenceContr
|
||||
public NetworkScorerPickerPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
mNetworkScoreManager =
|
||||
mContext.getSystemService(NetworkScoreManager.class);
|
||||
(NetworkScoreManager) mContext.getSystemService(Context.NETWORK_SCORE_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -128,10 +128,10 @@ public class TetherEnabler implements SwitchWidgetController.OnSwitchChangeListe
|
||||
mSwitchWidgetController = switchWidgetController;
|
||||
mDataSaverBackend = new DataSaverBackend(context);
|
||||
mConnectivityManager =
|
||||
context.getSystemService(ConnectivityManager.class);
|
||||
mTetheringManager = context.getSystemService(TetheringManager.class);
|
||||
mWifiManager = context.getSystemService(WifiManager.class);
|
||||
mUserManager = context.getSystemService(UserManager.class);
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
mTetheringManager = (TetheringManager) context.getSystemService(Context.TETHERING_SERVICE);
|
||||
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
mBluetoothPan = bluetoothPan;
|
||||
mEthernetRegex =
|
||||
|
@@ -1291,8 +1291,8 @@ public class ApnEditor extends SettingsPreferenceFragment
|
||||
mReadOnlyApnTypes = null;
|
||||
mReadOnlyApnFields = null;
|
||||
|
||||
final CarrierConfigManager configManager =
|
||||
getSystemService(CarrierConfigManager.class);
|
||||
final CarrierConfigManager configManager = (CarrierConfigManager)
|
||||
getSystemService(Context.CARRIER_CONFIG_SERVICE);
|
||||
if (configManager != null) {
|
||||
final PersistableBundle b = configManager.getConfigForSubId(mSubId);
|
||||
if (b != null) {
|
||||
|
@@ -209,8 +209,8 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
mSubscriptionInfo = getSubscriptionInfo(mSubId);
|
||||
mTelephonyManager = activity.getSystemService(TelephonyManager.class);
|
||||
|
||||
final CarrierConfigManager configManager =
|
||||
getSystemService(CarrierConfigManager.class);
|
||||
final CarrierConfigManager configManager = (CarrierConfigManager)
|
||||
getSystemService(Context.CARRIER_CONFIG_SERVICE);
|
||||
final PersistableBundle b = configManager.getConfigForSubId(mSubId);
|
||||
mHideImsApn = b.getBoolean(CarrierConfigManager.KEY_HIDE_IMS_APN_BOOL);
|
||||
mAllowAddingApns = b.getBoolean(CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user