summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/AndroidManifest.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt15
3 files changed, 23 insertions, 2 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 4538179e73ab..6984b5ab6fb4 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -411,6 +411,7 @@
<service android:name=".screenshot.ScreenshotCrossProfileService"
android:permission="com.android.systemui.permission.SELF"
+ android:process=":screenshot_cross_profile"
android:exported="false" />
<service android:name=".screenrecord.RecordingService" />
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java b/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java
index 632fcdc16259..0fc9ef96f6e9 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java
@@ -22,6 +22,8 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
+import androidx.annotation.Nullable;
+
import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.dagger.SysUIComponent;
import com.android.systemui.dagger.WMComponent;
@@ -53,6 +55,7 @@ public abstract class SystemUIInitializer {
mContext = context;
}
+ @Nullable
protected abstract GlobalRootComponent.Builder getGlobalRootComponentBuilder();
/**
@@ -69,6 +72,11 @@ public abstract class SystemUIInitializer {
* Starts the initialization process. This stands up the Dagger graph.
*/
public void init(boolean fromTest) throws ExecutionException, InterruptedException {
+ GlobalRootComponent.Builder globalBuilder = getGlobalRootComponentBuilder();
+ if (globalBuilder == null) {
+ return;
+ }
+
mRootComponent = getGlobalRootComponentBuilder()
.context(mContext)
.instrumentationTest(fromTest)
@@ -119,6 +127,7 @@ public abstract class SystemUIInitializer {
.setBackAnimation(Optional.ofNullable(null))
.setDesktopMode(Optional.ofNullable(null));
}
+
mSysUIComponent = builder.build();
if (initializeComponents) {
mSysUIComponent.init();
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt b/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt
index 8aa3040c6015..55c095b0be25 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt
@@ -16,6 +16,7 @@
package com.android.systemui
+import android.app.Application
import android.content.Context
import com.android.systemui.dagger.DaggerReferenceGlobalRootComponent
import com.android.systemui.dagger.GlobalRootComponent
@@ -24,7 +25,17 @@ import com.android.systemui.dagger.GlobalRootComponent
* {@link SystemUIInitializer} that stands up AOSP SystemUI.
*/
class SystemUIInitializerImpl(context: Context) : SystemUIInitializer(context) {
- override fun getGlobalRootComponentBuilder(): GlobalRootComponent.Builder {
- return DaggerReferenceGlobalRootComponent.builder()
+
+ override fun getGlobalRootComponentBuilder(): GlobalRootComponent.Builder? {
+ return when (Application.getProcessName()) {
+ SCREENSHOT_CROSS_PROFILE_PROCESS -> null
+ else -> DaggerReferenceGlobalRootComponent.builder()
+ }
+ }
+
+ companion object {
+ private const val SYSTEMUI_PROCESS = "com.android.systemui"
+ private const val SCREENSHOT_CROSS_PROFILE_PROCESS =
+ "$SYSTEMUI_PROCESS:screenshot_cross_profile"
}
}