Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcca8a83 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

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
parent 2b204642
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)