From c857f90590e7d7fcffa89511982eb33afd34805f Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 15 May 2017 14:05:33 -0700 Subject: Update Dialer to v10 RC32 This release was created following the instructions at: go/dialer-aosp-release Subsequent dialer releases will follow as O bugs are fixed, until we reach our final RC. Version: 10 Candidate: RC32 Branch: dialer-android_release_branch/153304843.1 dialer-android_20170416.00/dialer-android_20170416.00_RC32 This release contains the following bug fixes since RC17: Bug: 33176679 33272455 3646510 36773894 37297649 37413780 37513689 37640315 37680595 37698062 37873639 37901752 37919295 37953423 38062852 38069600 38137349 38173549 38180252 38191514 Test: make, on device Change-Id: I4e4bb630082758e418ff24892b7db3142c6eb09a --- .../android/contacts/common/ContactPhotoManager.java | 2 +- .../common/compat/TelephonyManagerCompat.java | 3 +++ .../contacts/common/dialog/ClearFrequentsDialog.java | 2 +- .../contacts/common/list/DirectoryListLoader.java | 19 ++++++++++++++----- .../android/contacts/common/model/ContactLoader.java | 9 +++++++-- 5 files changed, 26 insertions(+), 9 deletions(-) (limited to 'java/com/android/contacts/common') diff --git a/java/com/android/contacts/common/ContactPhotoManager.java b/java/com/android/contacts/common/ContactPhotoManager.java index 652e93637..169348b25 100644 --- a/java/com/android/contacts/common/ContactPhotoManager.java +++ b/java/com/android/contacts/common/ContactPhotoManager.java @@ -191,7 +191,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { Context applicationContext = context.getApplicationContext(); sInstance = createContactPhotoManager(applicationContext); applicationContext.registerComponentCallbacks(sInstance); - if (PermissionsUtil.hasContactsPermissions(context)) { + if (PermissionsUtil.hasContactsReadPermissions(context)) { sInstance.preloadPhotosInBackground(); } } diff --git a/java/com/android/contacts/common/compat/TelephonyManagerCompat.java b/java/com/android/contacts/common/compat/TelephonyManagerCompat.java index 84002256a..7e4803ca5 100644 --- a/java/com/android/contacts/common/compat/TelephonyManagerCompat.java +++ b/java/com/android/contacts/common/compat/TelephonyManagerCompat.java @@ -41,6 +41,9 @@ public class TelephonyManagerCompat { public static final String EVENT_CALL_REMOTELY_UNHELD = "android.telecom.event.CALL_REMOTELY_UNHELD"; + public static final String EVENT_NOTIFY_INTERNATIONAL_CALL_ON_WFC = + "android.telephony.event.EVENT_NOTIFY_INTERNATIONAL_CALL_ON_WFC"; + public static final String TELEPHONY_MANAGER_CLASS = "android.telephony.TelephonyManager"; private static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE"; diff --git a/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java b/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java index e96496cda..751490a22 100644 --- a/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java +++ b/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java @@ -48,7 +48,7 @@ public class ClearFrequentsDialog extends DialogFragment { new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - if (!PermissionsUtil.hasContactsPermissions(context)) { + if (!PermissionsUtil.hasContactsReadPermissions(context)) { return; } diff --git a/java/com/android/contacts/common/list/DirectoryListLoader.java b/java/com/android/contacts/common/list/DirectoryListLoader.java index 48b098c07..be62cc7a8 100644 --- a/java/com/android/contacts/common/list/DirectoryListLoader.java +++ b/java/com/android/contacts/common/list/DirectoryListLoader.java @@ -25,9 +25,10 @@ import android.net.Uri; import android.os.Handler; import android.provider.ContactsContract.Directory; import android.text.TextUtils; -import android.util.Log; import com.android.contacts.common.R; import com.android.contacts.common.compat.DirectoryCompat; +import com.android.dialer.common.LogUtil; +import com.android.dialer.util.PermissionsUtil; /** A specialized loader for the list of directories, see {@link Directory}. */ public class DirectoryListLoader extends AsyncTaskLoader { @@ -38,7 +39,6 @@ public class DirectoryListLoader extends AsyncTaskLoader { public static final int SEARCH_MODE_DATA_SHORTCUT = 3; // This is a virtual column created for a MatrixCursor. public static final String DIRECTORY_TYPE = "directoryType"; - private static final String TAG = "ContactEntryListAdapter"; private static final String[] RESULT_PROJECTION = { Directory._ID, DIRECTORY_TYPE, Directory.DISPLAY_NAME, Directory.PHOTO_SUPPORT, }; @@ -71,7 +71,13 @@ public class DirectoryListLoader extends AsyncTaskLoader { @Override protected void onStartLoading() { - getContext().getContentResolver().registerContentObserver(DirectoryQuery.URI, false, mObserver); + if (PermissionsUtil.hasContactsReadPermissions(getContext())) { + getContext() + .getContentResolver() + .registerContentObserver(DirectoryQuery.URI, false, mObserver); + } else { + LogUtil.w("DirectoryListLoader.onStartLoading", "contacts permission not available."); + } forceLoad(); } @@ -141,7 +147,9 @@ public class DirectoryListLoader extends AsyncTaskLoader { try { directoryType = pm.getResourcesForApplication(packageName).getString(typeResourceId); } catch (Exception e) { - Log.e(TAG, "Cannot obtain directory type from package: " + packageName); + LogUtil.e( + "ContactEntryListAdapter.loadInBackground", + "cannot obtain directory type from package: " + packageName); } } String displayName = cursor.getString(DirectoryQuery.DISPLAY_NAME); @@ -149,7 +157,8 @@ public class DirectoryListLoader extends AsyncTaskLoader { result.addRow(new Object[] {directoryId, directoryType, displayName, photoSupport}); } } catch (RuntimeException e) { - Log.w(TAG, "Runtime Exception when querying directory"); + LogUtil.w( + "ContactEntryListAdapter.loadInBackground", "runtime exception when querying directory"); } finally { if (cursor != null) { cursor.close(); diff --git a/java/com/android/contacts/common/model/ContactLoader.java b/java/com/android/contacts/common/model/ContactLoader.java index 8e9ef9429..55464b161 100644 --- a/java/com/android/contacts/common/model/ContactLoader.java +++ b/java/com/android/contacts/common/model/ContactLoader.java @@ -47,6 +47,7 @@ import com.android.contacts.common.util.ContactLoaderUtils; import com.android.contacts.common.util.UriUtils; import com.android.dialer.common.LogUtil; import com.android.dialer.location.GeoUtil; +import com.android.dialer.util.PermissionsUtil; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -688,11 +689,15 @@ public class ContactLoader extends AsyncTaskLoader { mLookupUri = result.getLookupUri(); if (!result.isDirectoryEntry()) { - LogUtil.i(TAG, "Registering content observer for " + mLookupUri); if (mObserver == null) { mObserver = new ForceLoadContentObserver(); } - getContext().getContentResolver().registerContentObserver(mLookupUri, true, mObserver); + + if (PermissionsUtil.hasContactsReadPermissions(getContext())) { + getContext().getContentResolver().registerContentObserver(mLookupUri, true, mObserver); + } else { + LogUtil.w("ContactLoader.deliverResult", "contacts permission not available"); + } } if (mPostViewNotification) { -- cgit v1.2.3