summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-12-07 21:21:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-12-07 21:21:32 +0000
commit1ae8c3ec8688fc1414801fcd7c2eca0476ee9e8b (patch)
tree452674149cc778b06b9190c432ba80c1de9b0c6a /core/java/android
parent5cca310adec35bead8f94f9dc1e688450e38370d (diff)
parent151da5b2bc39cc31bbddbda15972a3bbc2f7c9a7 (diff)
Merge "Store CDM device profile and apply role when device is connected"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java2
-rw-r--r--core/java/android/companion/Association.java46
2 files changed, 40 insertions, 8 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index c07cd52c581e..1713a0c158c3 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -3689,7 +3689,7 @@ public final class BluetoothAdapter {
*
* @hide
*/
- public abstract class BluetoothConnectionCallback {
+ public abstract static class BluetoothConnectionCallback {
/**
* Callback triggered when a bluetooth device (classic or BLE) is connected
* @param device is the connected bluetooth device
diff --git a/core/java/android/companion/Association.java b/core/java/android/companion/Association.java
index 06a3f2f08bab..17bf11b3d4ef 100644
--- a/core/java/android/companion/Association.java
+++ b/core/java/android/companion/Association.java
@@ -37,6 +37,8 @@ public final class Association implements Parcelable {
private final @UserIdInt int mUserId;
private final @NonNull String mDeviceMacAddress;
private final @NonNull String mPackageName;
+ private final @Nullable String mDeviceProfile;
+ private final boolean mKeepProfilePrivilegesWhenDeviceAway;
/** @hide */
public int getUserId() {
@@ -45,7 +47,7 @@ public final class Association implements Parcelable {
- // Code below generated by codegen v1.0.15.
+ // Code below generated by codegen v1.0.21.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -67,7 +69,9 @@ public final class Association implements Parcelable {
public Association(
@UserIdInt int userId,
@NonNull String deviceMacAddress,
- @NonNull String packageName) {
+ @NonNull String packageName,
+ @Nullable String deviceProfile,
+ boolean keepProfilePrivilegesWhenDeviceAway) {
this.mUserId = userId;
com.android.internal.util.AnnotationValidations.validate(
UserIdInt.class, null, mUserId);
@@ -77,6 +81,8 @@ public final class Association implements Parcelable {
this.mPackageName = packageName;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mPackageName);
+ this.mDeviceProfile = deviceProfile;
+ this.mKeepProfilePrivilegesWhenDeviceAway = keepProfilePrivilegesWhenDeviceAway;
// onConstructed(); // You can define this method to get a callback
}
@@ -91,6 +97,16 @@ public final class Association implements Parcelable {
return mPackageName;
}
+ @DataClass.Generated.Member
+ public @Nullable String getDeviceProfile() {
+ return mDeviceProfile;
+ }
+
+ @DataClass.Generated.Member
+ public boolean isKeepProfilePrivilegesWhenDeviceAway() {
+ return mKeepProfilePrivilegesWhenDeviceAway;
+ }
+
@Override
@DataClass.Generated.Member
public String toString() {
@@ -100,7 +116,9 @@ public final class Association implements Parcelable {
return "Association { " +
"userId = " + mUserId + ", " +
"deviceMacAddress = " + mDeviceMacAddress + ", " +
- "packageName = " + mPackageName +
+ "packageName = " + mPackageName + ", " +
+ "deviceProfile = " + mDeviceProfile + ", " +
+ "keepProfilePrivilegesWhenDeviceAway = " + mKeepProfilePrivilegesWhenDeviceAway +
" }";
}
@@ -119,7 +137,9 @@ public final class Association implements Parcelable {
return true
&& mUserId == that.mUserId
&& Objects.equals(mDeviceMacAddress, that.mDeviceMacAddress)
- && Objects.equals(mPackageName, that.mPackageName);
+ && Objects.equals(mPackageName, that.mPackageName)
+ && Objects.equals(mDeviceProfile, that.mDeviceProfile)
+ && mKeepProfilePrivilegesWhenDeviceAway == that.mKeepProfilePrivilegesWhenDeviceAway;
}
@Override
@@ -132,6 +152,8 @@ public final class Association implements Parcelable {
_hash = 31 * _hash + mUserId;
_hash = 31 * _hash + Objects.hashCode(mDeviceMacAddress);
_hash = 31 * _hash + Objects.hashCode(mPackageName);
+ _hash = 31 * _hash + Objects.hashCode(mDeviceProfile);
+ _hash = 31 * _hash + Boolean.hashCode(mKeepProfilePrivilegesWhenDeviceAway);
return _hash;
}
@@ -141,9 +163,14 @@ public final class Association implements Parcelable {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
+ byte flg = 0;
+ if (mKeepProfilePrivilegesWhenDeviceAway) flg |= 0x10;
+ if (mDeviceProfile != null) flg |= 0x8;
+ dest.writeByte(flg);
dest.writeInt(mUserId);
dest.writeString(mDeviceMacAddress);
dest.writeString(mPackageName);
+ if (mDeviceProfile != null) dest.writeString(mDeviceProfile);
}
@Override
@@ -157,9 +184,12 @@ public final class Association implements Parcelable {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
+ byte flg = in.readByte();
+ boolean keepProfilePrivilegesWhenDeviceAway = (flg & 0x10) != 0;
int userId = in.readInt();
String deviceMacAddress = in.readString();
String packageName = in.readString();
+ String deviceProfile = (flg & 0x8) == 0 ? null : in.readString();
this.mUserId = userId;
com.android.internal.util.AnnotationValidations.validate(
@@ -170,6 +200,8 @@ public final class Association implements Parcelable {
this.mPackageName = packageName;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mPackageName);
+ this.mDeviceProfile = deviceProfile;
+ this.mKeepProfilePrivilegesWhenDeviceAway = keepProfilePrivilegesWhenDeviceAway;
// onConstructed(); // You can define this method to get a callback
}
@@ -189,10 +221,10 @@ public final class Association implements Parcelable {
};
@DataClass.Generated(
- time = 1599083149942L,
- codegenVersion = "1.0.15",
+ time = 1606940835778L,
+ codegenVersion = "1.0.21",
sourceFile = "frameworks/base/core/java/android/companion/Association.java",
- inputSignatures = "private final @android.annotation.UserIdInt int mUserId\nprivate final @android.annotation.NonNull java.lang.String mDeviceMacAddress\nprivate final @android.annotation.NonNull java.lang.String mPackageName\npublic int getUserId()\nclass Association extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genHiddenConstructor=true)")
+ inputSignatures = "private final @android.annotation.UserIdInt int mUserId\nprivate final @android.annotation.NonNull java.lang.String mDeviceMacAddress\nprivate final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.Nullable java.lang.String mDeviceProfile\nprivate final boolean mKeepProfilePrivilegesWhenDeviceAway\npublic int getUserId()\nclass Association extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genHiddenConstructor=true)")
@Deprecated
private void __metadata() {}