From 4bff428285321e0d79b671021c8c53047a50fe58 Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Wed, 6 Nov 2019 18:54:55 -0800 Subject: [PATCH] Don't allow reading IMSI of one active sub if only has carrier privilege on the other. Bug: 136123413 Test: unittest Change-Id: I67a0121d3e965f193be9e827533646423502fe70 --- .../android/telephony/TelephonyManager.java | 19 +++--- .../telephony/TelephonyPermissions.java | 60 ++++++++++++------- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8c2145ab15513..8a7125f76c7aa 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1589,8 +1589,8 @@ public class TelephonyManager { * *

Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner * access is deprecated and will be removed in a future release. * @@ -1630,8 +1630,8 @@ public class TelephonyManager { * *

Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner * access is deprecated and will be removed in a future release. * @@ -1690,7 +1690,8 @@ public class TelephonyManager { *

  • The caller holds the READ_PRIVILEGED_PHONE_STATE permission.
  • *
  • If the caller is the device or profile owner, the caller holds the * {@link Manifest.permission#READ_PHONE_STATE} permission.
  • - *
  • The caller has carrier privileges (see {@link #hasCarrierPrivileges()}.
  • + *
  • The caller has carrier privileges (see {@link #hasCarrierPrivileges()} on any + * active subscription.
  • *
  • The caller is the default SMS app for the device.
  • * *

    The profile owner is an app that owns a managed profile on the device; for more details @@ -1759,8 +1760,8 @@ public class TelephonyManager { * *

    Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner * access is deprecated and will be removed in a future release. * @@ -1786,8 +1787,8 @@ public class TelephonyManager { * *

    Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner * access is deprecated and will be removed in a future release. * diff --git a/telephony/java/com/android/internal/telephony/TelephonyPermissions.java b/telephony/java/com/android/internal/telephony/TelephonyPermissions.java index 51c5d12dfe157..f6cf8c51a189a 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyPermissions.java +++ b/telephony/java/com/android/internal/telephony/TelephonyPermissions.java @@ -237,9 +237,10 @@ public final class TelephonyPermissions { *