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

Commit 24310743 authored by Dave Mankoff's avatar Dave Mankoff Committed by Android (Google) Code Review
Browse files

Merge "Remove contents of DependencyProvider." into tm-dev

parents 49aa5e4a 9936216e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import android.view.Display;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.dagger.SysUISingleton;

import javax.inject.Inject;

/**
 * A class to control {@link MagnificationModeSwitch}. It shows the button UI with following
 * conditions:
@@ -44,6 +46,7 @@ public class ModeSwitchesController implements SwitchListener {
    private final DisplayIdIndexSupplier<MagnificationModeSwitch> mSwitchSupplier;
    private SwitchListener mSwitchListenerDelegate;

    @Inject
    public ModeSwitchesController(Context context) {
        mSwitchSupplier = new SwitchSupplier(context,
                context.getSystemService(DisplayManager.class), this::onSwitch);
+8 −4
Original line number Diff line number Diff line
@@ -31,10 +31,13 @@ import android.util.SparseArray
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.Dumpable
import com.android.systemui.broadcast.logging.BroadcastDispatcherLogger
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dump.DumpManager
import com.android.systemui.settings.UserTracker
import java.io.PrintWriter
import java.util.concurrent.Executor
import javax.inject.Inject

data class ReceiverData(
    val receiver: BroadcastReceiver,
@@ -63,14 +66,15 @@ private const val DEBUG = true
 * Broadcast handling may be asynchronous *without* calling goAsync(), as it's running within sysui
 * and doesn't need to worry about being killed.
 */
open class BroadcastDispatcher @JvmOverloads constructor (
@SysUISingleton
open class BroadcastDispatcher @Inject constructor(
    private val context: Context,
    private val bgLooper: Looper,
    private val bgExecutor: Executor,
    @Background private val bgLooper: Looper,
    @Background private val bgExecutor: Executor,
    private val dumpManager: DumpManager,
    private val logger: BroadcastDispatcherLogger,
    private val userTracker: UserTracker,
    private val removalPendingStore: PendingRemovalStore = PendingRemovalStore(logger)
    private val removalPendingStore: PendingRemovalStore
) : Dumpable {

    // Only modify in BG thread
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.systemui.broadcast;

import com.android.systemui.CoreStartable;

import dagger.Binds;
import dagger.Module;
import dagger.multibindings.ClassKey;
import dagger.multibindings.IntoMap;

/** */
@Module
public abstract class BroadcastDispatcherModule {
    /** Ensures BroadcastDispatcher is initialized. */
    @Binds
    @IntoMap
    @ClassKey(BroadcastDispatcherStartable.class)
    abstract CoreStartable bindsBroadastDispatcherStartable(BroadcastDispatcherStartable s);
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.systemui.broadcast

import android.content.Context
import com.android.systemui.CoreStartable
import javax.inject.Inject

class BroadcastDispatcherStartable @Inject constructor(
    context: Context,
    val broadcastDispatcher: BroadcastDispatcher
) : CoreStartable(context) {

    override fun start() {
        broadcastDispatcher.initialize()
    }
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ import com.android.systemui.Dumpable
import com.android.systemui.broadcast.logging.BroadcastDispatcherLogger
import com.android.systemui.util.indentIfPossible
import java.io.PrintWriter
import javax.inject.Inject

/**
 * Store information about requests for unregistering receivers from [BroadcastDispatcher], before
@@ -15,7 +16,7 @@ import java.io.PrintWriter
 *
 * This helps make unregistering a receiver a *sync* operation.
 */
class PendingRemovalStore(
class PendingRemovalStore @Inject constructor(
    private val logger: BroadcastDispatcherLogger
) : Dumpable {
    @GuardedBy("pendingRemoval")
Loading