Allow default SMS app to get self phone number

Apps with WRITE_SMS app op can now call TelephonyManager.getLine1Number().
(Note we no longer have the WRITE_SMS permission.)

Bug 22031904

Change-Id: Ic843b6d7674879951a64e3b3a92bca09c3b5c65b
This commit is contained in:
Makoto Onuki
2015-06-29 14:42:51 -07:00
parent 82b3f67711
commit a26a019c6c

View File

@@ -2011,6 +2011,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* <p>
* The default SMS app can also use this.
*/
public String getLine1Number() {
return getLine1NumberForSubscriber(getDefaultSubscription());
@@ -2022,6 +2024,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* <p>
* The default SMS app can also use this.
*
* @param subId whose phone number for line 1 is returned
*/