Merge "Expose remaining READ_PHONE_STATE and SEND_SMS APIs to carrier apps." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-20 02:47:50 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 6 deletions

View File

@@ -17,6 +17,7 @@
package android.telephony;
import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc;
import android.annotation.SystemApi;
import android.app.ActivityThread;
import android.app.PendingIntent;
@@ -343,15 +344,16 @@ public final class SmsManager {
* applications. Intended for internal carrier use only.
* </p>
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SEND_SMS} and
* {@link android.Manifest.permission#MODIFY_PHONE_STATE} or the calling app has carrier
* privileges.
* </p>
* <p>Requires Permission: Both {@link android.Manifest.permission#SEND_SMS} and
* {@link android.Manifest.permission#MODIFY_PHONE_STATE}, or that the calling app has carrier
* privileges (see {@link TelephonyManager#hasCarrierPrivileges}), or that the calling app is
* the default IMS app (see
* {@link CarrierConfigManager#KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING}).
*
* @see #sendTextMessage(String, String, String, PendingIntent, PendingIntent)
*/
@SystemApi
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(allOf = {
android.Manifest.permission.MODIFY_PHONE_STATE,
android.Manifest.permission.SEND_SMS

View File

@@ -1787,11 +1787,17 @@ public class TelephonyManager {
* invalid subscription ID is pinned to the TelephonyManager, the returned config will contain
* default values.
*
* <p>This method may take several seconds to complete, so it should only be called from a
* worker thread.
*
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* @see CarrierConfigManager#getConfigForSubId(int)
* @see #createForSubscriptionId(int)
* @see #createForPhoneAccountHandle(PhoneAccountHandle)
*/
// TODO(b/73136824, b/70041899): Permit carrier-privileged callers as well.
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@WorkerThread
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public PersistableBundle getCarrierConfig() {