Show privacy indicator for immersive mode

Bug: 241931460
Test: Manual
Change-Id: I2bd3315b2565d44af91d09bd1ebb05a19d3c38d0
diff --git a/res/layout/privacy_dot_bottom_left.xml b/res/layout/privacy_dot_bottom_left.xml
new file mode 100644
index 0000000..124e2b0
--- /dev/null
+++ b/res/layout/privacy_dot_bottom_left.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+** Copyright 2022, 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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/privacy_dot_bottom_left_container"
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:layout_gravity="bottom|left"
+    android:paddingBottom="@dimen/fullscreen_indicator_padding_vertical"
+    android:paddingStart="@dimen/fullscreen_indicator_padding_horizontal"
+    android:visibility="invisible" >
+    <ImageView
+        android:id="@+id/privacy_dot"
+        android:contentDescription="@null"
+        android:layout_height="@dimen/fullscreen_indicator_height"
+        android:layout_width="@dimen/fullscreen_indicator_width"
+        android:layout_gravity="center_vertical"
+        android:src="@drawable/ic_mic_light"
+        android:background="@drawable/privacy_chip_active_background_pill"
+        android:visibility="visible" />
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/privacy_dot_bottom_right.xml b/res/layout/privacy_dot_bottom_right.xml
new file mode 100644
index 0000000..7c1a66c
--- /dev/null
+++ b/res/layout/privacy_dot_bottom_right.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+** Copyright 2022, 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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/privacy_dot_bottom_right_container"
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:layout_gravity="bottom|right"
+    android:paddingBottom="@dimen/fullscreen_indicator_padding_vertical"
+    android:paddingEnd="@dimen/fullscreen_indicator_padding_horizontal"
+    android:visibility="invisible" >
+    <ImageView
+        android:id="@+id/privacy_dot"
+        android:contentDescription="@null"
+        android:layout_height="@dimen/fullscreen_indicator_height"
+        android:layout_width="@dimen/fullscreen_indicator_width"
+        android:layout_gravity="center_vertical"
+        android:src="@drawable/ic_mic_light"
+        android:background="@drawable/privacy_chip_active_background_pill"
+        android:visibility="visible" />
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/privacy_dot_top_left.xml b/res/layout/privacy_dot_top_left.xml
new file mode 100644
index 0000000..11987b3
--- /dev/null
+++ b/res/layout/privacy_dot_top_left.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2022 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.
+  -->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/privacy_dot_top_left_container"
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:layout_gravity="top|left"
+    android:paddingTop="@dimen/fullscreen_indicator_padding_vertical"
+    android:paddingStart="@dimen/fullscreen_indicator_padding_horizontal"
+    android:visibility="invisible" >
+    <ImageView
+        android:id="@+id/privacy_dot"
+        android:contentDescription="@null"
+        android:layout_height="@dimen/fullscreen_indicator_height"
+        android:layout_width="@dimen/fullscreen_indicator_width"
+        android:layout_gravity="center_vertical"
+        android:src="@drawable/ic_mic_light"
+        android:background="@drawable/privacy_chip_active_background_pill"
+        android:visibility="visible" />
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/privacy_dot_top_right.xml b/res/layout/privacy_dot_top_right.xml
new file mode 100644
index 0000000..6fb5a6c
--- /dev/null
+++ b/res/layout/privacy_dot_top_right.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+** Copyright 2022, 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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/privacy_dot_top_right_container"
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:layout_gravity="top|right"
+    android:paddingTop="@dimen/fullscreen_indicator_padding_vertical"
+    android:paddingEnd="@dimen/fullscreen_indicator_padding_horizontal"
+    android:visibility="invisible" >
+    <ImageView
+        android:id="@+id/privacy_dot"
+        android:contentDescription="@null"
+        android:layout_height="@dimen/fullscreen_indicator_height"
+        android:layout_width="@dimen/fullscreen_indicator_width"
+        android:layout_gravity="center_vertical"
+        android:src="@drawable/ic_mic_light"
+        android:background="@drawable/privacy_chip_active_background_pill"
+        android:visibility="visible" />
+</FrameLayout>
\ No newline at end of file
diff --git a/res/values/config.xml b/res/values/config.xml
index 10a3ae0..b9e3065 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -38,6 +38,12 @@
     <integer name="config_rightSystemBarType">3</integer>
     <integer name="config_bottomSystemBarType">1</integer>
 
