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

Commit 63a6b714 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Do not use ResourceId@NULL in permission controller

The value of this is 0 (and always will be). Hence no need to use
internal API

Bug: 110953302
Test: Built
Change-Id: Ic34db341eca927c615dd6a6d243584f765b9c71f
parent 6ee5090f
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.content.res.ResourceId;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
@@ -420,13 +419,13 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     *
     * @param info The package item info to extract the message from
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    private static @StringRes int getRequestDetail(PackageItemInfo info) {
        if (info instanceof PermissionGroupInfo) {
            return ((PermissionGroupInfo) info).requestDetailResourceId;
        } else {
            return ResourceId.ID_NULL;
            return 0;
        }
    }

@@ -434,7 +433,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     * Get the (subtitle) message explaining to the user that the permission is only granted to
     * the apps running in the foreground.
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    public @StringRes int getRequestDetail() {
        return mRequestDetail;
@@ -446,13 +445,13 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     *
     * @param info The package item info to extract the message from
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    private static @StringRes int getBackgroundRequest(PackageItemInfo info) {
        if (info instanceof PermissionGroupInfo) {
            return ((PermissionGroupInfo) info).backgroundRequestResourceId;
        } else {
            return ResourceId.ID_NULL;
            return 0;
        }
    }

@@ -460,7 +459,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     * Get the title of the dialog explaining to the user that the permission is granted while
     * the app is in background and in foreground.
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    public @StringRes int getBackgroundRequest() {
        return mBackgroundRequest;
@@ -472,13 +471,13 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     *
     * @param info The package item info to extract the message from
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    private static @StringRes int getBackgroundRequestDetail(PackageItemInfo info) {
        if (info instanceof PermissionGroupInfo) {
            return ((PermissionGroupInfo) info).backgroundRequestDetailResourceId;
        } else {
            return ResourceId.ID_NULL;
            return 0;
        }
    }

@@ -486,7 +485,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
     * Get the (subtitle) message explaining to the user that the she/he is about to allow the
     * app to have background access.
     *
     * @return the message of {@link ResourceId#ID_NULL} if unset
     * @return the message or 0 if unset
     */
    public @StringRes int getBackgroundRequestDetail() {
        return mBackgroundRequestDetail;