diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-09-19 11:54:48 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-09-19 11:54:48 +0800 |
commit | fa2ea33ccda587004d5fbd8af51dd7d8eec09c33 (patch) | |
tree | 8f12f7d3e33ec0c3e42cc1e624d26006628aae2e | |
parent | ee1bef99f7cb8e070330978d607a4cf24ebd5c7f (diff) | |
parent | efe5279c804c37cb0fd9dd2833cb222be17225a4 (diff) |
Merge tag 'LA.QSSI.13.0.r1-11500.01-qssi.0' into tachibana-mr1tachibana-mr1
"LA.QSSI.13.0.r1-11500.01-qssi.0"
Change-Id: I3b40cf53b6a98cff44ef969b65f38207ef11e6d3
4 files changed, 49 insertions, 0 deletions
diff --git a/src/com/android/phone/CdmaCallForwardOptions.java b/src/com/android/phone/CdmaCallForwardOptions.java index 1769fb6e51..57635a856e 100644 --- a/src/com/android/phone/CdmaCallForwardOptions.java +++ b/src/com/android/phone/CdmaCallForwardOptions.java @@ -17,10 +17,13 @@ package com.android.phone; import android.app.ActionBar; +import android.content.ContentProvider; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.os.PersistableBundle; +import android.os.Process; +import android.os.UserHandle; import android.preference.Preference; import android.preference.PreferenceScreen; import android.telephony.CarrierConfigManager; @@ -218,6 +221,15 @@ public class CdmaCallForwardOptions extends TimeConsumingPreferenceActivity { } Cursor cursor = null; try { + // check if the URI returned by the user belongs to the user + final int currentUser = UserHandle.getUserId(Process.myUid()); + if (currentUser + != ContentProvider.getUserIdFromUri(data.getData(), currentUser)) { + + Log.w(LOG_TAG, "onActivityResult: Contact data of different user, " + + "cannot access"); + return; + } cursor = getContentResolver().query(data.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { diff --git a/src/com/android/phone/GsmUmtsCallForwardOptions.java b/src/com/android/phone/GsmUmtsCallForwardOptions.java index 420d615795..9aa6ab7fe8 100644 --- a/src/com/android/phone/GsmUmtsCallForwardOptions.java +++ b/src/com/android/phone/GsmUmtsCallForwardOptions.java @@ -4,6 +4,7 @@ import android.app.ActionBar; import android.app.AlertDialog; import android.app.Dialog; import android.content.BroadcastReceiver; +import android.content.ContentProvider; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -14,7 +15,9 @@ import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.os.PersistableBundle; +import android.os.Process; import android.os.SystemProperties; +import android.os.UserHandle; import android.preference.Preference; import android.preference.PreferenceScreen; import android.provider.Settings; @@ -519,6 +522,15 @@ public class GsmUmtsCallForwardOptions extends TimeConsumingPreferenceActivity } Cursor cursor = null; try { + // check if the URI returned by the user belongs to the user + final int currentUser = UserHandle.getUserId(Process.myUid()); + if (currentUser + != ContentProvider.getUserIdFromUri(data.getData(), currentUser)) { + + Log.w(LOG_TAG, "onActivityResult: Contact data of different user, " + + "cannot access"); + return; + } cursor = getContentResolver().query(data.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { diff --git a/src/com/android/phone/settings/VoicemailSettingsActivity.java b/src/com/android/phone/settings/VoicemailSettingsActivity.java index 02bf4b25d8..c940748a35 100644 --- a/src/com/android/phone/settings/VoicemailSettingsActivity.java +++ b/src/com/android/phone/settings/VoicemailSettingsActivity.java @@ -17,6 +17,7 @@ package com.android.phone.settings; import android.app.Dialog; +import android.content.ContentProvider; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; @@ -25,6 +26,8 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.PersistableBundle; +import android.os.Process; +import android.os.UserHandle; import android.os.UserManager; import android.preference.Preference; import android.preference.PreferenceActivity; @@ -520,6 +523,17 @@ public class VoicemailSettingsActivity extends PreferenceActivity Cursor cursor = null; try { + // check if the URI returned by the user belongs to the user + final int currentUser = UserHandle.getUserId(Process.myUid()); + if (currentUser + != ContentProvider.getUserIdFromUri(data.getData(), currentUser)) { + + if (DBG) { + log("onActivityResult: Contact data of different user, " + + "cannot access"); + } + return; + } cursor = getContentResolver().query(data.getData(), new String[] { CommonDataKinds.Phone.NUMBER }, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { diff --git a/src/com/android/phone/settings/fdn/EditFdnContactScreen.java b/src/com/android/phone/settings/fdn/EditFdnContactScreen.java index c7ffde6218..98d8652720 100644 --- a/src/com/android/phone/settings/fdn/EditFdnContactScreen.java +++ b/src/com/android/phone/settings/fdn/EditFdnContactScreen.java @@ -19,6 +19,7 @@ package com.android.phone.settings.fdn; import static android.app.Activity.RESULT_OK; +import android.content.ContentProvider; import android.content.ContentValues; import android.content.Intent; import android.content.res.Resources; @@ -26,6 +27,8 @@ import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.PersistableBundle; +import android.os.Process; +import android.os.UserHandle; import android.provider.ContactsContract.CommonDataKinds; import android.telephony.CarrierConfigManager; import android.telephony.PhoneNumberUtils; @@ -136,6 +139,14 @@ public class EditFdnContactScreen extends BaseFdnContactScreen { } Cursor cursor = null; try { + // check if the URI returned by the user belongs to the user + final int currentUser = UserHandle.getUserId(Process.myUid()); + if (currentUser + != ContentProvider.getUserIdFromUri(intent.getData(), currentUser)) { + Log.w(LOG_TAG, "onActivityResult: Contact data of different user, " + + "cannot access"); + return; + } cursor = getContentResolver().query(intent.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { |