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

Commit 69934738 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Fix bug 6479405 On tablet, sometimes, QC -> full contact..." into jb-dev

parents 0a660fe0 e1cc78a9
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -226,10 +226,11 @@ public class ContactLoader extends AsyncTaskLoader<ContactLoader.Result> {
            mIsUserProfile = isUserProfile;
        }

        private Result(Result from) {
        private Result(Uri requestedUri, Result from) {
            mRequestedUri = requestedUri;

            mStatus = from.mStatus;
            mException = from.mException;
            mRequestedUri = from.mRequestedUri;
            mLookupUri = from.mLookupUri;
            mUri = from.mUri;
            mDirectoryId = from.mDirectoryId;
@@ -520,6 +521,12 @@ public class ContactLoader extends AsyncTaskLoader<ContactLoader.Result> {
        public boolean isUserProfile() {
            return mIsUserProfile;
        }

        @Override
        public String toString() {
            return "{requested=" + mRequestedUri + ",lookupkey=" + mLookupKey +
                    ",uri=" + mUri + ",status=" + mStatus + "}";
        }
    }

    /**
@@ -730,13 +737,13 @@ public class ContactLoader extends AsyncTaskLoader<ContactLoader.Result> {
                    UriUtils.areEqual(cachedResult.getLookupUri(), mLookupUri)) {
                // We are using a cached result from earlier. Below, we should make sure
                // we are not doing any more network or disc accesses
                result = cachedResult;
                result = new Result(mRequestedUri, cachedResult);
                resultIsCached = true;
            } else {
                result = loadContactEntity(resolver, uriCurrentFormat);
                resultIsCached = false;
            }
            if (!result.isNotFound()) {
            if (result.isLoaded()) {
                if (result.isDirectoryEntry()) {
                    if (!resultIsCached) {
                        loadDirectoryMetaData(result);
@@ -1345,10 +1352,10 @@ public class ContactLoader extends AsyncTaskLoader<ContactLoader.Result> {
     * contact. If the next load is for a different contact, the cached result will be dropped
     */
    public void cacheResult() {
        if (mContact == null) {
        if (mContact == null || !mContact.isLoaded()) {
            sCachedResult = null;
        } else {
            sCachedResult = new Result(mContact);
            sCachedResult = mContact;
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ public class ContactLoaderFragment extends Fragment implements FragmentKeyListen
        @Override
        public void onLoadFinished(Loader<ContactLoader.Result> loader, ContactLoader.Result data) {
            if (!mLookupUri.equals(data.getRequestedUri())) {
                Log.e(TAG, "Different URI: requested=" + mLookupUri + "  actual=" + data);
                return;
            }