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

Commit 9881882e authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Catch WRITE_CONTACTS SecurityExceptions

Fix crash when app lacks WRITE_CONTACTS and we fail in attempt to update
interaction counts.

Bug:22405683
Change-Id: I53a10b8907e88fe75296bcfaf4659d7f358875d8
parent 551df337
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -382,11 +382,15 @@ public class QuickContactActivity extends ContactsActivity {
                        .appendPath(String.valueOf(dataId))
                        .appendQueryParameter(DataUsageFeedback.USAGE_TYPE, usageType)
                        .build();
                try {
                    final boolean successful = getContentResolver().update(
                            dataUsageUri, new ContentValues(), null, null) > 0;
                    if (!successful) {
                        Log.w(TAG, "DataUsageFeedback increment failed");
                    }
                } catch (SecurityException ex) {
                    Log.w(TAG, "DataUsageFeedback increment failed", ex);
                }
            } else {
                Log.w(TAG, "Invalid Data ID");
            }