Snap for 8426163 from 019f1c532c13cf47f5fc3e935bbd497dd13f1602 to mainline-tzdata2-release
Change-Id: I485b43871f2ecf846154209198f5d59f88217584
diff --git a/Android.bp b/Android.bp
index 01a9950..aaef313 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12,25 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
java_sdk_library {
name: "com.android.libraries.tv.tvsystem",
srcs: ["java/**/*.java"],
api_packages: [
"com.android.libraries.tv.tvsystem",
"com.android.libraries.tv.tvsystem.display",
- "com.android.libraries.tv.tvsystem.media",
"com.android.libraries.tv.tvsystem.pm",
"com.android.libraries.tv.tvsystem.user",
"com.android.libraries.tv.tvsystem.wifi"
],
dex_preopt: {
enabled: false,
- },
- system_ext_specific: true,
- no_dist: true,
- unsafe_ignore_missing_latest_api: true
+ }
}
+
diff --git a/OWNERS b/OWNERS
deleted file mode 100644
index 7b9d1be..0000000
--- a/OWNERS
+++ /dev/null
@@ -1,9 +0,0 @@
-# Primary maintainer
-robhor@google.com
-
-# Additional maintainers
-galinap@google.com
-philipjunker@google.com
-rgl@google.com
-sergeynv@google.com
-valiiftime@google.com
diff --git a/api/current.txt b/api/current.txt
index fde8b7f..09cb6e8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2,18 +2,13 @@
package com.android.libraries.tv.tvsystem.display {
public final class DeviceProductInfo {
- ctor @Deprecated public DeviceProductInfo(String, String, String, Integer, com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate, int[]);
- method public int getConnectionToSinkType();
+ ctor public DeviceProductInfo(String, String, String, Integer, com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate, int[]);
method public com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate getManufactureDate();
method public String getManufacturerPnpId();
method public Integer getModelYear();
method public String getName();
method public String getProductId();
- method @Deprecated public int[] getRelativeAddress();
- field public static final int CONNECTION_TO_SINK_BUILT_IN = 1; // 0x1
- field public static final int CONNECTION_TO_SINK_DIRECT = 2; // 0x2
- field public static final int CONNECTION_TO_SINK_TRANSITIVE = 3; // 0x3
- field public static final int CONNECTION_TO_SINK_UNKNOWN = 0; // 0x0
+ method public int[] getRelativeAddress();
}
public static class DeviceProductInfo.ManufactureDate {
diff --git a/api/system-current.txt b/api/system-current.txt
index dbd0cc2..aa0d1db 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1,24 +1,4 @@
// Signature format: 2.0
-package com.android.libraries.tv.tvsystem.media {
-
- public final class AudioDeviceAttributes {
- ctor public AudioDeviceAttributes(@NonNull android.media.AudioDeviceInfo);
- ctor public AudioDeviceAttributes(int, int, @NonNull String);
- method @NonNull public String getAddress();
- method public int getRole();
- method public int getType();
- field public static final int ROLE_INPUT = 1; // 0x1
- field public static final int ROLE_OUTPUT = 2; // 0x2
- }
-
- public final class TvAudioManager {
- ctor public TvAudioManager(@NonNull android.content.Context);
- method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getDeviceVolumeBehavior(@NonNull com.android.libraries.tv.tvsystem.media.AudioDeviceAttributes);
- method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setDeviceVolumeBehavior(@NonNull com.android.libraries.tv.tvsystem.media.AudioDeviceAttributes, int);
- }
-
-}
-
package com.android.libraries.tv.tvsystem.wifi {
public final class SoftApConfiguration implements android.os.Parcelable {
diff --git a/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java b/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java
index fb0bf71..6e78253 100644
--- a/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java
+++ b/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java
@@ -16,10 +16,7 @@
package com.android.libraries.tv.tvsystem.display;
-import android.annotation.IntDef;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
+import java.util.Arrays;
import java.util.Objects;
/**
@@ -28,39 +25,13 @@
* product information about the intermediate device.
*/
public final class DeviceProductInfo {
- /** @hide */
- @IntDef(prefix = {"CONNECTION_TO_SINK_"}, value = {
- CONNECTION_TO_SINK_UNKNOWN,
- CONNECTION_TO_SINK_BUILT_IN,
- CONNECTION_TO_SINK_DIRECT,
- CONNECTION_TO_SINK_TRANSITIVE
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface ConnectionToSinkType { }
-
- /** The device connection to the display sink is unknown. */
- public static final int CONNECTION_TO_SINK_UNKNOWN = 0;
-
- /** The display sink is built-in to the device */
- public static final int CONNECTION_TO_SINK_BUILT_IN = 1;
-
- /** The device is directly connected to the display sink. */
- public static final int CONNECTION_TO_SINK_DIRECT = 2;
-
- /** The device is transitively connected to the display sink. */
- public static final int CONNECTION_TO_SINK_TRANSITIVE = 3;
-
private final String mName;
private final String mManufacturerPnpId;
private final String mProductId;
private final Integer mModelYear;
private final ManufactureDate mManufactureDate;
- private final @ConnectionToSinkType int mConnectionToSinkType;
+ private final int[] mRelativeAddress;
- /** @deprecated use
- * {@link #DeviceProductInfo(String, String, String, Integer, ManufactureDate, int)} ()}
- * instead.*/
- @Deprecated
public DeviceProductInfo(
String name,
String manufacturerPnpId,
@@ -73,23 +44,7 @@
this.mProductId = productId;
this.mModelYear = modelYear;
this.mManufactureDate = manufactureDate;
- this.mConnectionToSinkType = CONNECTION_TO_SINK_UNKNOWN;
- }
-
- /** @hide */
- public DeviceProductInfo(
- String name,
- String manufacturerPnpId,
- String productId,
- Integer modelYear,
- ManufactureDate manufactureDate,
- int connectionToSinkType) {
- this.mName = name;
- this.mManufacturerPnpId = manufacturerPnpId;
- this.mProductId = productId;
- this.mModelYear = modelYear;
- this.mManufactureDate = manufactureDate;
- this.mConnectionToSinkType = connectionToSinkType;
+ this.mRelativeAddress = relativeAddress;
}
/**
@@ -132,21 +87,9 @@
/**
* @return Relative address in the display network. For example, for HDMI connected devices this
* can be its physical address. Each component of the address is in the range [0, 255].
- *
- * @deprecated use {@link #getConnectionToSinkType()} instead.
*/
- @Deprecated
public int[] getRelativeAddress() {
- return null;
- }
-
- /**
- * @return How the current device is connected to the display sink. For example, the display
- * can be connected immediately to the device or there can be a receiver in between.
- */
- @ConnectionToSinkType
- public int getConnectionToSinkType() {
- return mConnectionToSinkType;
+ return mRelativeAddress;
}
@Override
@@ -162,8 +105,8 @@
+ mModelYear
+ ", manufactureDate="
+ mManufactureDate
- + ", connectionToSinkType="
- + mConnectionToSinkType
+ + ", relativeAddress="
+ + Arrays.toString(mRelativeAddress)
+ '}';
}
@@ -177,13 +120,13 @@
&& Objects.equals(mProductId, that.mProductId)
&& Objects.equals(mModelYear, that.mModelYear)
&& Objects.equals(mManufactureDate, that.mManufactureDate)
- && mConnectionToSinkType == that.mConnectionToSinkType;
+ && Arrays.equals(mRelativeAddress, that.mRelativeAddress);
}
@Override
public int hashCode() {
return Objects.hash(mName, mManufacturerPnpId, mProductId, mModelYear, mManufactureDate,
- mConnectionToSinkType);
+ mRelativeAddress);
}
/**
diff --git a/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java b/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java
index 746f90b..fb19f98 100644
--- a/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java
+++ b/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java
@@ -64,7 +64,7 @@
}
return new DeviceProductInfo(info.getName(), info.getManufacturerPnpId(),
info.getProductId(), info.getModelYear(), manufactureDate,
- info.getConnectionToSinkType());
+ info.getRelativeAddress());
}
private DisplayCompatUtil() {}
diff --git a/java/com/android/libraries/tv/tvsystem/media/AudioDeviceAttributes.java b/java/com/android/libraries/tv/tvsystem/media/AudioDeviceAttributes.java
deleted file mode 100644
index 581d189..0000000
--- a/java/com/android/libraries/tv/tvsystem/media/AudioDeviceAttributes.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.libraries.tv.tvsystem.media;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.SystemApi;
-import android.media.AudioDeviceInfo;
-import android.media.AudioPort;
-import android.media.AudioSystem;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.Objects;
-
-/**
- * @hide
- * Class to represent the attributes of an audio device: its type (speaker, headset...), address
- * (if known) and role (input, output).
- * <p>Unlike {@link AudioDeviceInfo}, the device
- * doesn't need to be connected to be uniquely identified, it can
- * for instance represent a specific A2DP headset even after a
- * disconnection, whereas the corresponding <code>AudioDeviceInfo</code>
- * would then be invalid.
- * <p>While creating / obtaining an instance is not protected by a
- * permission, APIs using one rely on MODIFY_AUDIO_ROUTING.
- */
-@SystemApi
-public final class AudioDeviceAttributes {
-
- /**
- * A role identifying input devices, such as microphones.
- */
- public static final int ROLE_INPUT = AudioPort.ROLE_SOURCE;
- /**
- * A role identifying output devices, such as speakers or headphones.
- */
- public static final int ROLE_OUTPUT = AudioPort.ROLE_SINK;
-
- /** @hide */
- @IntDef(flag = false, prefix = "ROLE_", value = {
- ROLE_INPUT, ROLE_OUTPUT }
- )
- @Retention(RetentionPolicy.SOURCE)
- public @interface Role {}
-
- /**
- * The audio device type, as defined in {@link AudioDeviceInfo}
- */
- private final @AudioDeviceInfo.AudioDeviceType int mType;
- /**
- * The unique address of the device. Some devices don't have addresses, only an empty string.
- */
- private final @NonNull String mAddress;
-
- /**
- * Is input or output device
- */
- private final @AudioDeviceAttributes.Role
- int mRole;
-
- /**
- * @hide
- * Constructor from a valid {@link AudioDeviceInfo}
- * @param deviceInfo the connected audio device from which to obtain the device-identifying
- * type and address.
- */
- @SystemApi
- public AudioDeviceAttributes(@NonNull AudioDeviceInfo deviceInfo) {
- Objects.requireNonNull(deviceInfo);
- mRole = deviceInfo.isSink() ? ROLE_OUTPUT : ROLE_INPUT;
- mType = deviceInfo.getType();
- mAddress = deviceInfo.getAddress();
- }
-
- /**
- * @hide
- * Constructor from role, device type and address
- * @param role indicates input or output role
- * @param type the device type, as defined in {@link AudioDeviceInfo}
- * @param address the address of the device, or an empty string for devices without one
- */
- @SystemApi
- public AudioDeviceAttributes(@AudioDeviceAttributes.Role int role,
- @AudioDeviceInfo.AudioDeviceType int type,
- @NonNull String address) {
- Objects.requireNonNull(address);
- if (role != ROLE_OUTPUT && role != ROLE_INPUT) {
- throw new IllegalArgumentException("Invalid role " + role);
- }
-
- mRole = role;
- mType = type;
- mAddress = address;
- }
-
- /*package*/ AudioDeviceAttributes(int nativeType, @NonNull String address) {
- mRole = (nativeType & AudioSystem.DEVICE_BIT_IN) != 0 ? ROLE_INPUT : ROLE_OUTPUT;
- mType = AudioDeviceInfo.convertInternalDeviceToDeviceType(nativeType);
- mAddress = address;
- }
-
- /**
- * @hide
- * Returns the role of a device
- * @return the role
- */
- @SystemApi
- public @AudioDeviceAttributes.Role
- int getRole() {
- return mRole;
- }
-
- /**
- * @hide
- * Returns the audio device type of a device
- * @return the type, as defined in {@link AudioDeviceInfo}
- */
- @SystemApi
- public @AudioDeviceInfo.AudioDeviceType int getType() {
- return mType;
- }
-
- /**
- * @hide
- * Returns the address of the audio device, or an empty string for devices without one
- * @return the device address
- */
- @SystemApi
- public @NonNull String getAddress() {
- return mAddress;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mRole, mType, mAddress);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- AudioDeviceAttributes that = (AudioDeviceAttributes) o;
- return ((mRole == that.mRole)
- && (mType == that.mType)
- && mAddress.equals(that.mAddress));
- }
-
- /** @hide */
- public static String roleToString(@AudioDeviceAttributes.Role int role) {
- return (role == ROLE_OUTPUT ? "output" : "input");
- }
-
- @Override
- public String toString() {
- return new String("AudioDeviceAttributes:"
- + " role:" + roleToString(mRole)
- + " type:" + (mRole == ROLE_OUTPUT ? AudioSystem.getOutputDeviceName(
- AudioDeviceInfo.convertDeviceTypeToInternalDevice(mType))
- : AudioSystem.getInputDeviceName(
- AudioDeviceInfo.convertDeviceTypeToInternalDevice(mType)))
- + " addr:" + mAddress);
- }
-}
diff --git a/java/com/android/libraries/tv/tvsystem/media/TvAudioManager.java b/java/com/android/libraries/tv/tvsystem/media/TvAudioManager.java
deleted file mode 100644
index 7b18200..0000000
--- a/java/com/android/libraries/tv/tvsystem/media/TvAudioManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.libraries.tv.tvsystem.media;
-
-
-import android.annotation.NonNull;
-import android.annotation.RequiresPermission;
-import android.annotation.SystemApi;
-import android.content.Context;
-import android.media.AudioManager;
-
-/**
- * Provides access to APIs in {@link AudioManager} that are otherwise @hidden.
- *
- * @hide
- */
-@SystemApi
-public final class TvAudioManager {
-
- private final AudioManager mAudioManager;
-
- public TvAudioManager(@NonNull Context context) {
- mAudioManager = context.getSystemService(AudioManager.class);
- }
-
- /**
- * @hide
- * Sets the volume behavior for an audio output device.
- * @see AudioManager#DEVICE_VOLUME_BEHAVIOR_VARIABLE
- * @see AudioManager#DEVICE_VOLUME_BEHAVIOR_FULL
- * @see AudioManager#DEVICE_VOLUME_BEHAVIOR_FIXED
- * @see AudioManager#DEVICE_VOLUME_BEHAVIOR_ABSOLUTE
- * @see AudioManager#DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_MULTI_MODE
- * @param device the device to be affected
- * @param deviceVolumeBehavior one of the device behaviors
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING)
- public void setDeviceVolumeBehavior(@NonNull AudioDeviceAttributes device,
- @AudioManager.DeviceVolumeBehavior int deviceVolumeBehavior) {
- android.media.AudioDeviceAttributes audioDeviceAttributes =
- new android.media.AudioDeviceAttributes(device.getRole(), device.getType(),
- device.getAddress());
- mAudioManager.setDeviceVolumeBehavior(audioDeviceAttributes, deviceVolumeBehavior);
- }
-
- /**
- * @hide
- * Returns the volume device behavior for the given audio device
- * @param device the audio device
- * @return the volume behavior for the device
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING)
- public @AudioManager.DeviceVolumeBehavior
- int getDeviceVolumeBehavior(@NonNull AudioDeviceAttributes device) {
- android.media.AudioDeviceAttributes audioDeviceAttributes =
- new android.media.AudioDeviceAttributes(device.getRole(), device.getType(),
- device.getAddress());
- return mAudioManager.getDeviceVolumeBehavior(audioDeviceAttributes);
- }
-}
diff --git a/java/com/android/libraries/tv/tvsystem/wifi/SoftApConfiguration.java b/java/com/android/libraries/tv/tvsystem/wifi/SoftApConfiguration.java
index 2bc81af..a467965 100644
--- a/java/com/android/libraries/tv/tvsystem/wifi/SoftApConfiguration.java
+++ b/java/com/android/libraries/tv/tvsystem/wifi/SoftApConfiguration.java
@@ -208,8 +208,7 @@
@NonNull
public Builder setBssid(@Nullable MacAddress bssid) {
if (bssid != null) {
- Preconditions.checkArgument(!bssid.equals(
- MacAddress.fromString("00:00:00:00:00:00")));
+ Preconditions.checkArgument(!bssid.equals(MacAddress.ALL_ZEROS_ADDRESS));
Preconditions.checkArgument(!bssid.equals(MacAddress.BROADCAST_ADDRESS));
}
mBssid = bssid;