Merge "Fix some issues found by new doclava linter." into oc-dev

am: a00c7c0a99

Change-Id: I940b5ab896e4638e8178868acb65d79c078adbbe
This commit is contained in:
Jeff Sharkey
2017-04-25 22:25:09 +00:00
committed by android-build-merger
11 changed files with 111 additions and 191 deletions

View File

@@ -934,6 +934,7 @@ framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
# Conscrypt (com.android.org.conscrypt) is an implementation detail and should
# not be referenced in the documentation.
framework_docs_LOCAL_DROIDDOC_OPTIONS := \
-android \
-knowntags ./frameworks/base/docs/knowntags.txt \
-knowntags ./libcore/known_oj_tags.txt \
-hidePackage com.android.org.conscrypt \
@@ -963,8 +964,8 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS := \
-since $(SRC_API_DIR)/24.txt 24 \
-since $(SRC_API_DIR)/25.txt 25 \
-since ./frameworks/base/api/current.txt O \
-werror -hide 111 -hide 113 \
-overview $(LOCAL_PATH)/core/java/overview.html
-werror -hide 111 -hide 113 -hide 121 \
-overview $(LOCAL_PATH)/core/java/overview.html \
# Allow the support library to add its own droiddoc options.
include $(LOCAL_PATH)/../support/droiddoc.mk

View File

