summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-17 21:06:13 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-17 21:06:13 +0000
commitb8ac4c9e8240621440c113d78537f406488bdf2a (patch)
tree2ac5a0202b5d9c10128411c016709da174bde56d
parent2a31245900d70326d54765b492f9c39efe2193f8 (diff)
parent758461abfb2dbfaef95ac47848cebc00a01217a0 (diff)
downloadCluster-android-platform-12.1.0_r8.tar.gz
Change-Id: I79b767cf779586161b8f3a62df40b794835147eb
-rw-r--r--ClusterHomeSample/AndroidManifest.xml1
-rw-r--r--ClusterHomeSample/src/com/android/car/cluster/home/ClusterHomeApplication.java5
-rw-r--r--ClusterOsDouble/src/com/android/car/cluster/osdouble/ClusterOsDoubleActivity.java4
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");
}