mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
59bf3b75c7
https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/353117 https://review.lineageos.org/q/topic:Q_asb_2023-03 https://review.lineageos.org/q/topic:Q_asb_2023-04 https://review.lineageos.org/q/topic:Q_asb_2023-05 https://review.lineageos.org/q/topic:Q_asb_2023-06 https://review.lineageos.org/q/topic:Q_asb_2023-07 https://review.lineageos.org/q/topic:Q_asb_2023-08 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376560 https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376561 https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376562 https://review.lineageos.org/q/topic:Q_asb_2023-09 https://review.lineageos.org/q/topic:Q_asb_2023-10 https://review.lineageos.org/q/topic:Q_asb_2023-11 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376563 accounted for via manifest change: https://review.lineageos.org/c/LineageOS/android_external_webp/+/376568 https://review.lineageos.org/q/topic:Q_asb_2023-12 https://review.lineageos.org/q/topic:Q_asb_2024-01 https://review.lineageos.org/q/topic:Q_asb_2024-02 https://review.lineageos.org/q/topic:Q_asb_2024-03 Signed-off-by: Tavi <tavi@divested.dev>
69 lines
3.0 KiB
Diff
69 lines
3.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Chinmay Dhodapkar <chinmayd@google.com>
|
|
Date: Sun, 4 Dec 2022 09:46:34 -0800
|
|
Subject: [PATCH] DO NOT MERGE do not process content uri in call Intents
|
|
|
|
Add checks in Telecom so content uris are not processed
|
|
|
|
Bug: 257030107
|
|
Test: atest NewOutgoingCallIntentBroadcasterTest
|
|
Test: adb shell am start -a android.intent.action.CALL -d tel:xxx
|
|
Change-Id: Ic2c3014cecfd5db84dc2023b4c247d96ad1c3414
|
|
Merged-In: Ic2c3014cecfd5db84dc2023b4c247d96ad1c3414
|
|
(cherry picked from commit 9636518478fb887dd1834c0433eb3a71eb72faaf)
|
|
Merged-In: Ic2c3014cecfd5db84dc2023b4c247d96ad1c3414
|
|
---
|
|
.../telecom/NewOutgoingCallIntentBroadcaster.java | 14 ++++++++++++--
|
|
.../NewOutgoingCallIntentBroadcasterTest.java | 13 +++++++++++++
|
|
2 files changed, 25 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java b/src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java
|
|
index 7a641af3c..960be80a3 100644
|
|
--- a/src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java
|
|
+++ b/src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java
|
|
@@ -313,8 +313,18 @@ public class NewOutgoingCallIntentBroadcaster {
|
|
}
|
|
|
|
private String getNumberFromCallIntent(Intent intent) {
|
|
- String number;
|
|
- number = mPhoneNumberUtilsAdapter.getNumberFromIntent(intent, mContext);
|
|
+ String number = null;
|
|
+
|
|
+ Uri uri = intent.getData();
|
|
+ if (uri != null) {
|
|
+ String scheme = uri.getScheme();
|
|
+ if (scheme != null) {
|
|
+ if (scheme.equals("tel") || scheme.equals("sip")) {
|
|
+ number = uri.getSchemeSpecificPart();
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
if (TextUtils.isEmpty(number)) {
|
|
Log.w(this, "Empty number obtained from the call intent.");
|
|
return null;
|
|
diff --git a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
|
|
index 81b43265f..b618bba1e 100644
|
|
--- a/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
|
|
+++ b/tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java
|
|
@@ -186,6 +186,19 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {
|
|
verifyNoCallPlaced();
|
|
}
|
|
|
|
+ @Test
|
|
+ public void testNoCallsPlacedWithContentUri() {
|
|
+ Uri handle = Uri.parse("content://com.android.contacts/data/1");
|
|
+ Intent intent = new Intent(Intent.ACTION_CALL, handle);
|
|
+
|
|
+ int result = processIntent(intent, true).disconnectCause;
|
|
+
|
|
+ assertEquals(DisconnectCause.NO_PHONE_NUMBER_SUPPLIED, result);
|
|
+ verify(mContext, never()).getContentResolver();
|
|
+ verifyNoBroadcastSent();
|
|
+ verifyNoCallPlaced();
|
|
+ }
|
|
+
|
|
@SmallTest
|
|
@Test
|
|
public void testEmergencyCallWithNonDefaultDialer() {
|