summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuncheol Heo <ycheo@google.com>2021-06-24 16:59:59 -0700
committerYuncheol Heo <ycheo@google.com>2021-06-24 17:09:56 -0700
commit3e8813000e5570315a6001bec5f82dffbfc186fb (patch)
tree1bd0bc6cc9775b6c0111d76c0a85f00a12be6858
parent784b6562d08f2ced43c72cf230494111528f3dd1 (diff)
downloadCluster-3e8813000e5570315a6001bec5f82dffbfc186fb.tar.gz
Restart Activity when the display bounds or insets are changed.
Without this, Maps shows the current location icon in the previous center. Bug: 191271445 Test: Change the cluster display size and check if Maps will show the current location icon in the center of the changed TDA. Change-Id: I4c72588835e6c44bb5547f3926d5744151f55650
-rw-r--r--ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java b/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java
index dc4fdc1..4f89c88 100644
--- a/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java
+++ b/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java
@@ -194,8 +194,12 @@ public final class ClusterHomeApplication extends Application {
public void onClusterStateChanged(
ClusterState state, @ClusterHomeManager.Config int changes) {
mClusterState = state;
- if ((changes & ClusterHomeManager.CONFIG_UI_TYPE) != 0
- && mLastLaunchedUiType != state.uiType) {
+ // We'll restart Activity when the display bounds or insets are changed, to let Activity
+ // redraw itself to fit the changed attributes.
+ if ((changes & ClusterHomeManager.CONFIG_DISPLAY_BOUNDS) != 0
+ || (changes & ClusterHomeManager.CONFIG_DISPLAY_INSETS) != 0
+ || ((changes & ClusterHomeManager.CONFIG_UI_TYPE) != 0
+ && mLastLaunchedUiType != state.uiType)) {
startClusterActivity(state.uiType);
}
}