Fix testcase error

- ignore testcase in MobileNetworkActivityTest
- To avoid null pointer access in LocationForWorkPreferenceController,
move mUserManager initialization in constructor

Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.search"
Change-Id: Icf6c36ecef22149def6d5924741a798e8f506033
This commit is contained in:
Raff Tsai
2019-11-28 10:13:11 +08:00
parent 0a2a6cfef7
commit ed1b808474
2 changed files with 15 additions and 10 deletions

View File

@@ -39,6 +39,7 @@ public abstract class LocationBasePreferenceController extends BasePreferenceCon
*/
public LocationBasePreferenceController(Context context, String key) {
super(context, key);
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
}
/**
@@ -48,7 +49,6 @@ public abstract class LocationBasePreferenceController extends BasePreferenceCon
*/
public void init(DashboardFragment fragment) {
mFragment = fragment;
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
mLifecycle = mFragment.getSettingsLifecycle();
mLocationEnabler = new LocationEnabler(mContext, this /* listener */, mLifecycle);
}