OSDN Git Service

Add comment to TelecomManager.getCallState
authorYorke Lee <yorkelee@google.com>
Tue, 28 Oct 2014 21:12:02 +0000 (14:12 -0700)
committerYorke Lee <yorkelee@google.com>
Tue, 28 Oct 2014 21:12:02 +0000 (14:12 -0700)
Explain why READ_PHONE_STATE permission is not required so that
people don't try to add it in the future. Requiring the permission
causes stability crashes with legacy apps and system components
that don't have the permission.

Change-Id: Idf8766aa409d4a2c4ed3d6f81a398f4a0eb24615

telecomm/java/android/telecom/TelecomManager.java

index 2652b45..13c9ea2 100644 (file)
@@ -684,6 +684,11 @@ public class TelecomManager {
      * {@link TelephonyManager#CALL_STATE_RINGING}
      * {@link TelephonyManager#CALL_STATE_OFFHOOK}
      * {@link TelephonyManager#CALL_STATE_IDLE}
+     *
+     * Note that this API does not require the
+     * {@link android.Manifest.permission#READ_PHONE_STATE} permission. This is intentional, to
+     * preserve the behavior of {@link TelephonyManager#getCallState()}, which also did not require
+     * the permission.
      * @hide
      */
     @SystemApi