[CPMS] Fixed issue with immediate CompletableFuture completion
Test: Manual
Bug: 117898294
Change-Id: I7c703ef5302973da65b4180b3f68afe7bc5f13f6
(cherry picked from commit 8f0742d54e1602339500f963e706feffe1384b5d)
diff --git a/car_product/build/car.mk b/car_product/build/car.mk
index cdad5b0..405f461 100644
--- a/car_product/build/car.mk
+++ b/car_product/build/car.mk
@@ -40,7 +40,6 @@
VmsSubscriberClientSample \
android.car.cluster.loggingrenderer \
DirectRenderingClusterSample \
- com.android.car.powertestservice \
GarageModeTestApp \
# SEPolicy for test apps / services
diff --git a/service/src/com/android/car/CarPowerManagementService.java b/service/src/com/android/car/CarPowerManagementService.java
index ce65e0f..5c744eb 100644
--- a/service/src/com/android/car/CarPowerManagementService.java
+++ b/service/src/com/android/car/CarPowerManagementService.java
@@ -344,8 +344,8 @@
int token = 0;
ICarPowerStateListener listener = mPowerManagerListeners.getBroadcastItem(i);
if (useTokens) {
- listener.onStateChanged(newState, mTokenValue);
mPowerManagerListenerTokens.put(listener.asBinder(), mTokenValue);
+ listener.onStateChanged(newState, mTokenValue);
mTokenValue++;
} else {
listener.onStateChanged(newState, 0);