Add support messages to device admin pages.

Add support message to device admin settings pages.
Show policy information for device owners
and profile owners.
Allow a user to remove profile from profile owners
admin page.

Bug: 26416662
Change-Id: I95424da50067b7c0ba1618a083a31448d406188f
This commit is contained in:
Kenny Guy
2015-12-22 12:11:41 +00:00
parent acd0d1e9ff
commit 7a3555961d
8 changed files with 228 additions and 144 deletions

View File

@@ -53,10 +53,7 @@ public class RestrictedPreferenceHelper {
mContext = context;
mPreference = preference;
mRestrictedPadlock = mContext.getDrawable(R.drawable.ic_settings_lock_outline);
final int iconSize = mContext.getResources().getDimensionPixelSize(
R.dimen.restricted_lock_icon_size);
mRestrictedPadlock.setBounds(0, 0, iconSize, iconSize);
mRestrictedPadlock = getRestrictedPadlock(mContext);
mRestrictedPadlockPadding = mContext.getResources().getDimensionPixelSize(
R.dimen.restricted_lock_icon_padding);
@@ -192,4 +189,15 @@ public class RestrictedPreferenceHelper {
public boolean isDisabledByAdmin() {
return mDisabledByAdmin;
}
/**
* @return drawables for displaying with settings that are locked by a device admin.
*/
public static Drawable getRestrictedPadlock(Context context) {
Drawable restrictedPadlock = context.getDrawable(R.drawable.ic_settings_lock_outline);
final int iconSize = context.getResources().getDimensionPixelSize(
R.dimen.restricted_lock_icon_size);
restrictedPadlock.setBounds(0, 0, iconSize, iconSize);
return restrictedPadlock;
}
}