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

Commit 44179f0a authored by Paul Soulos's avatar Paul Soulos Committed by Android Git Automerger
Browse files

am 20bdf9d2: Fixes crash in clicking entries without intent uri

* commit '20bdf9d2':
  Fixes crash in clicking entries without intent uri
parents 6e74eecb 20bdf9d2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -290,20 +290,21 @@ public class QuickContactActivity extends ContactsActivity {
            // so the exact usage type is not necessary in all cases
            String usageType = DataUsageFeedback.USAGE_TYPE_CALL;

            final String scheme = intent.getData().getScheme();
            if ((scheme != null && scheme.equals(CallUtil.SCHEME_SMSTO)) ||
            final Uri intentUri = intent.getData();
            if ((intentUri != null && intentUri.getScheme() != null &&
                    intentUri.getScheme().equals(CallUtil.SCHEME_SMSTO)) ||
                    (intent.getType() != null && intent.getType().equals(MIMETYPE_SMS))) {
                usageType = DataUsageFeedback.USAGE_TYPE_SHORT_TEXT;
            }

            // Data IDs start at 1 so anything less is invalid
            if (dataId > 0) {
                final Uri uri = DataUsageFeedback.FEEDBACK_URI.buildUpon()
                final Uri dataUsageUri = DataUsageFeedback.FEEDBACK_URI.buildUpon()
                        .appendPath(String.valueOf(dataId))
                        .appendQueryParameter(DataUsageFeedback.USAGE_TYPE, usageType)
                        .build();
                final boolean successful = getContentResolver().update(
                        uri, new ContentValues(), null, null) > 0;
                        dataUsageUri, new ContentValues(), null, null) > 0;
                if (!successful) {
                    Log.w(TAG, "DataUsageFeedback increment failed");
                }