diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-02-15 18:08:21 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-02-15 18:08:21 +0000 |
commit | c54ce2658988ca36ca3dfab00daefca4dcfed3b2 (patch) | |
tree | fb432a423f670969da57a4900b5ff7dcc35d2f8c /java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java | |
parent | 70f98d3997c42c7d4e3b3e3920659aca78820d14 (diff) | |
parent | 39009b4ad73d5017295b30fb18a77224195f06af (diff) |
Merge changes Ib360d3bc,Iae40d0ab,I486f7b1a,I709a1e30
* changes:
Mark calls as read in new call log.
Restored work profile contacts to Dialer search.
Clicking on a missed call in the call log no longer crashes the app.
Add bottom sheet options for blocked and/or spam numbers in the new call log.
Diffstat (limited to 'java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java index 9feeb7e99..cf495e49c 100644 --- a/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/remote/RemoteContactsCursorLoader.java @@ -27,6 +27,7 @@ import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; +import com.android.contacts.common.compat.DirectoryCompat; import com.android.dialer.searchfragment.common.Projections; import com.android.dialer.searchfragment.directories.DirectoriesCursorLoader.Directory; import java.util.ArrayList; @@ -71,7 +72,14 @@ public final class RemoteContactsCursorLoader extends CursorLoader { Directory directory = directories.get(i); // Filter out local directories - if (!isRemoteDirectory(directory.getId())) { + if (!DirectoryCompat.isRemoteDirectoryId(directory.getId()) + && !DirectoryCompat.isEnterpriseDirectoryId(directory.getId())) { + cursors[i] = null; + continue; + } + + // Filter out invisible directories + if (DirectoryCompat.isInvisibleDirectory(directory.getId())) { cursors[i] = null; continue; } @@ -93,17 +101,6 @@ public final class RemoteContactsCursorLoader extends CursorLoader { return RemoteContactsCursor.newInstance(getContext(), cursors, directories); } - private static boolean isRemoteDirectory(long directoryId) { - return VERSION.SDK_INT >= VERSION_CODES.N - ? ContactsContract.Directory.isRemoteDirectoryId(directoryId) - : (directoryId != ContactsContract.Directory.DEFAULT - && directoryId != ContactsContract.Directory.LOCAL_INVISIBLE - // Directory.ENTERPRISE_DEFAULT is the default work profile directory for locally stored - // contacts - && directoryId != ContactsContract.Directory.ENTERPRISE_DEFAULT - && directoryId != ContactsContract.Directory.ENTERPRISE_LOCAL_INVISIBLE); - } - private MatrixCursor createMatrixCursorFilteringNullNumbers(Cursor cursor) { if (cursor == null) { return null; |