summaryrefslogtreecommitdiff
path: root/framework/java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-03-10 19:13:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-10 19:13:52 +0000
commit3e9696658502b51efee1efd90e3a8b5a4d6a7ebd (patch)
tree07a890725b63e2db663bc28bf4e9b631cde96e01 /framework/java
parent7747345d0120e68ef53ab5d6e34a86ea734c5337 (diff)
parent1ca15d954d4754b59d2108b7dbad3b71e707eca8 (diff)
Merge "Update permissions of BluetoothPan System APIs and re-hide some APIs that do not need to be System APIs."
Diffstat (limited to 'framework/java')
-rw-r--r--framework/java/android/bluetooth/BluetoothPan.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/framework/java/android/bluetooth/BluetoothPan.java b/framework/java/android/bluetooth/BluetoothPan.java
index ec63fd058b..7af770e69e 100644
--- a/framework/java/android/bluetooth/BluetoothPan.java
+++ b/framework/java/android/bluetooth/BluetoothPan.java
@@ -174,8 +174,9 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
/**
* Closes the connection to the service and unregisters callbacks
+ *
+ * @hide
*/
- @RequiresPermission(Manifest.permission.BLUETOOTH)
public void close() {
if (VDBG) log("close()");
mProfileConnector.disconnect();
@@ -185,7 +186,7 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
return mProfileConnector.getService();
}
- @RequiresPermission(Manifest.permission.BLUETOOTH)
+ /** @hide */
protected void finalize() {
if (mCloseGuard != null) {
mCloseGuard.warnIfOpen();
@@ -280,7 +281,7 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
* @hide
*/
@SystemApi
- @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
@ConnectionPolicy int connectionPolicy) {
if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")");
@@ -304,8 +305,11 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
/**
* {@inheritDoc}
+ * @hide
*/
+ @SystemApi
@Override
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public @NonNull List<BluetoothDevice> getConnectedDevices() {
if (VDBG) log("getConnectedDevices()");
final IBluetoothPan service = getService();
@@ -344,9 +348,11 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
/**
* {@inheritDoc}
+ * @hide
*/
+ @SystemApi
@Override
- @RequiresPermission(Manifest.permission.BLUETOOTH)
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public int getConnectionState(@Nullable BluetoothDevice device) {
if (VDBG) log("getState(" + device + ")");
final IBluetoothPan service = getService();
@@ -366,8 +372,10 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
* Turns on/off bluetooth tethering
*
* @param value is whether to enable or disable bluetooth tethering
+ * @hide
*/
- @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+ @SystemApi
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public void setBluetoothTethering(boolean value) {
String pkgName = mContext.getOpPackageName();
if (DBG) log("setBluetoothTethering(" + value + "), calling package:" + pkgName);
@@ -385,8 +393,10 @@ public final class BluetoothPan implements BluetoothProfile, AutoCloseable {
* Determines whether tethering is enabled
*
* @return true if tethering is on, false if not or some error occurred
+ * @hide
*/
- @RequiresPermission(Manifest.permission.BLUETOOTH)
+ @SystemApi
+ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean isTetheringOn() {
if (VDBG) log("isTetheringOn()");
final IBluetoothPan service = getService();