diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-04-16 10:32:04 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2015-04-17 20:43:56 +0000 |
commit | 16a16899505ec0a9ede5b76650bfb8817b3227c7 (patch) | |
tree | ab1ff64e6befd59d55de65dbe7a89614feadcd2f /telephony | |
parent | d01242946eb7423612998b5bdbc71a6a1b3e8581 (diff) | |
download | frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.zip frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.tar.gz frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.tar.bz2 |
Add OP_READ_PHONE_STATE app op - framework
The READ_PHONE_STATE permission protects PII information and
is in the Phone group. This change is adding the corrseponding
app op for gating access to the API guarded by READ_POHNE state
which will be used instead as an access control for legacy apps.
Change-Id: I2ff895a5a0e529f26ec0ad706266a30d829268ba
Diffstat (limited to 'telephony')
3 files changed, 22 insertions, 17 deletions
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 08aec08..3ecf5ac 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -272,10 +272,6 @@ public class SubscriptionManager { * for #onSubscriptionsChanged to be invoked. */ public static class OnSubscriptionsChangedListener { - /** @hide */ - public static final String PERMISSION_ON_SUBSCRIPTIONS_CHANGED = - android.Manifest.permission.READ_PHONE_STATE; - private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 128f6e3..cd3f636 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -664,7 +664,7 @@ public class TelephonyManager { ITelephony telephony = getITelephony(); if (telephony == null) return null; - return telephony.getDeviceId(); + return telephony.getDeviceId(mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { @@ -1975,7 +1975,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) - number = telephony.getLine1NumberForDisplay(subId); + number = telephony.getLine1NumberForDisplay(subId, mContext.getOpPackageName()); } catch (RemoteException ex) { } catch (NullPointerException ex) { } @@ -2096,7 +2096,8 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) - alphaTag = telephony.getLine1AlphaTagForDisplay(subId); + alphaTag = telephony.getLine1AlphaTagForDisplay(subId, + mContext.getOpPackageName()); } catch (RemoteException ex) { } catch (NullPointerException ex) { } @@ -3342,7 +3343,7 @@ public class TelephonyManager { ITelephony telephony = getITelephony(); if (telephony == null) return new String[0]; - return telephony.getPcscfAddress(apnType); + return telephony.getPcscfAddress(apnType, mContext.getOpPackageName()); } catch (RemoteException e) { return new String[0]; } @@ -3759,7 +3760,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) - return telephony.isSimPinEnabled(); + return telephony.isSimPinEnabled(mContext.getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isSimPinEnabled", e); } @@ -4026,7 +4027,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) - return telephony.isVideoCallingEnabled(); + return telephony.isVideoCallingEnabled(mContext.getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isVideoCallingEnabled", e); } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index a24859b..4fe88c4 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -45,6 +45,7 @@ interface ITelephony { /** * Place a call to the specified number. + * @param callingPackage The package making the call. * @param number the number to be called. */ void call(String callingPackage, String number); @@ -169,8 +170,9 @@ interface ITelephony { /** * Check if the SIM pin lock is enabled. * @return true if the SIM pin lock is enabled. + * @param callingPackage The package making the call. */ - boolean isSimPinEnabled(); + boolean isSimPinEnabled(String callingPackage); /** * Supply a pin to unlock the SIM. Blocks until a result is determined. @@ -644,10 +646,11 @@ interface ITelephony { /* * Get the calculated preferred network type. * Used for device configuration by some CDMA operators. + * @param callingPackage The package making the call. * * @return the calculated preferred network type, defined in RILConstants.java. */ - int getCalculatedPreferredNetworkType(); + int getCalculatedPreferredNetworkType(String callingPackage); /* * Get the preferred network type. @@ -701,8 +704,9 @@ interface ITelephony { /** * Get P-CSCF address from PCO after data connection is established or modified. * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN + * @param callingPackage The package making the call. */ - String[] getPcscfAddress(String apnType); + String[] getPcscfAddress(String apnType, String callingPackage); /** * Set IMS registration state @@ -768,19 +772,21 @@ interface ITelephony { * {@link #setLine1NumberForDisplay}. Otherwise returns null. * * @param subId whose dialing number for line 1 is returned. + * @param callingPackage The package making the call. * @return the displayed dialing number if set, or null if not set. */ - String getLine1NumberForDisplay(int subId); + String getLine1NumberForDisplay(int subId, String callingPackage); /** * Returns the displayed alphatag of the dialing number if it was set * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null. * * @param subId whose alphatag associated with line 1 is returned. + * @param callingPackage The package making the call. * @return the displayed alphatag of the dialing number if set, or null if * not set. */ - String getLine1AlphaTagForDisplay(int subId); + String getLine1AlphaTagForDisplay(int subId, String callingPackage); String[] getMergedSubscriberIds(); @@ -872,9 +878,10 @@ interface ITelephony { /** * Whether video calling has been enabled by the user. * + * @param callingPackage The package making the call. * @return {@code true} if the user has enabled video calling, {@code false} otherwise. */ - boolean isVideoCallingEnabled(); + boolean isVideoCallingEnabled(String callingPackage); /** * Whether the DTMF tone length can be changed. @@ -925,10 +932,11 @@ interface ITelephony { * Returns the unique device ID of phone, for example, the IMEI for * GSM and the MEID for CDMA phones. Return null if device ID is not available. * + * @param callingPackage The package making the call. * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ - String getDeviceId(); + String getDeviceId(String callingPackage); /** * Returns the subscription ID associated with the specified PhoneAccount. |