From d9fc243c917bb764be92b8f59c21f6b5f81cc2f3 Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Wed, 6 Nov 2019 18:54:55 -0800 Subject: Don't allow reading IMSI of one active sub if only has carrier privilege on the other. Bug: 136123413 Test: unittest Change-Id: I67a0121d3e965f193be9e827533646423502fe70 Merged-In: I67a0121d3e965f193be9e827533646423502fe70 --- .../java/android/telephony/TelephonyManager.java | 19 +++---- .../internal/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 e99465d58764..1fc929f3d162 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1692,8 +1692,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. * @@ -1733,8 +1733,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. * @@ -1793,7 +1793,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 @@ -1862,8 +1863,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. * @@ -1889,8 +1890,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 67103bfddce1..8a852eea5610 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 { *