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

Commit dc750e26 authored by Guojing Yuan's avatar Guojing Yuan
Browse files

[CDM] Move exemption logic to onUserUnlocked

getSharedPreferences requires the user unlocked.

Bug: 407947267
Flag: EXEMPT bugfix
Test: CTS
Change-Id: I1f9eb9fe5c90de9b7a396f2994a3bfa43cd07867
parent 2779a36f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -231,8 +231,6 @@ public class CompanionDeviceManagerService extends SystemService {
        if (associations.isEmpty()) return;

        mCompanionExemptionProcessor.updateAtm(userId, associations);
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.execute(mCompanionExemptionProcessor::updateAutoRevokeExemptions);
    }

    @Override
@@ -240,6 +238,9 @@ public class CompanionDeviceManagerService extends SystemService {
        Slog.i(TAG, "onUserUnlocked() user=" + user);
        // Notify and bind the app after the phone is unlocked.
        mDevicePresenceProcessor.sendDevicePresenceEventOnUnlocked(user.getUserIdentifier());

        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.execute(mCompanionExemptionProcessor::updateAutoRevokeExemptions);
    }

    private void onPackageRemoveOrDataClearedInternal(