From 835e7c6f872a400684bc88cba7a148a30f8c0c3d Mon Sep 17 00:00:00 2001 From: Govinda Wasserman Date: Wed, 4 Jan 2023 19:35:47 +0000 Subject: [PATCH] Revert "Add option to return a null Dagger graph" Revert submission 20664269-b259469497-ss-cross-profile-dagger Reason for revert: b/263453125 Reverted changes: /q/submissionid:20664269-b259469497-ss-cross-profile-dagger Change-Id: I24affd9ced5ca4fa4959200d60ecf93b4b03d12a --- packages/SystemUI/AndroidManifest.xml | 1 - .../com/android/systemui/SystemUIInitializer.java | 9 --------- .../android/systemui/SystemUIInitializerImpl.kt | 15 ++------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 2923cd24b446b..844e88a09b05c 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -416,7 +416,6 @@ diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java b/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java index 0fc9ef96f6e9a..632fcdc162592 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java @@ -22,8 +22,6 @@ 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; @@ -55,7 +53,6 @@ public abstract class SystemUIInitializer { mContext = context; } - @Nullable protected abstract GlobalRootComponent.Builder getGlobalRootComponentBuilder(); /** @@ -72,11 +69,6 @@ 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) @@ -127,7 +119,6 @@ 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 55c095b0be257..8aa3040c6015c 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/SystemUIInitializerImpl.kt @@ -16,7 +16,6 @@ package com.android.systemui -import android.app.Application import android.content.Context import com.android.systemui.dagger.DaggerReferenceGlobalRootComponent import com.android.systemui.dagger.GlobalRootComponent @@ -25,17 +24,7 @@ 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 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" + override fun getGlobalRootComponentBuilder(): GlobalRootComponent.Builder { + return DaggerReferenceGlobalRootComponent.builder() } }