+    <!-- Location of the system bar privacy indicator. This value should be consistent with the
+         layout file where the view for system bar privacy indicator is put. -->
+    <!-- For example the view is put car_top_system_bar.xml, this value should be
+         config_topSystemBarType. -->
+    <integer name="config_privacyIndicatorLocation">@integer/config_topSystemBarType</integer>
+
     <!-- Configure the relative z-order among the system bars. When two system bars overlap (e.g.
          if both top bar and left bar are enabled, it creates an overlapping space in the upper left
          corner), the system bar with the higher z-order takes the overlapping space and padding is
@@ -183,8 +189,8 @@
     <!-- Determines whether the shell features all run on another thread. -->
     <bool name="config_enableShellMainThread">true</bool>
 
-    <!-- Determines whether the shell task organizer be registered automatiacly or not.
-         It needs to be disabled for CarSystemUI as CarLauncher already registers one. With 2
-         organizers there can be recovery problems if either of the process crashes. -->
-    <bool name="config_registerShellTaskOrganizerOnInit">false</bool>
+    <!-- show the privacy chip indicator in full screen mode. -->
+    <bool name="config_enableImmersivePrivacyChip">true</bool>
+    <!-- enable animation for the privacy chip indicator in full screen mode. -->
+    <bool name="config_enableImmersivePrivacyChipAnimation">true</bool>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 779bcc2..c7de331 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -380,4 +380,10 @@
     <dimen name="activity_blocking_action_button_min_width">@*android:dimen/car_button_min_width</dimen>
     <dimen name="activity_blocking_action_button_text_size">@*android:dimen/car_body3_size</dimen>
     <dimen name="activity_blocking_action_button_padding_horizontal">@*android:dimen/car_padding_4</dimen>
+
+    <!-- Dimensions for the immersive privacy chip -->
+    <dimen name="fullscreen_indicator_padding_vertical">10dp</dimen>
+    <dimen name="fullscreen_indicator_padding_horizontal">12dp</dimen>
+    <dimen name="fullscreen_indicator_height">56dp</dimen>
+    <dimen name="fullscreen_indicator_width">80dp</dimen>
 </resources>
diff --git a/res/values/overlayable.xml b/res/values/overlayable.xml
index 196d1f6..7f0e117 100644
--- a/res/values/overlayable.xml
+++ b/res/values/overlayable.xml
@@ -81,6 +81,8 @@
       <item type="bool" name="config_consumeSystemBarTouchWhenNotificationPanelOpen"/>
       <item type="bool" name="config_enableBottomSystemBar"/>
       <item type="bool" name="config_enableHeadsUpNotificationWhenNotificationPanelOpen"/>
+      <item type="bool" name="config_enableImmersivePrivacyChip"/>
+      <item type="bool" name="config_enableImmersivePrivacyChipAnimation"/>
       <item type="bool" name="config_enableLeftSystemBar"/>
       <item type="bool" name="config_enableRightSystemBar"/>
       <item type="bool" name="config_enableShellMainThread"/>
@@ -94,7 +96,6 @@
       <item type="bool" name="config_notif_panel_inset_by_right_systembar"/>
       <item type="bool" name="config_notif_panel_inset_by_top_systembar"/>
       <item type="bool" name="config_profile_panel_disabled_while_driving"/>
-      <item type="bool" name="config_registerShellTaskOrganizerOnInit"/>
       <item type="bool" name="config_systemBarButtonsDraggable"/>
       <item type="color" name="activity_blocking_action_button_background_color"/>
       <item type="color" name="activity_blocking_activity_background"/>
@@ -257,6 +258,10 @@
       <item type="dimen" name="car_volume_item_seekbar_padding_vertical"/>
       <item type="dimen" name="common_margin"/>
       <item type="dimen" name="device_management_dialog_subtitle_padding"/>
+      <item type="dimen" name="fullscreen_indicator_height"/>
+      <item type="dimen" name="fullscreen_indicator_padding_horizontal"/>
+      <item type="dimen" name="fullscreen_indicator_padding_vertical"/>
+      <item type="dimen" name="fullscreen_indicator_width"/>
       <item type="dimen" name="hvac_button_margin_bottom"/>
       <item type="dimen" name="hvac_button_margin_end"/>
       <item type="dimen" name="hvac_button_margin_start"/>
