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

Commit 86c27c03 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Fully migrate tv to notification permission

All tv apps have the permission granted from ag/1733876, so the notification
system should be checking the permission state when notifications are
posted rather than the legacy system.

Test: make and flash, NotificationManagerTest
Fixes: 230769971
Change-Id: I013fb27f4324138690a0e2125c04e08ded86f94c
parent a7a36d96
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -55,10 +55,8 @@ public final class PermissionHelper {
    private final PermissionManagerServiceInternal mPmi;
    private final IPackageManager mPackageManager;
    private final IPermissionManager mPermManager;
    // TODO (b/194833441): Remove this boolean (but keep the isMigrationEnabled() method)
    //  when the migration is enabled
    // TODO (b/194833441): Remove when the migration is enabled
    private final boolean mMigrationEnabled;
    private final boolean mIsTv;
    private final boolean mForceUserSetOnUpgrade;

    public PermissionHelper(PermissionManagerServiceInternal pmi, IPackageManager packageManager,
@@ -69,17 +67,10 @@ public final class PermissionHelper {
        mPermManager = permManager;
        mMigrationEnabled = migrationEnabled;
        mForceUserSetOnUpgrade = forceUserSetOnUpgrade;
        boolean isTv;
        try {
            isTv = mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK, 0);
        } catch (RemoteException e) {
            isTv = false;
        }
        mIsTv = isTv;
    }

    public boolean isMigrationEnabled() {
        return mMigrationEnabled && !mIsTv;
        return mMigrationEnabled;
    }

    /**