Fields Summary |
---|
static final String | TAG |
public static final int | USES_POLICY_DEVICE_OWNERA type of policy that this device admin can use: device owner meta-policy
for an admin that is designated as owner of the device. |
public static final int | USES_POLICY_PROFILE_OWNERA type of policy that this device admin can use: profile owner meta-policy
for admins that have been installed as owner of some user profile. |
public static final int | USES_POLICY_LIMIT_PASSWORDA type of policy that this device admin can use: limit the passwords
that the user can select, via {@link DevicePolicyManager#setPasswordQuality}
and {@link DevicePolicyManager#setPasswordMinimumLength}.
To control this policy, the device admin must have a "limit-password"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_WATCH_LOGINA type of policy that this device admin can use: able to watch login
attempts from the user, via {@link DeviceAdminReceiver#ACTION_PASSWORD_FAILED},
{@link DeviceAdminReceiver#ACTION_PASSWORD_SUCCEEDED}, and
{@link DevicePolicyManager#getCurrentFailedPasswordAttempts}.
To control this policy, the device admin must have a "watch-login"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_RESET_PASSWORDA type of policy that this device admin can use: able to reset the
user's password via
{@link DevicePolicyManager#resetPassword}.
To control this policy, the device admin must have a "reset-password"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_FORCE_LOCKA type of policy that this device admin can use: able to force the device
to lock via{@link DevicePolicyManager#lockNow} or limit the
maximum lock timeout for the device via
{@link DevicePolicyManager#setMaximumTimeToLock}.
To control this policy, the device admin must have a "force-lock"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_WIPE_DATAA type of policy that this device admin can use: able to factory
reset the device, erasing all of the user's data, via
{@link DevicePolicyManager#wipeData}.
To control this policy, the device admin must have a "wipe-data"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_SETS_GLOBAL_PROXYA type of policy that this device admin can use: able to specify the
device Global Proxy, via {@link DevicePolicyManager#setGlobalProxy}.
To control this policy, the device admin must have a "set-global-proxy"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_EXPIRE_PASSWORDA type of policy that this device admin can use: force the user to
change their password after an administrator-defined time limit.
To control this policy, the device admin must have an "expire-password"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_ENCRYPTED_STORAGEA type of policy that this device admin can use: require encryption of stored data.
To control this policy, the device admin must have a "encrypted-storage"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_DISABLE_CAMERAA type of policy that this device admin can use: disables use of all device cameras.
To control this policy, the device admin must have a "disable-camera"
tag in the "uses-policies" section of its meta-data. |
public static final int | USES_POLICY_DISABLE_KEYGUARD_FEATURESA type of policy that this device admin can use: disables use of keyguard features.
To control this policy, the device admin must have a "disable-keyguard-features"
tag in the "uses-policies" section of its meta-data. |
static ArrayList | sPoliciesDisplayOrder |
static HashMap | sKnownPolicies |
static android.util.SparseArray | sRevKnownPolicies |
final android.content.pm.ResolveInfo | mReceiverThe BroadcastReceiver that implements this device admin component. |
boolean | mVisibleWhether this should be visible to the user. |
int | mUsesPoliciesThe policies this administrator needs access to. |
public static final Parcelable.Creator | CREATORUsed to make this class parcelable. |
Methods Summary |
---|
public int | describeContents()
return 0;
|
public void | dump(android.util.Printer pw, java.lang.String prefix)
pw.println(prefix + "Receiver:");
mReceiver.dump(pw, prefix + " ");
|
public android.content.pm.ActivityInfo | getActivityInfo()Return the raw information about the receiver implementing this
device admin. Do not modify the returned object.
return mReceiver.activityInfo;
|
public android.content.ComponentName | getComponent()Return the component of the receiver that implements this device admin.
return new ComponentName(mReceiver.activityInfo.packageName,
mReceiver.activityInfo.name);
|
public java.lang.String | getPackageName()Return the .apk package that implements this device admin.
return mReceiver.activityInfo.packageName;
|
public java.lang.String | getReceiverName()Return the class name of the receiver component that implements
this device admin.
return mReceiver.activityInfo.name;
|
public java.lang.String | getTagForPolicy(int policyIdent)Return the XML tag name for the given policy identifier. Valid identifiers
are as per {@link #usesPolicy(int)}. If the given identifier is not
known, null is returned.
return sRevKnownPolicies.get(policyIdent).tag;
|
public java.util.ArrayList | getUsedPolicies()
ArrayList<PolicyInfo> res = new ArrayList<PolicyInfo>();
for (int i=0; i<sPoliciesDisplayOrder.size(); i++) {
PolicyInfo pi = sPoliciesDisplayOrder.get(i);
if (usesPolicy(pi.ident)) {
res.add(pi);
}
}
return res;
|
public boolean | isVisible()Returns whether this device admin would like to be visible to the
user, even when it is not enabled.
return mVisible;
|
public java.lang.CharSequence | loadDescription(android.content.pm.PackageManager pm)Load user-visible description associated with this device admin.
if (mReceiver.activityInfo.descriptionRes != 0) {
String packageName = mReceiver.resolvePackageName;
ApplicationInfo applicationInfo = null;
if (packageName == null) {
packageName = mReceiver.activityInfo.packageName;
applicationInfo = mReceiver.activityInfo.applicationInfo;
}
return pm.getText(packageName,
mReceiver.activityInfo.descriptionRes, applicationInfo);
}
throw new NotFoundException();
|
public android.graphics.drawable.Drawable | loadIcon(android.content.pm.PackageManager pm)Load the user-displayed icon for this device admin.
return mReceiver.loadIcon(pm);
|
public java.lang.CharSequence | loadLabel(android.content.pm.PackageManager pm)Load the user-displayed label for this device admin.
return mReceiver.loadLabel(pm);
|
public void | readPoliciesFromXml(org.xmlpull.v1.XmlPullParser parser)
mUsesPolicies = Integer.parseInt(
parser.getAttributeValue(null, "flags"));
|
public java.lang.String | toString()
return "DeviceAdminInfo{" + mReceiver.activityInfo.name + "}";
|
public boolean | usesPolicy(int policyIdent)Return true if the device admin has requested that it be able to use
the given policy control. The possible policy identifier inputs are:
{@link #USES_POLICY_LIMIT_PASSWORD}, {@link #USES_POLICY_WATCH_LOGIN},
{@link #USES_POLICY_RESET_PASSWORD}, {@link #USES_POLICY_FORCE_LOCK},
{@link #USES_POLICY_WIPE_DATA},
{@link #USES_POLICY_EXPIRE_PASSWORD}, {@link #USES_ENCRYPTED_STORAGE},
{@link #USES_POLICY_DISABLE_CAMERA}.
return (mUsesPolicies & (1<<policyIdent)) != 0;
|
public void | writePoliciesToXml(org.xmlpull.v1.XmlSerializer out)
out.attribute(null, "flags", Integer.toString(mUsesPolicies));
|
public void | writeToParcel(android.os.Parcel dest, int flags)Used to package this object into a {@link Parcel}.
mReceiver.writeToParcel(dest, flags);
dest.writeInt(mUsesPolicies);
|