Merge "Give Doclava our manifest; more permission docs." into oc-dev

am: 65d4cbba37

Change-Id: I2ec50efb67debd15d354db69b84fb620eb74bc0e
This commit is contained in:
Jeff Sharkey
2017-06-06 15:28:26 +00:00
committed by android-build-merger
8 changed files with 74 additions and 4 deletions

View File

@@ -936,6 +936,7 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS := \
-android \ -android \
-knowntags ./frameworks/base/docs/knowntags.txt \ -knowntags ./frameworks/base/docs/knowntags.txt \
-knowntags ./libcore/known_oj_tags.txt \ -knowntags ./libcore/known_oj_tags.txt \
-manifest ./frameworks/base/core/res/AndroidManifest.xml \
-hidePackage com.android.org.conscrypt \ -hidePackage com.android.org.conscrypt \
-since $(SRC_API_DIR)/1.xml 1 \ -since $(SRC_API_DIR)/1.xml 1 \
-since $(SRC_API_DIR)/2.xml 2 \ -since $(SRC_API_DIR)/2.xml 2 \

View File

@@ -1605,6 +1605,7 @@ public class DevicePolicyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
public boolean packageHasActiveAdmins(String packageName) { public boolean packageHasActiveAdmins(String packageName) {
return packageHasActiveAdmins(packageName, myUserId()); return packageHasActiveAdmins(packageName, myUserId());
} }
@@ -4516,11 +4517,10 @@ public class DevicePolicyManager {
/** /**
* @return device owner component name, even if it's running on a different user. * @return device owner component name, even if it's running on a different user.
* *
* <p>Requires the MANAGE_USERS permission.
*
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public ComponentName getDeviceOwnerComponentOnAnyUser() { public ComponentName getDeviceOwnerComponentOnAnyUser() {
return getDeviceOwnerComponentInner(/* callingUserOnly =*/ false); return getDeviceOwnerComponentInner(/* callingUserOnly =*/ false);
} }
@@ -4604,6 +4604,7 @@ public class DevicePolicyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public @Nullable String getDeviceOwner() { public @Nullable String getDeviceOwner() {
throwIfParentInstance("getDeviceOwner"); throwIfParentInstance("getDeviceOwner");
final ComponentName name = getDeviceOwnerComponentOnCallingUser(); final ComponentName name = getDeviceOwnerComponentOnCallingUser();
@@ -4621,6 +4622,7 @@ public class DevicePolicyManager {
*/ */
@SystemApi @SystemApi
@TestApi @TestApi
@SuppressLint("Doclava125")
public boolean isDeviceManaged() { public boolean isDeviceManaged() {
try { try {
return mService.hasDeviceOwner(); return mService.hasDeviceOwner();
@@ -4633,11 +4635,10 @@ public class DevicePolicyManager {
* Returns the device owner name. Note this method *will* return the device owner * Returns the device owner name. Note this method *will* return the device owner
* name when it's running on a different user. * name when it's running on a different user.
* *
* <p>Requires the MANAGE_USERS permission.
*
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public String getDeviceOwnerNameOnAnyUser() { public String getDeviceOwnerNameOnAnyUser() {
throwIfParentInstance("getDeviceOwnerNameOnAnyUser"); throwIfParentInstance("getDeviceOwnerNameOnAnyUser");
if (mService != null) { if (mService != null) {
@@ -5010,6 +5011,7 @@ public class DevicePolicyManager {
* @throws IllegalArgumentException if the userId is invalid. * @throws IllegalArgumentException if the userId is invalid.
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public @Nullable String getProfileOwnerNameAsUser(int userId) throws IllegalArgumentException { public @Nullable String getProfileOwnerNameAsUser(int userId) throws IllegalArgumentException {
throwIfParentInstance("getProfileOwnerNameAsUser"); throwIfParentInstance("getProfileOwnerNameAsUser");
if (mService != null) { if (mService != null) {
@@ -7528,6 +7530,7 @@ public class DevicePolicyManager {
*/ */
@SystemApi @SystemApi
@TestApi @TestApi
@SuppressLint("Doclava125")
public @Nullable CharSequence getDeviceOwnerOrganizationName() { public @Nullable CharSequence getDeviceOwnerOrganizationName() {
try { try {
return mService.getDeviceOwnerOrganizationName(); return mService.getDeviceOwnerOrganizationName();
@@ -7739,6 +7742,7 @@ public class DevicePolicyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public boolean isDeviceProvisioningConfigApplied() { public boolean isDeviceProvisioningConfigApplied() {
try { try {
return mService.isDeviceProvisioningConfigApplied(); return mService.isDeviceProvisioningConfigApplied();

View File

@@ -17,8 +17,10 @@
package android.hardware.hdmi; package android.hardware.hdmi;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant; import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.SystemService; import android.annotation.SystemService;
@@ -298,6 +300,7 @@ public final class HdmiControlManager {
* See {@link HdmiDeviceInfo#DEVICE_TV} * See {@link HdmiDeviceInfo#DEVICE_TV}
*/ */
@Nullable @Nullable
@SuppressLint("Doclava125")
public HdmiClient getClient(int type) { public HdmiClient getClient(int type) {
if (mService == null) { if (mService == null) {
return null; return null;
@@ -322,6 +325,7 @@ public final class HdmiControlManager {
* @return {@link HdmiPlaybackClient} instance. {@code null} on failure. * @return {@link HdmiPlaybackClient} instance. {@code null} on failure.
*/ */
@Nullable @Nullable
@SuppressLint("Doclava125")
public HdmiPlaybackClient getPlaybackClient() { public HdmiPlaybackClient getPlaybackClient() {
return (HdmiPlaybackClient) getClient(HdmiDeviceInfo.DEVICE_PLAYBACK); return (HdmiPlaybackClient) getClient(HdmiDeviceInfo.DEVICE_PLAYBACK);
} }
@@ -336,6 +340,7 @@ public final class HdmiControlManager {
* @return {@link HdmiTvClient} instance. {@code null} on failure. * @return {@link HdmiTvClient} instance. {@code null} on failure.
*/ */
@Nullable @Nullable
@SuppressLint("Doclava125")
public HdmiTvClient getTvClient() { public HdmiTvClient getTvClient() {
return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV); return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV);
} }
@@ -346,6 +351,7 @@ public final class HdmiControlManager {
* *
* @param isStandbyModeOn target status of the system's standby mode * @param isStandbyModeOn target status of the system's standby mode
*/ */
@RequiresPermission(android.Manifest.permission.HDMI_CEC)
public void setStandbyMode(boolean isStandbyModeOn) { public void setStandbyMode(boolean isStandbyModeOn) {
try { try {
mService.setStandbyMode(isStandbyModeOn); mService.setStandbyMode(isStandbyModeOn);
@@ -406,6 +412,7 @@ public final class HdmiControlManager {
* @param listener {@link HotplugEventListener} instance * @param listener {@link HotplugEventListener} instance
* @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener) * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
*/ */
@RequiresPermission(android.Manifest.permission.HDMI_CEC)
public void addHotplugEventListener(HotplugEventListener listener) { public void addHotplugEventListener(HotplugEventListener listener) {
if (mService == null) { if (mService == null) {
Log.e(TAG, "HdmiControlService is not available"); Log.e(TAG, "HdmiControlService is not available");
@@ -429,6 +436,7 @@ public final class HdmiControlManager {
* *
* @param listener {@link HotplugEventListener} instance to be removed * @param listener {@link HotplugEventListener} instance to be removed
*/ */
@RequiresPermission(android.Manifest.permission.HDMI_CEC)
public void removeHotplugEventListener(HotplugEventListener listener) { public void removeHotplugEventListener(HotplugEventListener listener) {
if (mService == null) { if (mService == null) {
Log.e(TAG, "HdmiControlService is not available"); Log.e(TAG, "HdmiControlService is not available");

View File

@@ -25,6 +25,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SdkConstant; import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.SystemService; import android.annotation.SystemService;
import android.annotation.WorkerThread; import android.annotation.WorkerThread;
@@ -1699,6 +1700,7 @@ public class StorageManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public long getAllocatableBytes(@NonNull UUID storageUuid, public long getAllocatableBytes(@NonNull UUID storageUuid,
@RequiresPermission @AllocateFlags int flags) throws IOException { @RequiresPermission @AllocateFlags int flags) throws IOException {
try { try {
@@ -1713,6 +1715,7 @@ public class StorageManager {
/** @removed */ /** @removed */
@Deprecated @Deprecated
@SuppressLint("Doclava125")
public long getAllocatableBytes(@NonNull File path, public long getAllocatableBytes(@NonNull File path,
@RequiresPermission @AllocateFlags int flags) throws IOException { @RequiresPermission @AllocateFlags int flags) throws IOException {
return getAllocatableBytes(getUuidForPath(path), flags); return getAllocatableBytes(getUuidForPath(path), flags);
@@ -1747,6 +1750,7 @@ public class StorageManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void allocateBytes(@NonNull UUID storageUuid, @BytesLong long bytes, public void allocateBytes(@NonNull UUID storageUuid, @BytesLong long bytes,
@RequiresPermission @AllocateFlags int flags) throws IOException { @RequiresPermission @AllocateFlags int flags) throws IOException {
try { try {
@@ -1760,6 +1764,7 @@ public class StorageManager {
/** @removed */ /** @removed */
@Deprecated @Deprecated
@SuppressLint("Doclava125")
public void allocateBytes(@NonNull File path, @BytesLong long bytes, public void allocateBytes(@NonNull File path, @BytesLong long bytes,
@RequiresPermission @AllocateFlags int flags) throws IOException { @RequiresPermission @AllocateFlags int flags) throws IOException {
allocateBytes(getUuidForPath(path), bytes, flags); allocateBytes(getUuidForPath(path), bytes, flags);
@@ -1796,6 +1801,7 @@ public class StorageManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void allocateBytes(FileDescriptor fd, @BytesLong long bytes, public void allocateBytes(FileDescriptor fd, @BytesLong long bytes,
@RequiresPermission @AllocateFlags int flags) throws IOException { @RequiresPermission @AllocateFlags int flags) throws IOException {
final File file = ParcelFileDescriptor.getFile(fd); final File file = ParcelFileDescriptor.getFile(fd);

View File

@@ -828,6 +828,7 @@ public class LocationManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(LocationRequest request, LocationListener listener, public void requestLocationUpdates(LocationRequest request, LocationListener listener,
Looper looper) { Looper looper) {
checkListener(listener); checkListener(listener);
@@ -856,6 +857,7 @@ public class LocationManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(LocationRequest request, PendingIntent intent) { public void requestLocationUpdates(LocationRequest request, PendingIntent intent) {
checkPendingIntent(intent); checkPendingIntent(intent);
requestLocationUpdates(request, null, null, intent); requestLocationUpdates(request, null, null, intent);

View File

@@ -17,6 +17,7 @@ package android.telecom;
import android.Manifest; import android.Manifest;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc; import android.annotation.SuppressAutoDoc;
import android.annotation.SuppressLint;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.SystemService; import android.annotation.SystemService;
import android.content.ComponentName; import android.content.ComponentName;
@@ -736,6 +737,10 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme) { public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme) {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -817,6 +822,7 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public List<PhoneAccountHandle> getPhoneAccountsForPackage() { public List<PhoneAccountHandle> getPhoneAccountsForPackage() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -944,6 +950,7 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void clearPhoneAccounts() { public void clearPhoneAccounts() {
clearAccounts(); clearAccounts();
} }
@@ -953,6 +960,7 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void clearAccounts() { public void clearAccounts() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -984,6 +992,7 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public ComponentName getDefaultPhoneApp() { public ComponentName getDefaultPhoneApp() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -1200,6 +1209,10 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isRinging() { public boolean isRinging() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -1298,6 +1311,10 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isTtySupported() { public boolean isTtySupported() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
@@ -1576,6 +1593,7 @@ public class TelecomManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void enablePhoneAccount(PhoneAccountHandle handle, boolean isEnabled) { public void enablePhoneAccount(PhoneAccountHandle handle, boolean isEnabled) {
ITelecomService service = getTelecomService(); ITelecomService service = getTelecomService();
if (service != null) { if (service != null) {

View File

@@ -2686,6 +2686,7 @@ public class TelephonyManager {
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@SuppressLint("Doclava125")
public boolean isVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle){ public boolean isVisualVoicemailEnabled(PhoneAccountHandle phoneAccountHandle){
return false; return false;
} }
@@ -2704,6 +2705,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
@Nullable @Nullable
public Bundle getVisualVoicemailSettings(){ public Bundle getVisualVoicemailSettings(){
try { try {
@@ -4927,6 +4929,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public int checkCarrierPrivilegesForPackage(String pkgName) { public int checkCarrierPrivilegesForPackage(String pkgName) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -4942,6 +4945,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) { public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -4993,6 +4997,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void dial(String number) { public void dial(String number) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5045,6 +5050,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void silenceRinger() { public void silenceRinger() {
try { try {
getTelecomService().silenceRinger(getOpPackageName()); getTelecomService().silenceRinger(getOpPackageName());
@@ -5055,6 +5061,10 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isOffhook() { public boolean isOffhook() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5068,6 +5078,10 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isRinging() { public boolean isRinging() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5081,6 +5095,10 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isIdle() { public boolean isIdle() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5094,6 +5112,10 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isRadioOn() { public boolean isRadioOn() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5338,6 +5360,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@SuppressLint("Doclava125")
public void updateServiceLocation() { public void updateServiceLocation() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -5526,6 +5549,10 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
android.Manifest.permission.READ_PHONE_STATE
})
public boolean isVideoCallingEnabled() { public boolean isVideoCallingEnabled() {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();

View File

@@ -2066,6 +2066,7 @@ public class WifiManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
public int getWifiApState() { public int getWifiApState() {
try { try {
return mService.getWifiApEnabledState(); return mService.getWifiApEnabledState();
@@ -2082,6 +2083,7 @@ public class WifiManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
public boolean isWifiApEnabled() { public boolean isWifiApEnabled() {
return getWifiApState() == WIFI_AP_STATE_ENABLED; return getWifiApState() == WIFI_AP_STATE_ENABLED;
} }
@@ -2093,6 +2095,7 @@ public class WifiManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
public WifiConfiguration getWifiApConfiguration() { public WifiConfiguration getWifiApConfiguration() {
try { try {
return mService.getWifiApConfiguration(); return mService.getWifiApConfiguration();
@@ -2108,6 +2111,7 @@ public class WifiManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE)
public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) { public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
try { try {
mService.setWifiApConfiguration(wifiConfig); mService.setWifiApConfiguration(wifiConfig);