Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca5598dd authored by Winson Chung's avatar Winson Chung
Browse files

Move dagger modules into shell library for reuse

- Certain system ui implementations which use the shell don't depend on
  SystemUI-core, which means that the dagger modules for providing the
  core Shell components need to be copied (which makes it more cumbersome
  to make changes). Instead, move these modules back into the shell lib
  for any SysUI app to reference.

Bug: 205019015
Test: make SystemUIGoogle
Test: make CarSystemUI
Test: make ArcSystemUI
Change-Id: I8dc938a7695972f9d7b3d7ea8e3ce65a7b454b13
parent 7c1c6a69
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -132,11 +132,12 @@ android_library {
        "kotlinx-coroutines-android",
        "kotlinx-coroutines-core",
        "iconloader_base",
        "jsr330",
        "protolog-lib",
        "WindowManager-Shell-proto",
        "dagger2",
        "jsr330",
    ],
    kotlincflags: ["-Xjvm-default=enable"],
    manifest: "AndroidManifest.xml",
    plugins: ["dagger2-compiler"],
}
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@
    limitations under the License.
-->
<resources>
    <!-- Determines whether the shell features all run on another thread. This is to be overrided
         by the resources of the app using the Shell library. -->
    <bool name="config_enableShellMainThread">false</bool>

    <!-- Animation duration for PIP when entering. -->
    <integer name="config_pipEnterAnimationDuration">425</integer>

+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.common.annotations;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

import javax.inject.Qualifier;

/**
 * Annotates a method or qualifies a provider that runs on the main-thread of the process using
 * this library.
 */
@Qualifier
@Documented
@Retention(RUNTIME)
public @interface ExternalMainThread {
}
+13 −0
Original line number Diff line number Diff line
The dagger modules in this directory can be included by the host SysUI using the Shell library for
explicity injection of Shell components. Apps using this library are not required to use these
dagger modules for setup, but it is recommended for them to include them as needed.

The modules are currently inherited as such:

+- WMShellBaseModule (common shell features across SysUI)
   |
   +- WMShellModule (handheld)
   |
   +- TvPipModule (tv pip)
      |
      +- TvWMShellModule (tv)
 No newline at end of file
+2 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,12 +14,11 @@
 * limitations under the License.
 */

package com.android.systemui.wmshell;
package com.android.wm.shell.dagger;

import android.content.Context;
import android.os.Handler;

import com.android.systemui.dagger.WMSingleton;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.common.DisplayController;
Loading