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

Commit e22fb382 authored by Holly Jiuyu Sun's avatar Holly Jiuyu Sun
Browse files

Check EuiccMan#isEnabled earlier before getting euiccController.

Bug: 133880261
Bug: 131695762
Test: WIP
Change-Id: I7f6d494aa22065c09cc29b23a07a3262fe7067b7
parent 13ff2eb1
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -699,6 +699,13 @@ public class SubscriptionInfoUpdater extends Handler {
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    public void updateEmbeddedSubscriptions(List<Integer> cardIds,
            @Nullable UpdateEmbeddedSubsCallback callback) {
        // Do nothing if eUICCs are disabled. (Previous entries may remain in the cache, but they
        // are filtered out of list calls as long as EuiccManager.isEnabled returns false).
        if (!mEuiccManager.isEnabled()) {
            callback.run(false /* hasChanges */);
            return;
        }

        mBackgroundHandler.post(() -> {
            List<GetEuiccProfileInfoListResult> results = new ArrayList<>();
            for (int cardId : cardIds) {
@@ -735,11 +742,6 @@ public class SubscriptionInfoUpdater extends Handler {
     */
    private boolean updateEmbeddedSubscriptionsCache(GetEuiccProfileInfoListResult result) {
        if (DBG) logd("updateEmbeddedSubscriptionsCache");
        // Do nothing if eUICCs are disabled. (Previous entries may remain in the cache, but they
        // are filtered out of list calls as long as EuiccManager.isEnabled returns false).
        if (!mEuiccManager.isEnabled()) {
            return false;
        }

        if (result == null) {
            // IPC to the eUICC controller failed.