summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Suprabh Shukla <suprabh@google.com> 2019-11-25 15:19:07 -0800
committer Suprabh Shukla <suprabh@google.com> 2019-11-25 15:26:43 -0800
commitfcca8a83823b67646a6dab8464ff974cce4ea61c (patch)
tree6bdeceaac87210dc613d244d29e0a555f43ff277
parent2b20464232d866dd58bbd477160a1362929aa7c1 (diff)
Resolve boot unaware for suspension details activity
The neutral button starting ACTION_SHOW_SUSPENDED_APP_DETAILS should still be shown when the profile is locked. The user will be directed to unlock if they choose to start the activity. Test: Manual, on a device with a wellbeing app: 1. Create a managed profile with a secure lock. 2. Suspend any app using the wellbeing app. 3. Reboot. 4. Without unlocking the profile, tap the suspended app's launcher icon. 5. A neutral button should be shown. 6. Tapping on the neutral button should redirect the user to a lock screen. Bug: 144837297 Change-Id: Ifa1d71d2e540a3d6df5bd9f429eb433be14c3024
-rw-r--r--core/java/com/android/internal/app/SuspendedAppActivity.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/com/android/internal/app/SuspendedAppActivity.java b/core/java/com/android/internal/app/SuspendedAppActivity.java
index 712774a12cdf..33b2113b0674 100644
--- a/core/java/com/android/internal/app/SuspendedAppActivity.java
+++ b/core/java/com/android/internal/app/SuspendedAppActivity.java
@@ -16,6 +16,8 @@
package com.android.internal.app;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static android.content.res.Resources.ID_NULL;
import android.Manifest;
@@ -64,7 +66,8 @@ public class SuspendedAppActivity extends AlertActivity
final Intent moreDetailsIntent = new Intent(Intent.ACTION_SHOW_SUSPENDED_APP_DETAILS)
.setPackage(suspendingPackage);
final String requiredPermission = Manifest.permission.SEND_SHOW_SUSPENDED_APP_DETAILS;
- final ResolveInfo resolvedInfo = mPm.resolveActivityAsUser(moreDetailsIntent, 0, userId);
+ final ResolveInfo resolvedInfo = mPm.resolveActivityAsUser(moreDetailsIntent,
+ MATCH_DIRECT_BOOT_UNAWARE | MATCH_DIRECT_BOOT_AWARE, userId);
if (resolvedInfo != null && resolvedInfo.activityInfo != null
&& requiredPermission.equals(resolvedInfo.activityInfo.permission)) {
moreDetailsIntent.putExtra(Intent.EXTRA_PACKAGE_NAME, suspendedPackage)