@@ -579,6 +584,11 @@
       <item type="id" name="passenger_hvac"/>
       <item type="id" name="phone_nav"/>
       <item type="id" name="primary_icon"/>
+      <item type="id" name="privacy_dot"/>
+      <item type="id" name="privacy_dot_bottom_left_container"/>
+      <item type="id" name="privacy_dot_bottom_right_container"/>
+      <item type="id" name="privacy_dot_top_left_container"/>
+      <item type="id" name="privacy_dot_top_right_container"/>
       <item type="id" name="qc_bluetooth_footer_button"/>
       <item type="id" name="qc_bluetooth_status_icon"/>
       <item type="id" name="qc_camera_footer_button"/>
@@ -641,6 +651,7 @@
       <item type="integer" name="config_initialNotificationBackgroundAlpha"/>
       <item type="integer" name="config_leftSystemBarType"/>
       <item type="integer" name="config_leftSystemBarZOrder"/>
+      <item type="integer" name="config_privacyIndicatorLocation"/>
       <item type="integer" name="config_rightSystemBarType"/>
       <item type="integer" name="config_rightSystemBarZOrder"/>
       <item type="integer" name="config_topSystemBarType"/>
@@ -688,6 +699,10 @@
       <item type="layout" name="notification_handle_bar"/>
       <item type="layout" name="notification_panel_container"/>
       <item type="layout" name="privacy_chip_content"/>
+      <item type="layout" name="privacy_dot_bottom_left"/>
+      <item type="layout" name="privacy_dot_bottom_right"/>
+      <item type="layout" name="privacy_dot_top_left"/>
+      <item type="layout" name="privacy_dot_top_right"/>
       <item type="layout" name="qc_bluetooth_panel"/>
       <item type="layout" name="qc_camera_panel"/>
       <item type="layout" name="qc_connectivity_panel"/>
diff --git a/src/com/android/systemui/CarSystemUIModule.java b/src/com/android/systemui/CarSystemUIModule.java
index d2e7511..e9a488e 100644
--- a/src/com/android/systemui/CarSystemUIModule.java
+++ b/src/com/android/systemui/CarSystemUIModule.java
@@ -28,6 +28,8 @@
 import com.android.keyguard.KeyguardViewController;
 import com.android.systemui.car.CarDeviceProvisionedController;
 import com.android.systemui.car.CarDeviceProvisionedControllerImpl;
+import com.android.systemui.car.decor.CarPrivacyChipDecorProviderFactory;
+import com.android.systemui.car.decor.CarPrivacyChipViewController;
 import com.android.systemui.car.keyguard.CarKeyguardViewController;
 import com.android.systemui.car.notification.NotificationShadeWindowControllerImpl;
 import com.android.systemui.car.statusbar.DozeServiceHost;
@@ -35,6 +37,7 @@
 import com.android.systemui.dagger.GlobalRootComponent;
 import com.android.systemui.dagger.SysUISingleton;
 import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.decor.PrivacyDotDecorProviderFactory;
 import com.android.systemui.dock.DockManager;
 import com.android.systemui.dock.DockManagerImpl;
 import com.android.systemui.doze.DozeHost;
@@ -53,6 +56,7 @@
 import com.android.systemui.statusbar.NotificationLockscreenUserManager;
 import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
 import com.android.systemui.statusbar.NotificationShadeWindowController;
+import com.android.systemui.statusbar.events.PrivacyDotViewController;
 import com.android.systemui.statusbar.notification.collection.provider.VisualStabilityProvider;
 import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
 import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
@@ -109,16 +113,16 @@
             AccessibilityManagerWrapper accessibilityManagerWrapper,
             UiEventLogger uiEventLogger) {
         return new HeadsUpManagerPhone(
-            context,
-            headsUpManagerLogger,
-            statusBarStateController,
-            bypassController,
-            groupManager,
-            visualStabilityProvider,
-            configurationController,
-            handler,
-            accessibilityManagerWrapper,
-            uiEventLogger
+                context,
+                headsUpManagerLogger,
+                statusBarStateController,
+                bypassController,
+                groupManager,
+                visualStabilityProvider,
+                configurationController,
+                handler,
+                accessibilityManagerWrapper,
+                uiEventLogger
         );
     }
 
