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

Commit 7e25f5cb authored by Daniel Lehmann's avatar Daniel Lehmann
Browse files

Make the VCardEntry more robust against badly behaving resolvers. Additionally...

Make the VCardEntry more robust against badly behaving resolvers. Additionally make the ImportTestResolver return the right result
Bug:2521447

Change-Id: I39e3e686b1fd75f5e633a467f6ccb736751355ed
parent eccb394c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1290,8 +1290,11 @@ public class VCardEntry {
            ContentProviderResult[] results = resolver.applyBatch(
                        ContactsContract.AUTHORITY, operationList);
            // the first result is always the raw_contact. return it's uri so
            // that it can be found later
            return results[0].uri;
            // that it can be found later. do null checking for badly behaving
            // ContentResolvers
            return (results == null || results.length == 0 || results[0] == null)
                ? null
                : results[0].uri;
        } catch (RemoteException e) {
            Log.e(LOG_TAG, String.format("%s: %s", e.toString(), e.getMessage()));
            return null;
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ import java.util.Map.Entry;
                mTestCase.fail("Unexpected Uri has come: " + uri);
            }
        }  // for (int i = 0; i < size; i++) {
        return null;
        return fakeResultArray;
    }

    public void verify() {