Merge "Add new method "checkRestrictionEnforced" to RestrictedPreferenceHelper." into sc-dev am: cb3e9c2bc8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14758921

Change-Id: Ib874be05db44881f686b61f74a90f97315990b2c
This commit is contained in:
Stanley Wang
2021-06-03 06:44:50 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 1 deletions

View File

@@ -48,7 +48,6 @@
android:layout_width="@dimen/settingslib_restricted_icon_size"
android:layout_height="@dimen/settingslib_restricted_icon_size"
android:tint="?android:attr/colorAccent"
android:theme="@android:style/Theme.Material"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/settingslib_restricted_icon_margin_end"
android:src="@*android:drawable/ic_info"

View File

@@ -138,6 +138,17 @@ public class RestrictedPreferenceHelper {
setDisabledByAdmin(admin);
}
/**
* @return EnforcedAdmin if we have been passed the restriction in the xml.
*/
public EnforcedAdmin checkRestrictionEnforced() {
if (mAttrUserRestriction == null) {
return null;
}
return RestrictedLockUtilsInternal.checkIfRestrictionEnforced(mContext,
mAttrUserRestriction, UserHandle.myUserId());
}
/**
* Disable this preference based on the enforce admin.
*