We should show custom title for suspend app dialog

am: 706fbe7ed3

Change-Id: I59ca1b40ad78d6760724ea8d5297fe5cdccafc50
This commit is contained in:
Tony Mak
2018-04-04 03:51:20 -07:00
committed by android-build-merger
2 changed files with 11 additions and 0 deletions

View File

@@ -1172,6 +1172,13 @@ public class DevicePolicyManager {
*/
public static final String POLICY_MANDATORY_BACKUPS = "policy_mandatory_backups";
/**
* Constant to indicate the feature of suspending app. Use it as the value of
* {@link #EXTRA_RESTRICTION}.
* @hide
*/
public static final String POLICY_SUSPEND_PACKAGES = "policy_suspend_packages";
/**
* A String indicating a specific restricted feature. Can be a user restriction from the
* {@link UserManager}, e.g. {@link UserManager#DISALLOW_ADJUST_VOLUME}, or one of the values

View File

@@ -21,6 +21,8 @@ import static android.app.ActivityOptions.ANIM_OPEN_CROSS_PROFILE_APPS;
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.app.PendingIntent.FLAG_ONE_SHOT;
import static android.app.admin.DevicePolicyManager.EXTRA_RESTRICTION;
import static android.app.admin.DevicePolicyManager.POLICY_SUSPEND_PACKAGES;
import static android.content.Context.KEYGUARD_SERVICE;
import static android.content.Intent.EXTRA_INTENT;
import static android.content.Intent.EXTRA_PACKAGE_NAME;
@@ -214,6 +216,8 @@ class ActivityStartInterceptor {
return false;
}
mIntent = devicePolicyManager.createShowAdminSupportIntent(mUserId, true);
mIntent.putExtra(EXTRA_RESTRICTION, POLICY_SUSPEND_PACKAGES);
mCallingPid = mRealCallingPid;
mCallingUid = mRealCallingUid;
mResolvedType = null;