@@ -203,4 +207,12 @@
 
     @Binds
     abstract DozeHost bindDozeHost(DozeServiceHost dozeServiceHost);
+
+    @Binds
+    abstract PrivacyDotViewController providePrivacyDotViewController(
+            CarPrivacyChipViewController carPrivacyChipViewController);
+
+    @Binds
+    abstract PrivacyDotDecorProviderFactory providePrivacyDotDecorProviderFactory(
+            CarPrivacyChipDecorProviderFactory carPrivacyDotDecorProviderFactory);
 }
diff --git a/src/com/android/systemui/car/decor/CarPrivacyChipDecorProviderFactory.java b/src/com/android/systemui/car/decor/CarPrivacyChipDecorProviderFactory.java
new file mode 100644
index 0000000..e43f647
--- /dev/null
+++ b/src/com/android/systemui/car/decor/CarPrivacyChipDecorProviderFactory.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2022 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.systemui.car.decor;
+
+import android.content.Context;
+import android.view.DisplayCutout;
+
+import com.android.systemui.R;
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.decor.DecorProvider;
+import com.android.systemui.decor.PrivacyDotCornerDecorProviderImpl;
+import com.android.systemui.decor.PrivacyDotDecorProviderFactory;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.inject.Inject;
+
+/**
+ * Provides privacy dot views for each orientation. The PrivacyDot orientation and visibility
+ * of the privacy dot views are controlled by the PrivacyDotViewController.
+ */
+@SysUISingleton
+public class CarPrivacyChipDecorProviderFactory extends PrivacyDotDecorProviderFactory {
+
+    private Context mContext;
+    private boolean mHasProviders;
+
+    @Inject
+    public CarPrivacyChipDecorProviderFactory(Context context) {
+        super(context.getResources());
+        mContext = context;
+        mHasProviders = mContext.getResources().getBoolean(
+                R.bool.config_enableImmersivePrivacyChip);
+    }
+
+    @Override
+    public boolean getHasProviders() {
+        return mHasProviders;
+    }
+
+    @NotNull
+    @Override
+    public List<DecorProvider> getProviders() {
+        if (!mHasProviders) {
+            return Collections.emptyList();
+        }
+        // TODO(b/248145997): check with UX about the customized position.
+        List<DecorProvider> providers = new ArrayList<>();
+        providers.add(new PrivacyDotCornerDecorProviderImpl(
+                R.id.privacy_dot_top_left_container,
+                DisplayCutout.BOUNDS_POSITION_TOP,
+                DisplayCutout.BOUNDS_POSITION_LEFT,
+                R.layout.privacy_dot_top_left));
+        providers.add(new PrivacyDotCornerDecorProviderImpl(
+                R.id.privacy_dot_top_right_container,
+                DisplayCutout.BOUNDS_POSITION_TOP,
+                DisplayCutout.BOUNDS_POSITION_RIGHT,
+                R.layout.privacy_dot_top_right));
+        providers.add(new PrivacyDotCornerDecorProviderImpl(
+                R.id.privacy_dot_bottom_left_container,
+                DisplayCutout.BOUNDS_POSITION_BOTTOM,
+                DisplayCutout.BOUNDS_POSITION_LEFT,
+                R.layout.privacy_dot_bottom_left));
+        providers.add(new PrivacyDotCornerDecorProviderImpl(
+                R.id.privacy_dot_bottom_right_container,
+                DisplayCutout.BOUNDS_POSITION_BOTTOM,
+                DisplayCutout.BOUNDS_POSITION_RIGHT,
+                R.layout.privacy_dot_bottom_right));
+        return providers;
+    }
+}
diff --git a/src/com/android/systemui/car/decor/CarPrivacyChipViewController.java b/src/com/android/systemui/car/decor/CarPrivacyChipViewController.java
new file mode 100644
index 0000000..8eedc49
--- /dev/null
+++ b/src/com/android/systemui/car/decor/CarPrivacyChipViewController.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2022 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.systemui.car.decor;
+
+import android.content.Context;
+import android.view.InsetsVisibilities;
+import android.view.View;
+import android.view.WindowInsetsController;
+
+import androidx.annotation.UiThread;
+
+import com.android.internal.statusbar.LetterboxDetails;
+import com.android.internal.view.AppearanceRegion;
+import com.android.systemui.R;
+import com.android.systemui.car.systembar.SystemBarConfigs;
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.shade.ShadeExpansionStateManager;
+import com.android.systemui.statusbar.CommandQueue;
+import com.android.systemui.statusbar.events.PrivacyDotViewController;
+import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
+import com.android.systemui.statusbar.events.ViewState;
+import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider;
+import com.android.systemui.statusbar.policy.ConfigurationController;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+
+/**
+ * Subclass of {@link PrivacyDotViewController}.
+ */
+@SysUISingleton
+public class CarPrivacyChipViewController extends PrivacyDotViewController
+        implements CommandQueue.Callbacks {
+    private boolean mAreaVisible;
+    private boolean mHasAnimation;
+    private int mBarType;
+
+    @Inject
+    public CarPrivacyChipViewController(
+            @NotNull @Main Executor mainExecutor,
+            @NotNull Context context,
+            @NotNull StatusBarStateController stateController,
+            @NotNull ConfigurationController configurationController,
+            @NotNull StatusBarContentInsetsProvider contentInsetsProvider,
+            @NotNull SystemStatusAnimationScheduler animationScheduler,
+            ShadeExpansionStateManager shadeExpansionStateManager,
+            CommandQueue commandQueue) {
+        super(mainExecutor, stateController, configurationController, contentInsetsProvider,
+                animationScheduler, shadeExpansionStateManager);
+        commandQueue.addCallback(this);
+        mHasAnimation = context.getResources().getBoolean(
+                R.bool.config_enableImmersivePrivacyChipAnimation);
+        mBarType = SystemBarConfigs.BAR_TYPE_MAP[
+                context.getResources().getInteger(R.integer.config_privacyIndicatorLocation)];
+    }
+
+    @Override
+    @UiThread
+    public void updateDotView(ViewState state) {
+        // TODO(b/248145978): Add animation for transition.
+        boolean shouldShow = state.shouldShowDot();
+        View designatedCorner = state.getDesignatedCorner();
+        if (mAreaVisible && shouldShow && designatedCorner != null) {
+            showDotView(designatedCorner, mHasAnimation);
+        } else {
+            if (designatedCorner.getVisibility() == View.VISIBLE) {
+                hideDotView(designatedCorner, mHasAnimation);
+            }
+        }
+    }
+
+    @Override
+    public void onSystemBarAttributesChanged(
+            int displayId,
+            @WindowInsetsController.Appearance int appearance,
+            AppearanceRegion[] appearanceRegions,
+            boolean navbarColorManagedByIme,
+            @WindowInsetsController.Behavior int behavior,
+            InsetsVisibilities requestedVisibilities,
+            String packageName,
+            LetterboxDetails[] letterboxDetails) {
+        boolean newAreaVisibility = requestedVisibilities != null
+                ? !requestedVisibilities.getVisibility(mBarType)
+                : false;
+        if (newAreaVisibility != mAreaVisible) {
+            mAreaVisible = newAreaVisibility;
+            getUiExecutor().execute(() -> updateDotView(getCurrentViewState()));
+        }
+    }
+}
diff --git a/src/com/android/systemui/car/systembar/SystemBarConfigs.java b/src/com/android/systemui/car/systembar/SystemBarConfigs.java
index 040018f..cabe7ef 100644
--- a/src/com/android/systemui/car/systembar/SystemBarConfigs.java
+++ b/src/com/android/systemui/car/systembar/SystemBarConfigs.java
@@ -72,7 +72,7 @@
         NOTE: The elements' order in the map below must be preserved as-is since the correct
         corresponding values are obtained by the index.
      */
-    private static final int[] BAR_TYPE_MAP = {
+    public static final int[] BAR_TYPE_MAP = {
             InsetsState.ITYPE_STATUS_BAR,
             InsetsState.ITYPE_NAVIGATION_BAR,
             InsetsState.ITYPE_CLIMATE_BAR,