aboutsummaryrefslogtreecommitdiff
path: root/framework/java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/java')
-rw-r--r--framework/java/android/bluetooth/BluetoothA2dp.java15
-rw-r--r--framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java21
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java3
-rw-r--r--framework/java/android/bluetooth/BluetoothHeadsetClientCall.java25
-rw-r--r--framework/java/android/bluetooth/le/TruncatedFilter.java3
5 files changed, 44 insertions, 23 deletions
diff --git a/framework/java/android/bluetooth/BluetoothA2dp.java b/framework/java/android/bluetooth/BluetoothA2dp.java
index 5175490116..767f59eb12 100644
--- a/framework/java/android/bluetooth/BluetoothA2dp.java
+++ b/framework/java/android/bluetooth/BluetoothA2dp.java
@@ -22,6 +22,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
+import android.media.AudioManager;
import android.os.IBinder;
import android.os.ParcelUuid;
import android.os.RemoteException;
@@ -199,7 +200,8 @@ public final class BluetoothA2dp implements BluetoothProfile {
}
public void finalize() {
- close();
+ // The empty finalize needs to be kept or the
+ // cts signature tests would fail.
}
/**
* Initiate connection to a profile of the remote bluetooth device.
@@ -414,9 +416,16 @@ public final class BluetoothA2dp implements BluetoothProfile {
}
/**
- * Tells remote device to adjust volume. Only if absolute volume is supported.
+ * Tells remote device to adjust volume. Only if absolute volume is
+ * supported. Uses the following values:
+ * <ul>
+ * <li>{@link AudioManager#ADJUST_LOWER}</li>
+ * <li>{@link AudioManager#ADJUST_RAISE}</li>
+ * <li>{@link AudioManager#ADJUST_MUTE}</li>
+ * <li>{@link AudioManager#ADJUST_UNMUTE}</li>
+ * </ul>
*
- * @param direction 1 to increase volume, or -1 to decrease volume
+ * @param direction One of the supported adjust values.
* @hide
*/
public void adjustAvrcpAbsoluteVolume(int direction) {
diff --git a/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java b/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
index ce87329ee4..161c339e78 100644
--- a/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
+++ b/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
@@ -26,32 +26,32 @@ import android.os.Parcelable;
* @hide
*/
public final class BluetoothActivityEnergyInfo implements Parcelable {
+ private final long mTimestamp;
private final int mBluetoothStackState;
private final int mControllerTxTimeMs;
private final int mControllerRxTimeMs;
private final int mControllerIdleTimeMs;
private final int mControllerEnergyUsed;
- private final long timestamp;
public static final int BT_STACK_STATE_INVALID = 0;
public static final int BT_STACK_STATE_STATE_ACTIVE = 1;
public static final int BT_STACK_STATE_STATE_SCANNING = 2;
public static final int BT_STACK_STATE_STATE_IDLE = 3;
- public BluetoothActivityEnergyInfo(int stackState, int txTime, int rxTime,
- int idleTime, int energyUsed) {
+ public BluetoothActivityEnergyInfo(long timestamp, int stackState,
+ int txTime, int rxTime, int idleTime, int energyUsed) {
+ mTimestamp = timestamp;
mBluetoothStackState = stackState;
mControllerTxTimeMs = txTime;
mControllerRxTimeMs = rxTime;
mControllerIdleTimeMs = idleTime;
mControllerEnergyUsed = energyUsed;
- timestamp = System.currentTimeMillis();
}
@Override
public String toString() {
return "BluetoothActivityEnergyInfo{"
- + " timestamp=" + timestamp
+ + " mTimestamp=" + mTimestamp
+ " mBluetoothStackState=" + mBluetoothStackState
+ " mControllerTxTimeMs=" + mControllerTxTimeMs
+ " mControllerRxTimeMs=" + mControllerRxTimeMs
@@ -63,13 +63,14 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
public static final Parcelable.Creator<BluetoothActivityEnergyInfo> CREATOR =
new Parcelable.Creator<BluetoothActivityEnergyInfo>() {
public BluetoothActivityEnergyInfo createFromParcel(Parcel in) {
+ long timestamp = in.readLong();
int stackState = in.readInt();
int txTime = in.readInt();
int rxTime = in.readInt();
int idleTime = in.readInt();
int energyUsed = in.readInt();
- return new BluetoothActivityEnergyInfo(stackState, txTime, rxTime,
- idleTime, energyUsed);
+ return new BluetoothActivityEnergyInfo(timestamp, stackState,
+ txTime, rxTime, idleTime, energyUsed);
}
public BluetoothActivityEnergyInfo[] newArray(int size) {
return new BluetoothActivityEnergyInfo[size];
@@ -77,6 +78,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
};
public void writeToParcel(Parcel out, int flags) {
+ out.writeLong(mTimestamp);
out.writeInt(mBluetoothStackState);
out.writeInt(mControllerTxTimeMs);
out.writeInt(mControllerRxTimeMs);
@@ -123,11 +125,12 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
public int getControllerEnergyUsed() {
return mControllerEnergyUsed;
}
+
/**
- * @return timestamp(wall clock) of record creation
+ * @return timestamp(real time elapsed in milliseconds since boot) of record creation.
*/
public long getTimeStamp() {
- return timestamp;
+ return mTimestamp;
}
/**
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index ee055a5d50..edb768d0e1 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -27,9 +27,7 @@ import android.bluetooth.le.ScanRecord;
import android.bluetooth.le.ScanResult;
import android.bluetooth.le.ScanSettings;
import android.content.Context;
-import android.os.Handler;
import android.os.IBinder;
-import android.os.Looper;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -37,7 +35,6 @@ import android.util.Log;
import android.util.Pair;
import java.io.IOException;
-import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
diff --git a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
index a15bd975ad..7b5a045e27 100644
--- a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
+++ b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
@@ -61,6 +61,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
*/
public static final int CALL_STATE_TERMINATED = 7;
+ private final BluetoothDevice mDevice;
private final int mId;
private int mState;
private String mNumber;
@@ -70,8 +71,9 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
/**
* Creates BluetoothHeadsetClientCall instance.
*/
- public BluetoothHeadsetClientCall(int id, int state, String number, boolean multiParty,
- boolean outgoing) {
+ public BluetoothHeadsetClientCall(BluetoothDevice device, int id, int state, String number,
+ boolean multiParty, boolean outgoing) {
+ mDevice = device;
mId = id;
mState = state;
mNumber = number != null ? number : "";
@@ -114,6 +116,15 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
}
/**
+ * Gets call's device.
+ *
+ * @return call device.
+ */
+ public BluetoothDevice getDevice() {
+ return mDevice;
+ }
+
+ /**
* Gets call's Id.
*
* @return call id.
@@ -161,7 +172,9 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
}
public String toString() {
- StringBuilder builder = new StringBuilder("BluetoothHeadsetClientCall{mId: ");
+ StringBuilder builder = new StringBuilder("BluetoothHeadsetClientCall{mDevice: ");
+ builder.append(mDevice);
+ builder.append(", mId: ");
builder.append(mId);
builder.append(", mState: ");
switch (mState) {
@@ -192,8 +205,9 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
new Parcelable.Creator<BluetoothHeadsetClientCall>() {
@Override
public BluetoothHeadsetClientCall createFromParcel(Parcel in) {
- return new BluetoothHeadsetClientCall(in.readInt(), in.readInt(),
- in.readString(), in.readInt() == 1, in.readInt() == 1);
+ return new BluetoothHeadsetClientCall((BluetoothDevice)in.readParcelable(null),
+ in.readInt(), in.readInt(), in.readString(),
+ in.readInt() == 1, in.readInt() == 1);
}
@Override
@@ -204,6 +218,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
@Override
public void writeToParcel(Parcel out, int flags) {
+ out.writeParcelable(mDevice, 0);
out.writeInt(mId);
out.writeInt(mState);
out.writeString(mNumber);
diff --git a/framework/java/android/bluetooth/le/TruncatedFilter.java b/framework/java/android/bluetooth/le/TruncatedFilter.java
index 6a6b3e3c32..685b1748f9 100644
--- a/framework/java/android/bluetooth/le/TruncatedFilter.java
+++ b/framework/java/android/bluetooth/le/TruncatedFilter.java
@@ -17,9 +17,6 @@
package android.bluetooth.le;
import android.annotation.SystemApi;
-import android.os.Parcel;
-import android.os.Parcelable;
-
import java.util.List;
/**