From a2d87d81c6075a0edb38d1439bab8f34c3cc8d3c Mon Sep 17 00:00:00 2001 From: Brad Stenning Date: Thu, 24 Jan 2019 12:33:10 -0800 Subject: [PATCH] Moving the device provisioned callback to the correct thread. Test: manual Bug: 116479940 Change-Id: I4cfdfac7d949ac177b7bc9da066e7497506c971c (cherry picked from commit 2f6f9984aba0516f3a665d8ad98c79168e05a1b6) --- .../systemui/statusbar/car/CarStatusBar.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index dbddf71d342c1..b37c5e69df767 100644 --- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -114,9 +114,16 @@ public class CarStatusBar extends StatusBar implements new DeviceProvisionedController.DeviceProvisionedListener() { @Override public void onDeviceProvisionedChanged() { - mDeviceIsProvisioned = - mDeviceProvisionedController.isDeviceProvisioned(); - restartNavBars(); + mHandler.post(() -> { + // on initial boot we are getting a call even though the value + // is the same so we are confirming the reset is needed + boolean deviceProvisioned = + mDeviceProvisionedController.isDeviceProvisioned(); + if (mDeviceIsProvisioned != deviceProvisioned) { + mDeviceIsProvisioned = deviceProvisioned; + restartNavBars(); + } + }); } }); }