@@ -20,7 +20,9 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RawRes;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -103,6 +105,7 @@ public class WallpaperManager {
* <p>Output: RESULT_OK if user decided to crop/set the wallpaper, RESULT_CANCEL otherwise
* Activities that support this intent should specify a MIME filter of "image/*"
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_CROP_AND_SET_WALLPAPER =
"android.service.wallpaper.CROP_AND_SET_WALLPAPER";

View File

@@ -1399,6 +1399,7 @@ public class Intent implements Parcelable, Cloneable {
* <p>Input: nothing
* <p>Output: nothing
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST";
/**
@@ -2061,6 +2062,7 @@ public class Intent implements Parcelable, Cloneable {
* temporary system dialog to dismiss. Some examples of temporary system
* dialogs are the notification window-shade and the recent tasks dialog.
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
/**
* Broadcast Action: Trigger the download and eventual installation
@@ -2590,6 +2592,7 @@ public class Intent implements Parcelable, Cloneable {
* @deprecated replaced by android.os.storage.StorageEventListener
*/
@Deprecated
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_UMS_CONNECTED = "android.intent.action.UMS_CONNECTED";
/**
@@ -2600,6 +2603,7 @@ public class Intent implements Parcelable, Cloneable {
* @deprecated replaced by android.os.storage.StorageEventListener
*/
@Deprecated
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_UMS_DISCONNECTED = "android.intent.action.UMS_DISCONNECTED";
/**

View File

@@ -17,9 +17,9 @@
package android.hardware.usb;
import com.android.internal.util.Preconditions;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
@@ -30,6 +30,8 @@ import android.os.Process;
import android.os.RemoteException;
import android.util.Log;
import com.android.internal.util.Preconditions;
import java.util.HashMap;
/**
@@ -109,6 +111,7 @@ public class UsbManager {
* for the attached device
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_USB_DEVICE_ATTACHED =
"android.hardware.usb.action.USB_DEVICE_ATTACHED";
@@ -121,6 +124,7 @@ public class UsbManager {
* for the detached device
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_USB_DEVICE_DETACHED =
"android.hardware.usb.action.USB_DEVICE_DETACHED";
@@ -133,6 +137,7 @@ public class UsbManager {
* for the attached accessory
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_USB_ACCESSORY_ATTACHED =
"android.hardware.usb.action.USB_ACCESSORY_ATTACHED";
@@ -145,6 +150,7 @@ public class UsbManager {
* for the attached accessory that was detached
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_USB_ACCESSORY_DETACHED =
"android.hardware.usb.action.USB_ACCESSORY_DETACHED";

View File

@@ -16,6 +16,8 @@
package android.os;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.Context;
import android.util.Log;
@@ -67,6 +69,7 @@ public class DropBoxManager {
* <p class="note">This is a protected intent that can only be sent
* by the system.
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_DROPBOX_ENTRY_ADDED =
"android.intent.action.DROPBOX_ENTRY_ADDED";

View File

@@ -18,6 +18,8 @@ package android.provider;
import com.android.internal.R;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
@@ -2164,6 +2166,7 @@ public class Contacts {
* @deprecated Do not use. This is not supported.
*/
@Deprecated
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String FILTER_CONTACTS_ACTION =
"com.android.contacts.action.FILTER_CONTACTS";

View File

@@ -17,6 +17,8 @@
package android.provider;
import android.accounts.Account;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.app.Activity;
import android.content.BroadcastReceiver;
@@ -8401,6 +8403,7 @@ public final class ContactsContract {
* Action used to launch the system contacts application and bring up a QuickContact dialog
* for the provided {@link Contacts} entry.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_QUICK_CONTACT =
"android.provider.action.QUICK_CONTACT";
@@ -8924,6 +8927,7 @@ public final class ContactsContract {
* @see #METADATA_ACCOUNT_TYPE
* @see #METADATA_MIMETYPE
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_VOICE_SEND_MESSAGE_TO_CONTACTS =
"android.provider.action.VOICE_SEND_MESSAGE_TO_CONTACTS";

View File

@@ -1498,6 +1498,7 @@ public final class MediaStore {
* May also contain the extra EXTRA_MAX_BYTES.
* @see #EXTRA_MAX_BYTES
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String RECORD_SOUND_ACTION =
"android.provider.MediaStore.RECORD_SOUND";

View File

@@ -17,7 +17,9 @@ package android.security;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.WorkerThread;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.Service;
@@ -199,12 +201,14 @@ public final class KeyChain {
* {@link Build.VERSION_CODES#N_MR1} will only receive this broadcast if they register for it
* at runtime.
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_STORAGE_CHANGED = "android.security.STORAGE_CHANGED";
/**
* Broadcast Action: Indicates the contents of the keychain has changed. Sent when a KeyChain
* entry is added, modified or removed.
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_KEYCHAIN_CHANGED = "android.security.action.KEYCHAIN_CHANGED";
/**
@@ -216,6 +220,7 @@ public final class KeyChain {
* <li>A CA is added or removed from the trust store</li>
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_TRUST_STORE_CHANGED =
"android.security.action.TRUST_STORE_CHANGED";
@@ -223,6 +228,7 @@ public final class KeyChain {
* Broadcast Action: Indicates that the access permissions for a private key have changed.
*
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_KEY_ACCESS_CHANGED =
"android.security.action.KEY_ACCESS_CHANGED";

View File

@@ -19,8 +19,10 @@ package android.media.tv;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.StringDef;
import android.annotation.SystemApi;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.Activity;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -90,6 +92,7 @@ public final class TvContract {
* @hide
*/
@SystemApi
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED =
"android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
@@ -105,6 +108,7 @@ public final class TvContract {
* integer.</li>
* </ul>
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_REQUEST_CHANNEL_BROWSABLE =
"android.media.tv.action.REQUEST_CHANNEL_BROWSABLE";
@@ -119,6 +123,7 @@ public final class TvContract {
* <li>{@link #EXTRA_PREVIEW_PROGRAM_ID}: the disabled preview program ID.</li>
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED =
"android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED";
@@ -133,6 +138,7 @@ public final class TvContract {
* <li>{@link #EXTRA_WATCH_NEXT_PROGRAM_ID}: the disabled "watch next" program ID.</li>
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED =
"android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED";
@@ -146,6 +152,7 @@ public final class TvContract {
* <li>{@link #EXTRA_WATCH_NEXT_PROGRAM_ID}: the ID of the new watch next program.</li>
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT =
"android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT";
@@ -163,6 +170,7 @@ public final class TvContract {
* <code>AndroidManifest.xml</code>.</li>
* </ul>
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_INITIALIZE_PROGRAMS =
"android.media.tv.action.INITIALIZE_PROGRAMS";

View File

@@ -323,9 +323,6 @@ public class TelephonyManager {
* a String.
*
* <p class="note">
* Requires the READ_PHONE_STATE permission.
*
* <p class="note">
* This was a {@link android.content.Context#sendStickyBroadcast sticky}
* broadcast in version 1.0, but it is no longer sticky.
* Instead, use {@link #getCallState} to synchronously query the current call state.
@@ -335,6 +332,7 @@ public class TelephonyManager {
* @see #getCallState
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public static final String ACTION_PHONE_STATE_CHANGED =
"android.intent.action.PHONE_STATE";
@@ -939,10 +937,8 @@ public class TelephonyManager {
* Returns the software version number for the device, for example,
* the IMEI/SV for GSM phones. Return null if the software version is
* not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getDeviceSoftwareVersion() {
return getDeviceSoftwareVersion(getSlotIndex());
}
@@ -952,12 +948,10 @@ public class TelephonyManager {
* the IMEI/SV for GSM phones. Return null if the software version is
* not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param slotIndex of which deviceID is returned
*/
/** {@hide} */
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getDeviceSoftwareVersion(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) return null;
@@ -975,13 +969,11 @@ public class TelephonyManager {
* Returns the unique device ID, for example, the IMEI for GSM and the MEID
* or ESN for CDMA phones. Return null if device ID is not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @deprecated Use (@link getImei} which returns IMEI for GSM or (@link getMeid} which returns
* MEID for CDMA.
*/
@Deprecated
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getDeviceId() {
try {
ITelephony telephony = getITelephony();
@@ -999,15 +991,13 @@ public class TelephonyManager {
* Returns the unique device ID of a subscription, for example, the IMEI for
* GSM and the MEID for CDMA phones. Return null if device ID is not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param slotIndex of which deviceID is returned
*
* @deprecated Use (@link getImei} which returns IMEI for GSM or (@link getMeid} which returns
* MEID for CDMA.
*/
@Deprecated
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getDeviceId(int slotIndex) {
// FIXME this assumes phoneId == slotIndex
try {
@@ -1025,10 +1015,8 @@ public class TelephonyManager {
/**
* Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not
* available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getImei() {
return getImei(getSlotIndex());
}
@@ -1037,11 +1025,9 @@ public class TelephonyManager {
* Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not
* available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param slotIndex of which IMEI is returned
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getImei(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) return null;
@@ -1057,10 +1043,8 @@ public class TelephonyManager {
/**
* Returns the MEID (Mobile Equipment Identifier). Return null if MEID is not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getMeid() {
return getMeid(getSlotIndex());
}
@@ -1068,11 +1052,9 @@ public class TelephonyManager {
/**
* Returns the MEID (Mobile Equipment Identifier). Return null if MEID is not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param slotIndex of which MEID is returned
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getMeid(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) return null;
@@ -1128,13 +1110,13 @@ public class TelephonyManager {
*<p>
* @return Current location of the device or null if not available.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION}.
*
* @deprecated use {@link #getAllCellInfo} instead, which returns a superset of this API.
*/
@Deprecated
@RequiresPermission(anyOf = {
android.Manifest.permission.ACCESS_COARSE_LOCATION,
android.Manifest.permission.ACCESS_FINE_LOCATION
})
public CellLocation getCellLocation() {
try {
ITelephony telephony = getITelephony();
@@ -1166,11 +1148,9 @@ public class TelephonyManager {
* Enables location update notifications. {@link PhoneStateListener#onCellLocationChanged
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
*
* <p>Requires Permission: {@link android.Manifest.permission#CONTROL_LOCATION_UPDATES
* CONTROL_LOCATION_UPDATES}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
public void enableLocationUpdates() {
enableLocationUpdates(getSubId());
}
@@ -1180,12 +1160,10 @@ public class TelephonyManager {
* {@link PhoneStateListener#onCellLocationChanged
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
*
* <p>Requires Permission: {@link android.Manifest.permission#CONTROL_LOCATION_UPDATES
* CONTROL_LOCATION_UPDATES}
*
* @param subId for which the location updates are enabled
* @hide
*/
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
public void enableLocationUpdates(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -1200,11 +1178,9 @@ public class TelephonyManager {
* Disables location update notifications. {@link PhoneStateListener#onCellLocationChanged
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
*
* <p>Requires Permission: {@link android.Manifest.permission#CONTROL_LOCATION_UPDATES
* CONTROL_LOCATION_UPDATES}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
public void disableLocationUpdates() {
disableLocationUpdates(getSubId());
}
@@ -1223,15 +1199,13 @@ public class TelephonyManager {
/**
* Returns the neighboring cell information of the device.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}
*
* @return List of NeighboringCellInfo or null if info unavailable.
*
* @deprecated Use {@link #getAllCellInfo} which returns a superset of the information
* from NeighboringCellInfo.
*/
@Deprecated
@RequiresPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION)
public List<NeighboringCellInfo> getNeighboringCellInfo() {
try {
ITelephony telephony = getITelephony();
@@ -1587,14 +1561,12 @@ public class TelephonyManager {
* invalid subscription ID is pinned to the TelephonyManager, the returned config will contain
* default values.
*
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
* READ_PHONE_STATE}
*
* @see CarrierConfigManager#getConfigForSubId(int)
* @see #createForSubscriptionId(int)
* @see #createForPhoneAccountHandle(PhoneAccountHandle)
*/
@WorkerThread
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public PersistableBundle getCarrierConfig() {
CarrierConfigManager carrierConfigManager = mContext
.getSystemService(CarrierConfigManager.class);
@@ -1754,11 +1726,9 @@ public class TelephonyManager {
* @see #NETWORK_TYPE_EHRPD
* @see #NETWORK_TYPE_HSPAP
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getNetworkType(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -1784,10 +1754,6 @@ public class TelephonyManager {
* If this object has been created with {@link #createForSubscriptionId}, applies to the given
* subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()}
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @return the network type
*
* @see #NETWORK_TYPE_UNKNOWN
@@ -1807,6 +1773,7 @@ public class TelephonyManager {
* @see #NETWORK_TYPE_EHRPD
* @see #NETWORK_TYPE_HSPAP
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getDataNetworkType() {
return getDataNetworkType(getSubId(SubscriptionManager.getDefaultDataSubscriptionId()));
}
@@ -1817,12 +1784,9 @@ public class TelephonyManager {
* @return the network type
*
* @param subId for which network type is returned
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getDataNetworkType(int subId) {
try{
ITelephony telephony = getITelephony();
@@ -1843,23 +1807,17 @@ public class TelephonyManager {
/**
* Returns the NETWORK_TYPE_xxxx for voice
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getVoiceNetworkType() {
return getVoiceNetworkType(getSubId());
}
/**
* Returns the NETWORK_TYPE_xxxx for voice for a subId
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getVoiceNetworkType(int subId) {
try{
ITelephony telephony = getITelephony();
@@ -2261,10 +2219,8 @@ public class TelephonyManager {
/**
* Returns the serial number of the SIM, if applicable. Return null if it is
* unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getSimSerialNumber() {
return getSimSerialNumber(getSubId());
}
@@ -2274,10 +2230,9 @@ public class TelephonyManager {
* unavailable.
* <p>
* @param subId for which Sim Serial number is returned
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getSimSerialNumber(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2300,12 +2255,9 @@ public class TelephonyManager {
* @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
* or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getLteOnCdmaMode() {
return getLteOnCdmaMode(getSubId());
}
@@ -2318,12 +2270,9 @@ public class TelephonyManager {
* @param subId for which radio is LTE on CDMA is returned
* @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
* or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getLteOnCdmaMode(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -2348,10 +2297,8 @@ public class TelephonyManager {
/**
* Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getSubscriberId() {
return getSubscriberId(getSubId());
}
@@ -2360,13 +2307,11 @@ public class TelephonyManager {
* Returns the unique subscriber ID, for example, the IMSI for a GSM phone
* for a subscription.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId whose subscriber id is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getSubscriberId(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2384,10 +2329,8 @@ public class TelephonyManager {
/**
* Returns the Group Identifier Level1 for a GSM phone.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getGroupIdLevel1() {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2405,13 +2348,11 @@ public class TelephonyManager {
/**
* Returns the Group Identifier Level1 for a GSM phone for a particular subscription.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId whose subscriber id is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getGroupIdLevel1(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2430,15 +2371,13 @@ public class TelephonyManager {
* Returns the phone number string for line 1, for example, the MSISDN
* for a GSM phone. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* OR
* {@link android.Manifest.permission#READ_SMS}
* OR
* {@link android.Manifest.permission#READ_PHONE_NUMBERS}
* <p>
* The default SMS app can also use this.
*/
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PHONE_STATE,
android.Manifest.permission.READ_SMS,
android.Manifest.permission.READ_PHONE_NUMBERS
})
public String getLine1Number() {
return getLine1Number(getSubId());
}
@@ -2447,18 +2386,16 @@ public class TelephonyManager {
* Returns the phone number string for line 1, for example, the MSISDN
* for a GSM phone for a particular subscription. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* OR
* {@link android.Manifest.permission#READ_SMS}
* OR
* {@link android.Manifest.permission#READ_PHONE_NUMBERS}
* <p>
* The default SMS app can also use this.
*
* @param subId whose phone number for line 1 is returned
* @hide
*/
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PHONE_STATE,
android.Manifest.permission.READ_SMS,
android.Manifest.permission.READ_PHONE_NUMBERS
})
public String getLine1Number(int subId) {
String number = null;
try {
@@ -2530,12 +2467,10 @@ public class TelephonyManager {
/**
* Returns the alphabetic identifier associated with the line 1 number.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
* nobody seems to call this.
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getLine1AlphaTag() {
return getLine1AlphaTag(getSubId());
}
@@ -2544,13 +2479,11 @@ public class TelephonyManager {
* Returns the alphabetic identifier associated with the line 1 number
* for a subscription.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with line 1 is returned
* nobody seems to call this.
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getLine1AlphaTag(int subId) {
String alphaTag = null;
try {
@@ -2599,12 +2532,10 @@ public class TelephonyManager {
/**
* Returns the MSISDN string.
* for a GSM phone. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getMsisdn() {
return getMsisdn(getSubId());
}
@@ -2612,13 +2543,11 @@ public class TelephonyManager {
/**
* Returns the MSISDN string.
* for a GSM phone. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId for which msisdn is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getMsisdn(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2635,10 +2564,8 @@ public class TelephonyManager {
/**
* Returns the voice mail number. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getVoiceMailNumber() {
return getVoiceMailNumber(getSubId());
}
@@ -2646,12 +2573,10 @@ public class TelephonyManager {
/**
* Returns the voice mail number for a subscription.
* Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice mail number is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getVoiceMailNumber(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2668,25 +2593,21 @@ public class TelephonyManager {
/**
* Returns the complete voice mail number. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED}
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.CALL_PRIVILEGED)
public String getCompleteVoiceMailNumber() {
return getCompleteVoiceMailNumber(getSubId());
}
/**
* Returns the complete voice mail number. Return null if it is unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED}
*
* @param subId
* @hide
*/
@RequiresPermission(android.Manifest.permission.CALL_PRIVILEGED)
public String getCompleteVoiceMailNumber(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2757,9 +2678,6 @@ public class TelephonyManager {
/**
* Returns whether the visual voicemail client is enabled.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param phoneAccountHandle the phone account to check for.
* @return {@code true} when the visual voicemail client is enabled for this client
* @hide
@@ -2767,6 +2685,7 @@ public class TelephonyManager {
* be implemented instead.
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public boolean isVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle){
return false;
}
@@ -2804,14 +2723,12 @@ public class TelephonyManager {
* to the TelephonyManager. Returns {@code null} when there is no package responsible for
* processing visual voicemail for the subscription.
*
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE
* READ_PHONE_STATE}
*
* @see #createForSubscriptionId(int)
* @see #createForPhoneAccountHandle(PhoneAccountHandle)
* @see VisualVoicemailService
*/
@Nullable
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getVisualVoicemailPackageName() {
try {
ITelephony telephony = getITelephony();
@@ -2971,9 +2888,6 @@ public class TelephonyManager {
/**
* Send a visual voicemail SMS. The IPC caller must be the current default dialer.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SEND_SMS SEND_SMS}
*
* @param phoneAccountHandle The account to send the SMS with.
* @param number The destination number.
* @param port The destination port for data SMS, or 0 for text SMS.
@@ -2985,6 +2899,7 @@ public class TelephonyManager {
*
* @hide
*/
@RequiresPermission(android.Manifest.permission.SEND_SMS)
public void sendVisualVoicemailSmsForSubscriber(int subId, String number, int port,
String text, PendingIntent sentIntent) {
try {
@@ -3089,9 +3004,6 @@ public class TelephonyManager {
/**
* Returns the voice activation state for the given subscriber.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE}
*
* @param subId The subscription id.
*
* @return voiceActivationState for the given subscriber
@@ -3101,6 +3013,7 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_DEACTIVATED
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getVoiceActivationState(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3115,9 +3028,6 @@ public class TelephonyManager {
/**
* Returns the data activation state for the given subscriber.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE}
*
* @param subId The subscription id.
*
* @return dataActivationState for the given subscriber
@@ -3128,6 +3038,7 @@ public class TelephonyManager {
* @see #SIM_ACTIVATION_STATE_RESTRICTED
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getDataActivationState(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3142,23 +3053,19 @@ public class TelephonyManager {
/**
* Returns the voice mail count. Return 0 if unavailable, -1 if there are unread voice messages
* but the count is unknown.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getVoiceMessageCount() {
return getVoiceMessageCount(getSubId());
}
/**
* Returns the voice mail count for a subscription. Return 0 if unavailable.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice message count is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getVoiceMessageCount(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3176,10 +3083,8 @@ public class TelephonyManager {
/**
* Retrieves the alphabetic identifier associated with the voice
* mail number.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getVoiceMailAlphaTag() {
return getVoiceMailAlphaTag(getSubId());
}
@@ -3187,13 +3092,11 @@ public class TelephonyManager {
/**
* Retrieves the alphabetic identifier associated with the voice
* mail number for a subscription.
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with the
* voice mail number is returned
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getVoiceMailAlphaTag(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -3504,23 +3407,18 @@ public class TelephonyManager {
/**
* Returns the CDMA ERI icon index to display
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getCdmaEriIconIndex() {
return getCdmaEriIconIndex(getSubId());
}
/**
* Returns the CDMA ERI icon index to display for a subscription
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getCdmaEriIconIndex(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3540,11 +3438,9 @@ public class TelephonyManager {
* 0 - ON
* 1 - FLASHING
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getCdmaEriIconMode() {
return getCdmaEriIconMode(getSubId());
}
@@ -3554,11 +3450,9 @@ public class TelephonyManager {
* 0 - ON
* 1 - FLASHING
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getCdmaEriIconMode(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3576,11 +3470,9 @@ public class TelephonyManager {
/**
* Returns the CDMA ERI text,
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getCdmaEriText() {
return getCdmaEriText(getSubId());
}
@@ -3588,11 +3480,9 @@ public class TelephonyManager {
/**
* Returns the CDMA ERI text, of a subscription
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getCdmaEriText(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3675,13 +3565,10 @@ public class TelephonyManager {
* android.telephony.TelephonyManager#getCellLocation getCellLocation()}
* instead.
*
* <p>Requires permission:
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}
*
* @return List of {@link android.telephony.CellInfo}; null if cell
* information is unavailable.
*
*/
@RequiresPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION)
public List<CellInfo> getAllCellInfo() {
try {
ITelephony telephony = getITelephony();
@@ -4535,11 +4422,9 @@ public class TelephonyManager {
* Returns an array of Forbidden PLMNs from the USIM App
* Returns null if the query fails.
*
*
* <p>Requires that the caller has READ_PHONE_STATE
*
* @return an array of forbidden PLMNs or null if not available
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String[] getForbiddenPlmns() {
return getForbiddenPlmns(getSubId(), APPTYPE_USIM);
}
@@ -4548,14 +4433,12 @@ public class TelephonyManager {
* Returns an array of Forbidden PLMNs from the specified SIM App
* Returns null if the query fails.
*
*
* <p>Requires that the calling app has READ_PHONE_STATE
*
* @param subId subscription ID used for authentication
* @param appType the icc application type, like {@link #APPTYPE_USIM}
* @return fplmns an array of forbidden PLMNs
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String[] getForbiddenPlmns(int subId, int appType) {
try {
ITelephony telephony = getITelephony();
@@ -6243,10 +6126,8 @@ public class TelephonyManager {
/**
* Returns the current {@link ServiceState} information.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public ServiceState getServiceState() {
return getServiceStateForSubscriber(getSubId());
}