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

Commit f600f07e authored by Ricky Wai's avatar Ricky Wai
Browse files

Fix enterprise contacts APIs naming and docs

Bug: 28295752
Change-Id: Ie6e9e82c7560a08c08ed730b68a4be17c7241a47
parent 3991d45a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -39,9 +39,9 @@ public class DirectoryCompat {
        return directoryId == Directory.LOCAL_INVISIBLE;
    }

    public static boolean isRemoteDirectory(long directoryId) {
    public static boolean isRemoteDirectoryId(long directoryId) {
        if (ContactsUtils.FLAG_N_FEATURE) {
            return DirectorySdkCompat.isRemoteDirectory(directoryId);
            return DirectorySdkCompat.isRemoteDirectoryId(directoryId);
        }
        return !(directoryId == Directory.DEFAULT || directoryId == Directory.LOCAL_INVISIBLE);
    }
+2 −2
Original line number Diff line number Diff line
@@ -419,7 +419,7 @@ public abstract class ContactEntryListAdapter extends IndexerListAdapter {
            if (getPartitionByDirectoryId(id) == -1) {
                DirectoryPartition partition = new DirectoryPartition(false, true);
                partition.setDirectoryId(id);
                if (DirectoryCompat.isRemoteDirectory(id)) {
                if (DirectoryCompat.isRemoteDirectoryId(id)) {
                    if (DirectoryCompat.isEnterpriseDirectoryId(id)) {
                        partition.setLabel(mContext.getString(R.string.directory_search_label_work));
                    } else {
@@ -642,7 +642,7 @@ public abstract class ContactEntryListAdapter extends IndexerListAdapter {
        TextView labelTextView = (TextView)view.findViewById(R.id.label);
        TextView displayNameTextView = (TextView)view.findViewById(R.id.display_name);
        labelTextView.setText(directoryPartition.getLabel());
        if (!DirectoryCompat.isRemoteDirectory(directoryId)) {
        if (!DirectoryCompat.isRemoteDirectoryId(directoryId)) {
            displayNameTextView.setText(null);
        } else {
            String directoryName = directoryPartition.getDisplayName();
+4 −3
Original line number Diff line number Diff line
@@ -211,7 +211,8 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter {
            loader.setUri(builder.build());
            loader.setProjection(PhoneQuery.PROJECTION_PRIMARY);
        } else {
            final boolean isRemoteDirectoryQuery = DirectoryCompat.isRemoteDirectory(directoryId);
            final boolean isRemoteDirectoryQuery
                    = DirectoryCompat.isRemoteDirectoryId(directoryId);
            final Builder builder;
            if (isSearchMode()) {
                final Uri baseUri;
@@ -342,7 +343,7 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter {
    public Uri getDataUri(int partitionIndex, Cursor cursor) {
        final long directoryId =
                ((DirectoryPartition)getPartition(partitionIndex)).getDirectoryId();
        if (DirectoryCompat.isRemoteDirectory(directoryId)) {
        if (DirectoryCompat.isRemoteDirectoryId(directoryId)) {
            return null;
        } else if (DirectoryCompat.isEnterpriseDirectoryId(directoryId)) {
            /*
@@ -609,7 +610,7 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter {
                if (id > maxId) {
                    maxId = id;
                }
                if (!DirectoryCompat.isRemoteDirectory(id)) {
                if (!DirectoryCompat.isRemoteDirectoryId(id)) {
                    // assuming remote directories come after local, we will end up with the index
                    // where we should insert extended directories. This also works if there are no
                    // remote directories at all.