This CL updates the availability to behave properly when a user other than the primary user is accessing it. This also makes the api return no intent if they don't have permission to access this because attempting to go to that screen will cause a crash. Also updates tests related to this change. Test: robotests still pass Bug: 64092292 Change-Id: If9913d9ae08ee3e205ff324aaeeadc755ff1d23d
15 lines
610 B
Java
15 lines
610 B
Java
package com.android.settings.network;
|
|
|
|
import android.content.Context;
|
|
import com.android.settingslib.RestrictedLockUtils;
|
|
|
|
/**
|
|
* Wrapper class needed to be able to test classes which use RestrictedLockUtils methods.
|
|
* Unfortunately there is no way to deal with this until robolectric is updated due to the fact
|
|
* that it is a static method and it uses new API's.
|
|
*/
|
|
public class RestrictedLockUtilsWrapper {
|
|
public boolean hasBaseUserRestriction(Context context, String userRestriction, int userId) {
|
|
return RestrictedLockUtils.hasBaseUserRestriction(context, userRestriction, userId);
|
|
}
|
|
} |