Add getter to CarPowerPolicyFilter
- API linter complains about lack of getComponents().
- This CL adds getComponents() and declares components field as private.
Bug: 184910360
CTS-Coverage-Bug: 184910360
Test: atest CarPowerManagerTest CarPowerManagementServiceUnitTest
PowerComponentUtilUnitTest
Change-Id: I76b635ee0c70e7031a11d6f494fe9a0e7539ef98
diff --git a/service/src/com/android/car/BluetoothDeviceConnectionPolicy.java b/service/src/com/android/car/BluetoothDeviceConnectionPolicy.java
index e2a8495..7b084f8 100644
--- a/service/src/com/android/car/BluetoothDeviceConnectionPolicy.java
+++ b/service/src/com/android/car/BluetoothDeviceConnectionPolicy.java
@@ -320,7 +320,7 @@
CarPowerManagementService.class);
if (cpms != null) {
CarPowerPolicyFilter filter = new CarPowerPolicyFilter.Builder()
- .setComponents(new int[]{PowerComponent.BLUETOOTH}).build();
+ .setComponents(PowerComponent.BLUETOOTH).build();
cpms.addPowerPolicyListener(filter, mPowerPolicyListener);
} else {
Slog.w(TAG, "Cannot find CarPowerManagementService");
diff --git a/service/src/com/android/car/audio/CarAudioPowerListener.java b/service/src/com/android/car/audio/CarAudioPowerListener.java
index b946745..eed53cb 100644
--- a/service/src/com/android/car/audio/CarAudioPowerListener.java
+++ b/service/src/com/android/car/audio/CarAudioPowerListener.java
@@ -83,7 +83,7 @@
}
CarPowerPolicyFilter filter = new CarPowerPolicyFilter.Builder()
- .setComponents(new int[]{AUDIO}).build();
+ .setComponents(AUDIO).build();
mCarPowerManagementService.addPowerPolicyListener(filter, mChangeListener);
initializePowerState();
}