diff options
| author | 2018-03-20 19:27:10 +0000 | |
|---|---|---|
| committer | 2018-03-20 19:27:10 +0000 | |
| commit | cfa85917798b3b96b49a6c7c9a13bf0e0876f044 (patch) | |
| tree | 30f11237381fef2544904c0ebc7574abffc6da23 | |
| parent | 3785417848f95c24d2095daeaed0d1cb6b04fb35 (diff) | |
| parent | 71e4c9bfade54977b98eb6c68f01100c074b0329 (diff) | |
Merge "Revert "TelephonyManager System APIs process"" into pi-dev
| -rw-r--r-- | api/system-current.txt | 8 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 60 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 22 |
3 files changed, 20 insertions, 70 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 0e33c1772720..e1b576de15ac 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5213,10 +5213,10 @@ package android.telephony { method public boolean handlePinMmi(java.lang.String); method public boolean handlePinMmiForSubscriber(int, java.lang.String); method public boolean isDataConnectivityPossible(); - method public deprecated boolean isIdle(); - method public deprecated boolean isOffhook(); - method public deprecated boolean isRadioOn(); - method public deprecated boolean isRinging(); + method public boolean isIdle(); + method public boolean isOffhook(); + method public boolean isRadioOn(); + method public boolean isRinging(); method public boolean isVideoCallingEnabled(); method public deprecated boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle); method public boolean needsOtaServiceProvisioning(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7dff667ca6fa..c1300b3892ff 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1455,7 +1455,6 @@ public class TelephonyManager { * {@hide} */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentPhoneType() { return getCurrentPhoneType(getSubId()); } @@ -1471,17 +1470,7 @@ public class TelephonyManager { * @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentPhoneType(int subId) { - return getCurrentPhoneType(subId, false); - } - - /** - * getCurrentPhoneType() with optional check if device is voice capable. - * - * @hide - */ - public int getCurrentPhoneType(int subId, boolean checkIsVoiceCapable) { int phoneId; if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) { // if we don't have any sims, we don't have subscriptions, but we @@ -1490,7 +1479,8 @@ public class TelephonyManager { } else { phoneId = SubscriptionManager.getPhoneId(subId); } - return getCurrentPhoneTypeForSlot(phoneId, checkIsVoiceCapable); + + return getCurrentPhoneTypeForSlot(phoneId); } /** @@ -1498,15 +1488,11 @@ public class TelephonyManager { * * @hide */ - public int getCurrentPhoneTypeForSlot(int slotIndex, boolean checkIsVoiceCapable) { + public int getCurrentPhoneTypeForSlot(int slotIndex) { try{ ITelephony telephony = getITelephony(); if (telephony != null) { - if (checkIsVoiceCapable) { - return telephony.getVoiceCapableActivePhoneTypeForSlot(slotIndex); - } else { - return telephony.getActivePhoneTypeForSlot(slotIndex); - } + return telephony.getActivePhoneTypeForSlot(slotIndex); } else { // This can happen when the ITelephony interface is not up yet. return getPhoneTypeFromProperty(slotIndex); @@ -1532,7 +1518,10 @@ public class TelephonyManager { * @see #PHONE_TYPE_SIP */ public int getPhoneType() { - return getCurrentPhoneType(getSubId(), true); + if (!isVoiceCapable()) { + return PHONE_TYPE_NONE; + } + return getCurrentPhoneType(); } private int getPhoneTypeFromProperty() { @@ -5842,14 +5831,12 @@ public class TelephonyManager { /** @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public List<String> getCarrierPackageNamesForIntent(Intent intent) { return getCarrierPackageNamesForIntentAndPhone(intent, getPhoneId()); } /** @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) { try { ITelephony telephony = getITelephony(); @@ -5959,11 +5946,7 @@ public class TelephonyManager { } } - /** - * @deprecated Use {@link android.telecom.TelecomManager#isInCall} instead - * @hide - */ - @Deprecated + /** @hide */ @SystemApi @RequiresPermission(anyOf = { android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, @@ -5980,11 +5963,7 @@ public class TelephonyManager { return false; } - /** - * @deprecated Use {@link android.telecom.TelecomManager#isRinging} instead - * @hide - */ - @Deprecated + /** @hide */ @SystemApi @RequiresPermission(anyOf = { android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, @@ -6001,11 +5980,7 @@ public class TelephonyManager { return false; } - /** - * @deprecated Use {@link android.telecom.TelecomManager#isInCall} instead - * @hide - */ - @Deprecated + /** @hide */ @SystemApi @RequiresPermission(anyOf = { android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, @@ -6022,11 +5997,7 @@ public class TelephonyManager { return true; } - /** - * @deprecated Use {@link android.telephony.TelephonyManager#getServiceState} instead - * @hide - */ - @Deprecated + /** @hide */ @SystemApi @RequiresPermission(anyOf = { android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, @@ -6317,7 +6288,6 @@ public class TelephonyManager { /** @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataConnectivityPossible() { try { ITelephony telephony = getITelephony(); @@ -6332,7 +6302,6 @@ public class TelephonyManager { /** @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean needsOtaServiceProvisioning() { try { ITelephony telephony = getITelephony(); @@ -6435,7 +6404,10 @@ public class TelephonyManager { /** @hide */ @SystemApi - @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @RequiresPermission(anyOf = { + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, + android.Manifest.permission.READ_PHONE_STATE + }) public boolean isVideoCallingEnabled() { try { ITelephony telephony = getITelephony(); diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 23b4dc049de5..fbb69ad78bb6 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -375,8 +375,6 @@ interface ITelephony { /** * Report whether data connectivity is possible. - * - * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE */ boolean isDataConnectivityPossible(int subId); @@ -415,25 +413,11 @@ interface ITelephony { * Returns the current active phone type as integer for particular slot. * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE - * - * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE - * * @param slotIndex - slot to query. */ int getActivePhoneTypeForSlot(int slotIndex); /** - * Returns the current active phone type as integer for particular slot. - * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE - * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE - * - * If the device is not voice-capable, return PHONE_TYPE_NONE - * - * @param slotIndex - slot to query. - */ - int getVoiceCapableActivePhoneTypeForSlot(int slotIndex); - - /** * Returns the CDMA ERI icon index to display * @param callingPackage package making the call. */ @@ -480,8 +464,6 @@ interface ITelephony { * Returns true if OTA service provisioning needs to run. * Only relevant on some technologies, others will always * return false. - * - * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE */ boolean needsOtaServiceProvisioning(); @@ -994,8 +976,6 @@ interface ITelephony { * Returns list of the package names of the carrier apps that should handle the input intent * and have carrier privileges for the given phoneId. * - * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE - * * @param intent Intent that will be sent. * @param phoneId The phoneId on which the carrier app has carrier privileges. * @return list of carrier app package names that can handle the intent on phoneId. @@ -1120,8 +1100,6 @@ interface ITelephony { /** * Whether video calling has been enabled by the user. * - * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE - * * @param callingPackage The package making the call. * @return {@code true} if the user has enabled video calling, {@code false} otherwise. */ |