diff options
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"); } |