Merge "[Central Surfaces] Remove CentralSurfacesComponent.Startable." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
45da791fd3
@@ -1637,10 +1637,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
|
|
||||||
private void inflateStatusBarWindow() {
|
private void inflateStatusBarWindow() {
|
||||||
if (mCentralSurfacesComponent != null) {
|
if (mCentralSurfacesComponent != null) {
|
||||||
// Tear down
|
Log.e(TAG, "CentralSurfacesComponent being recreated; this is unexpected.");
|
||||||
for (CentralSurfacesComponent.Startable s : mCentralSurfacesComponent.getStartables()) {
|
|
||||||
s.stop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mCentralSurfacesComponent = mCentralSurfacesComponentFactory.create();
|
mCentralSurfacesComponent = mCentralSurfacesComponentFactory.create();
|
||||||
mFragmentService.addFragmentInstantiationProvider(
|
mFragmentService.addFragmentInstantiationProvider(
|
||||||
@@ -1682,11 +1679,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mCentralSurfacesComponent.getCentralSurfacesCommandQueueCallbacks();
|
mCentralSurfacesComponent.getCentralSurfacesCommandQueueCallbacks();
|
||||||
// Connect in to the status bar manager service
|
// Connect in to the status bar manager service
|
||||||
mCommandQueue.addCallback(mCommandQueueCallbacks);
|
mCommandQueue.addCallback(mCommandQueueCallbacks);
|
||||||
|
|
||||||
// Perform all other initialization for CentralSurfacesScope
|
|
||||||
for (CentralSurfacesComponent.Startable s : mCentralSurfacesComponent.getStartables()) {
|
|
||||||
s.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startKeyguard() {
|
protected void startKeyguard() {
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import dagger.Subcomponent;
|
|||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
import javax.inject.Scope;
|
import javax.inject.Scope;
|
||||||
@@ -60,7 +59,6 @@ import javax.inject.Scope;
|
|||||||
* outside the component. Should more items be moved *into* this component to avoid so many getters?
|
* outside the component. Should more items be moved *into* this component to avoid so many getters?
|
||||||
*/
|
*/
|
||||||
@Subcomponent(modules = {
|
@Subcomponent(modules = {
|
||||||
CentralSurfacesStartableModule.class,
|
|
||||||
NotificationStackScrollLayoutListContainerModule.class,
|
NotificationStackScrollLayoutListContainerModule.class,
|
||||||
StatusBarViewModule.class,
|
StatusBarViewModule.class,
|
||||||
StatusBarNotificationActivityStarterModule.class,
|
StatusBarNotificationActivityStarterModule.class,
|
||||||
@@ -84,14 +82,6 @@ public interface CentralSurfacesComponent {
|
|||||||
@Scope
|
@Scope
|
||||||
@interface CentralSurfacesScope {}
|
@interface CentralSurfacesScope {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs initialization logic after {@link CentralSurfacesComponent} has been constructed.
|
|
||||||
*/
|
|
||||||
interface Startable {
|
|
||||||
void start();
|
|
||||||
void stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link NotificationShadeWindowView}.
|
* Creates a {@link NotificationShadeWindowView}.
|
||||||
*/
|
*/
|
||||||
@@ -143,11 +133,6 @@ public interface CentralSurfacesComponent {
|
|||||||
@Named(STATUS_BAR_FRAGMENT)
|
@Named(STATUS_BAR_FRAGMENT)
|
||||||
CollapsedStatusBarFragment createCollapsedStatusBarFragment();
|
CollapsedStatusBarFragment createCollapsedStatusBarFragment();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set of startables to be run after a CentralSurfacesComponent has been constructed.
|
|
||||||
*/
|
|
||||||
Set<Startable> getStartables();
|
|
||||||
|
|
||||||
NotificationActivityStarter getNotificationActivityStarter();
|
NotificationActivityStarter getNotificationActivityStarter();
|
||||||
|
|
||||||
NotificationPresenter getNotificationPresenter();
|
NotificationPresenter getNotificationPresenter();
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.statusbar.phone.dagger;
|
|
||||||
|
|
||||||
import dagger.Module;
|
|
||||||
import dagger.multibindings.Multibinds;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Module
|
|
||||||
interface CentralSurfacesStartableModule {
|
|
||||||
@Multibinds
|
|
||||||
Set<CentralSurfacesComponent.Startable> multibindStartables();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user