diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-11-12 00:55:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-12 00:55:34 +0000 |
commit | 2b52d2a3cdcb0ac00d87d2c2cbd1d6b750ea036d (patch) | |
tree | c87ae220455edeac1c6fb5b12e033e37a07c9ed4 /java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java | |
parent | 5e20ba7b1c6a9644da034b345000b37856d78125 (diff) | |
parent | b7dba5aaa8c477d97121fc6e3411332e66cbabe8 (diff) |
Merge changes I0ed4fa1b,Ie03ce41e,If41868df,Iba2e9092
* changes:
Expose tab index to protected
Added temporary logging to debug problem with null phone numbers from remote contacts.
Hook up pre-call actions
Implement CallingAccountSelector and AssistedDialAction
Diffstat (limited to 'java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java b/java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java index de71025cd..3d16c4351 100644 --- a/java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java +++ b/java/com/android/dialer/searchfragment/remote/RemoteDirectoriesCursorLoader.java @@ -36,12 +36,14 @@ public final class RemoteDirectoriesCursorLoader extends CursorLoader { private static final int DISPLAY_NAME = 1; private static final int PHOTO_SUPPORT = 2; + private static final int AUTHORITY = 3; @VisibleForTesting static final String[] PROJECTION = { ContactsContract.Directory._ID, ContactsContract.Directory.DISPLAY_NAME, ContactsContract.Directory.PHOTO_SUPPORT, + ContactsContract.Directory.DIRECTORY_AUTHORITY, }; public RemoteDirectoriesCursorLoader(Context context) { @@ -51,7 +53,10 @@ public final class RemoteDirectoriesCursorLoader extends CursorLoader { /** @return current cursor row represented as a {@link Directory}. */ public static Directory readDirectory(Cursor cursor) { return Directory.create( - cursor.getInt(ID), cursor.getString(DISPLAY_NAME), cursor.getInt(PHOTO_SUPPORT) != 0); + cursor.getInt(ID), + cursor.getString(DISPLAY_NAME), + cursor.getInt(PHOTO_SUPPORT) != 0, + cursor.getString(AUTHORITY)); } private static Uri getContentUri() { @@ -63,8 +68,14 @@ public final class RemoteDirectoriesCursorLoader extends CursorLoader { /** POJO representing the results returned from {@link RemoteDirectoriesCursorLoader}. */ @AutoValue public abstract static class Directory { + public static Directory create( + int id, @Nullable String displayName, boolean supportsPhotos, @Nullable String authority) { + return new AutoValue_RemoteDirectoriesCursorLoader_Directory( + id, displayName, supportsPhotos, authority); + } + public static Directory create(int id, @Nullable String displayName, boolean supportsPhotos) { - return new AutoValue_RemoteDirectoriesCursorLoader_Directory(id, displayName, supportsPhotos); + return create(id, displayName, supportsPhotos, null); } public abstract int getId(); @@ -73,5 +84,7 @@ public final class RemoteDirectoriesCursorLoader extends CursorLoader { abstract @Nullable String getDisplayName(); abstract boolean supportsPhotos(); + + abstract @Nullable String authority(); } } |