Make AirplaneModePrefController.isAvailable static.

Allows calling without instantiating the pref controller.
Also some minor cleanup of MobileNetworkPrefController.

Bug: 62022517
Test: robotests
Change-Id: I34ff5d3729d06158bff3cc125de4c114bf4861d5
This commit is contained in:
Andrew Sapperstein
2017-07-24 13:42:19 -07:00
parent 6666bf5605
commit c8c42838ca
2 changed files with 8 additions and 7 deletions

View File

@@ -39,18 +39,17 @@ public class MobileNetworkPreferenceController extends PreferenceController impl
private static final String KEY_MOBILE_NETWORK_SETTINGS = "mobile_network_settings";
private final UserManager mUserManager;
private final boolean mIsSecondaryUser;
private final TelephonyManager mTelephonyManager;
private Preference mPreference;
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
@VisibleForTesting
PhoneStateListener mPhoneStateListener;
public MobileNetworkPreferenceController(Context context) {
super(context);
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
mIsSecondaryUser = !mUserManager.isAdminUser();
mIsSecondaryUser = !userManager.isAdminUser();
}
@Override