diff options
author | Xin Li <delphij@google.com> | 2022-04-01 20:32:40 +0000 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2022-04-01 20:32:40 +0000 |
commit | f90e3bf8ec112e30d2e42d268e2028343f717166 (patch) | |
tree | 2ac5a0202b5d9c10128411c016709da174bde56d | |
parent | 0507a7afd8cd240d8101cc26d5bbf8162fece98b (diff) | |
parent | a58b03d82a2edaaaba93814d25e98cfa8695c8a6 (diff) | |
download | Cluster-f90e3bf8ec112e30d2e42d268e2028343f717166.tar.gz |
Merge Android 12 QPR3 ab/8391262
Bug: 226662282
Merged-In: Iba4efb77e9c0746d6e76e79aa97b30914e0ea35d
Change-Id: Iffb3648d5842b910d630aaad0ef1998205d9a91d
3 files changed, 9 insertions, 1 deletions
diff --git a/ClusterHomeSample/AndroidManifest.xml b/ClusterHomeSample/AndroidManifest.xml index 1142467..1dc7eb5 100644 --- a/ClusterHomeSample/AndroidManifest.xml +++ b/ClusterHomeSample/AndroidManifest.xml @@ -31,6 +31,7 @@ --> <application android:name=".ClusterHomeApplication" android:label="ClusterHomeSample" + android:persistent="true" android:directBootAware="true"> <!-- android:showForAllUsers to keep the Activity regardless of user-switching --> <activity android:name=".ClusterHomeActivity" diff --git a/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java b/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java index 3f0b924..86b8d30 100644 --- a/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java +++ b/ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java @@ -251,6 +251,10 @@ public final class ClusterHomeApplication extends Application { } private final UserLifecycleListener mUserLifecycleListener = (event) -> { + if (DBG) Log.d(TAG, "UserLifecycleListener.onEvent: event=" + event); + if (event.getUserId() != ActivityManager.getCurrentUser()) { + return; + } mUserLifeCycleEvent = event.getEventType(); if (mUserLifeCycleEvent == USER_LIFECYCLE_EVENT_TYPE_STARTING) { startClusterActivity(UI_TYPE_HOME); @@ -266,6 +270,7 @@ public final class ClusterHomeApplication extends Application { }; private void onKeyEvent(KeyEvent keyEvent) { + if (DBG) Log.d(TAG, "onKeyEvent: " + keyEvent); if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_MENU) { if (keyEvent.getAction() != KeyEvent.ACTION_DOWN) return; int nextUiType = (mLastLaunchedUiType + 1) % mUiAvailability.length; diff --git a/ClusterOsDouble/src/com/android/car/cluster/osdouble/ClusterOsDoubleActivity.java b/ClusterOsDouble/src/com/android/car/cluster/osdouble/ClusterOsDoubleActivity.java index 1b4f571..8ba7eb3 100644 --- a/ClusterOsDouble/src/com/android/car/cluster/osdouble/ClusterOsDoubleActivity.java +++ b/ClusterOsDouble/src/com/android/car/cluster/osdouble/ClusterOsDoubleActivity.java @@ -194,7 +194,9 @@ public class ClusterOsDoubleActivity extends ComponentActivity { + "x" + height); return mDisplayManager.createVirtualDisplay(/* projection= */ null, "ClusterOsDouble-VD", width, height, 160, surface, - VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY | VIRTUAL_DISPLAY_FLAG_TRUSTED, + // Don't use VIRTUAL_DISPLAY_FLAG_TRUSTED, because we don't want the cluster display + // to be the focus display which can hinder Rotary service (b/206862329). + VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY, /* callback= */ null, /* handler= */ null, "ClusterDisplay"); } |