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

Commit 016b8efa authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Fully reload recent interaction data after resume"

parents d3e099a7 8a4a9fa1
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -941,16 +941,21 @@ public class QuickContactActivity extends ContactsActivity {
        } else if (oldLookupUri != mLookupUri) {
            // After copying a directory contact, the contact URI changes. Therefore,
            // we need to restart the loader and reload the new contact.
            for (int interactionLoaderId : mRecentLoaderIds) {
                getLoaderManager().destroyLoader(interactionLoaderId);
            }
            destroyInteractionLoaders();
            mContactLoader = (ContactLoader) getLoaderManager().restartLoader(
                    LOADER_CONTACT_ID, null, mLoaderContactCallbacks);
            mCachedCp2DataCardModel = null;
        }

        NfcHandler.register(this, mLookupUri);
    }

    private void destroyInteractionLoaders() {
        for (int interactionLoaderId : mRecentLoaderIds) {
            getLoaderManager().destroyLoader(interactionLoaderId);
        }
    }

    private void runEntranceAnimation() {
        if (mHasAlreadyBeenOpened) {
            return;
@@ -1131,6 +1136,13 @@ public class QuickContactActivity extends ContactsActivity {
        if (mContactCard != null) {
            mContactCard.isFireWallInstalled(isFireWallInstalled);
        }
        // When exiting the activity and resuming, we want to force a full reload of all the
        // interaction data in case something changed in the background. On screen rotation,
        // we don't need to do this. And, mCachedCp2DataCardModel will be null, so we won't.
        if (mCachedCp2DataCardModel != null) {
            destroyInteractionLoaders();
            startInteractionLoaders(mCachedCp2DataCardModel);
        }
    }

    private void populateContactAndAboutCard(Cp2DataCardModel cp2DataCardModel) {