Merge "Stop sharing the QSPanel outside of its Fragment."
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2020 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.qs;
|
||||
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Proxy class for talking with the QSPanel and showing custom content within it.
|
||||
*/
|
||||
@SysUISingleton
|
||||
public class QSDetailDisplayer {
|
||||
private QSPanelController mQsPanelController;
|
||||
|
||||
@Inject
|
||||
public QSDetailDisplayer() {
|
||||
}
|
||||
|
||||
public void setQsPanelController(QSPanelController qsPanelController) {
|
||||
mQsPanelController = qsPanelController;
|
||||
}
|
||||
|
||||
/** Show the supplied DetailAdapter in the Quick Settings. */
|
||||
public void showDetailAdapter(DetailAdapter detailAdapter, int x, int y) {
|
||||
if (mQsPanelController != null) {
|
||||
mQsPanelController.showDetailDapater(detailAdapter, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,22 +17,10 @@ package com.android.systemui.qs;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The bottom footer of the quick settings panel.
|
||||
*/
|
||||
public interface QSFooter {
|
||||
/**
|
||||
* Sets the given {@link QSPanel} to be the one that will display the quick settings.
|
||||
*/
|
||||
void setQSPanel(@Nullable QSPanel panel);
|
||||
|
||||
/**
|
||||
* Sets the given {@link QuickQSPanel} to be the one associated with quick settings.
|
||||
*/
|
||||
default void setQQSPanel(@Nullable QuickQSPanel panel) {};
|
||||
|
||||
/**
|
||||
* Sets whether or not the footer should be visible.
|
||||
*
|
||||
|
||||
@@ -59,7 +59,6 @@ public class QSFooterView extends FrameLayout {
|
||||
private boolean mShouldShowBuildText;
|
||||
|
||||
private boolean mQsDisabled;
|
||||
private QuickQSPanel mQuickQsPanel;
|
||||
|
||||
private boolean mExpanded;
|
||||
|
||||
@@ -115,8 +114,6 @@ public class QSFooterView extends FrameLayout {
|
||||
|
||||
updateResources();
|
||||
|
||||
addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight,
|
||||
oldBottom) -> updateAnimator(right - left));
|
||||
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
|
||||
setBuildText();
|
||||
}
|
||||
@@ -139,9 +136,7 @@ public class QSFooterView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAnimator(int width) {
|
||||
int numTiles = mQuickQsPanel != null ? mQuickQsPanel.getNumQuickTiles()
|
||||
: QuickQSPanel.getDefaultMaxTiles();
|
||||
void updateAnimator(int width, int numTiles) {
|
||||
int size = mContext.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_size)
|
||||
- mContext.getResources().getDimensionPixelSize(dimen.qs_quick_tile_padding);
|
||||
int remaining = (width - numTiles * size) / (numTiles - 1);
|
||||
@@ -289,19 +284,6 @@ public class QSFooterView extends FrameLayout {
|
||||
return mExpanded && mMultiUserSwitch.isMultiUserEnabled();
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setQSPanel(final QSPanel qsPanel) {
|
||||
if (qsPanel != null) {
|
||||
mMultiUserSwitch.setQsPanel(qsPanel);
|
||||
qsPanel.setFooterPageIndicator(mPageIndicator);
|
||||
}
|
||||
}
|
||||
|
||||
public void setQQSPanel(@Nullable QuickQSPanel panel) {
|
||||
mQuickQsPanel = panel;
|
||||
}
|
||||
|
||||
|
||||
void onUserInfoChanged(Drawable picture, boolean isGuestUser) {
|
||||
if (picture != null && isGuestUser && !(picture instanceof UserIconDrawable)) {
|
||||
picture = picture.getConstantState().newDrawable(getResources()).mutate();
|
||||
|
||||
@@ -26,8 +26,6 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
@@ -35,6 +33,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.qs.dagger.QSScope;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.statusbar.phone.MultiUserSwitch;
|
||||
import com.android.systemui.statusbar.phone.SettingsButton;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
import com.android.systemui.statusbar.policy.UserInfoController;
|
||||
@@ -55,11 +54,15 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
private final DeviceProvisionedController mDeviceProvisionedController;
|
||||
private final UserTracker mUserTracker;
|
||||
private final QSPanelController mQsPanelController;
|
||||
private final QSDetailDisplayer mQsDetailDisplayer;
|
||||
private final QuickQSPanelController mQuickQSPanelController;
|
||||
private final TunerService mTunerService;
|
||||
private final MetricsLogger mMetricsLogger;
|
||||
private final SettingsButton mSettingsButton;
|
||||
private final TextView mBuildText;
|
||||
private final View mEdit;
|
||||
private final MultiUserSwitch mMultiUserSwitch;
|
||||
private final PageIndicator mPageIndicator;
|
||||
|
||||
private final UserInfoController.OnUserInfoChangedListener mOnUserInfoChangedListener =
|
||||
new UserInfoController.OnUserInfoChangedListener() {
|
||||
@@ -119,8 +122,9 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
QSFooterViewController(QSFooterView view, UserManager userManager,
|
||||
UserInfoController userInfoController, ActivityStarter activityStarter,
|
||||
DeviceProvisionedController deviceProvisionedController, UserTracker userTracker,
|
||||
QSPanelController qsPanelController, TunerService tunerService,
|
||||
MetricsLogger metricsLogger) {
|
||||
QSPanelController qsPanelController, QSDetailDisplayer qsDetailDisplayer,
|
||||
QuickQSPanelController quickQSPanelController,
|
||||
TunerService tunerService, MetricsLogger metricsLogger) {
|
||||
super(view);
|
||||
mUserManager = userManager;
|
||||
mUserInfoController = userInfoController;
|
||||
@@ -128,17 +132,24 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
mDeviceProvisionedController = deviceProvisionedController;
|
||||
mUserTracker = userTracker;
|
||||
mQsPanelController = qsPanelController;
|
||||
mQsDetailDisplayer = qsDetailDisplayer;
|
||||
mQuickQSPanelController = quickQSPanelController;
|
||||
mTunerService = tunerService;
|
||||
mMetricsLogger = metricsLogger;
|
||||
|
||||
mSettingsButton = mView.findViewById(R.id.settings_button);
|
||||
mBuildText = mView.findViewById(R.id.build);
|
||||
mEdit = mView.findViewById(android.R.id.edit);
|
||||
mMultiUserSwitch = mView.findViewById(R.id.multi_user_switch);
|
||||
mPageIndicator = mView.findViewById(R.id.footer_page_indicator);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onViewAttached() {
|
||||
mView.addOnLayoutChangeListener(
|
||||
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) ->
|
||||
mView.updateAnimator(
|
||||
right - left, mQuickQSPanelController.getNumQuickTiles()));
|
||||
mSettingsButton.setOnClickListener(mSettingsOnClickListener);
|
||||
mBuildText.setOnLongClickListener(view -> {
|
||||
CharSequence buildText = mBuildText.getText();
|
||||
@@ -158,6 +169,8 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
mActivityStarter.postQSRunnableDismissingKeyguard(() ->
|
||||
mQsPanelController.showEdit(view)));
|
||||
|
||||
mMultiUserSwitch.setQSDetailDisplayer(mQsDetailDisplayer);
|
||||
mQsPanelController.setFooterPageIndicator(mPageIndicator);
|
||||
mView.updateEverything(isTunerEnabled());
|
||||
}
|
||||
|
||||
@@ -166,12 +179,6 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
setListening(false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setQSPanel(@Nullable QSPanel panel) {
|
||||
mView.setQSPanel(panel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisibility(int visibility) {
|
||||
mView.setVisibility(visibility);
|
||||
@@ -219,11 +226,6 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme
|
||||
mView.setExpandClickListener(onClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQQSPanel(@Nullable QuickQSPanel panel) {
|
||||
mView.setQQSPanel(panel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable(int state1, int state2, boolean animate) {
|
||||
mView.disable(state2, isTunerEnabled());
|
||||
|
||||
@@ -80,6 +80,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
|
||||
private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler;
|
||||
private final InjectionInflationController mInjectionInflater;
|
||||
private final CommandQueue mCommandQueue;
|
||||
private final QSDetailDisplayer mQsDetailDisplayer;
|
||||
private final QSFragmentComponent.Factory mQsComponentFactory;
|
||||
private final QSTileHost mHost;
|
||||
private boolean mShowCollapsedOnKeyguard;
|
||||
@@ -102,9 +104,12 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
public QSFragment(RemoteInputQuickSettingsDisabler remoteInputQsDisabler,
|
||||
InjectionInflationController injectionInflater, QSTileHost qsTileHost,
|
||||
StatusBarStateController statusBarStateController, CommandQueue commandQueue,
|
||||
QSDetailDisplayer qsDetailDisplayer,
|
||||
QSFragmentComponent.Factory qsComponentFactory) {
|
||||
mRemoteInputQuickSettingsDisabler = remoteInputQsDisabler;
|
||||
mInjectionInflater = injectionInflater;
|
||||
mCommandQueue = commandQueue;
|
||||
mQsDetailDisplayer = qsDetailDisplayer;
|
||||
mQsComponentFactory = qsComponentFactory;
|
||||
commandQueue.observe(getLifecycle(), this);
|
||||
mHost = qsTileHost;
|
||||
@@ -144,6 +149,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
mQSPanelController.setHeaderContainer(view.findViewById(R.id.header_text_container));
|
||||
mFooter = qsFragmentComponent.getQSFooter();
|
||||
|
||||
mQsDetailDisplayer.setQsPanelController(mQSPanelController);
|
||||
|
||||
mQSContainerImplController = qsFragmentComponent.getQSContainerImplController();
|
||||
mQSContainerImplController.init();
|
||||
mContainer = mQSContainerImplController.getView();
|
||||
@@ -183,6 +190,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
setListening(false);
|
||||
}
|
||||
mQSCustomizerController.setQs(null);
|
||||
mQsDetailDisplayer.setQsPanelController(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -254,7 +262,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
|
||||
public void setHost(QSTileHost qsh) {
|
||||
mHeader.setQSPanel(mQSPanelController.getView());
|
||||
mFooter.setQSPanel(mQSPanelController.getView());
|
||||
mQSDetail.setHost(qsh);
|
||||
}
|
||||
|
||||
@@ -321,10 +328,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
return mQSPanelController;
|
||||
}
|
||||
|
||||
public QSPanel getQsPanel() {
|
||||
return mQSPanelController.getView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowingDetail() {
|
||||
return mQSCustomizerController.isCustomizing() || mQSDetail.isShowingDetail();
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.media.MediaHost;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
import com.android.systemui.plugins.qs.QSTile;
|
||||
import com.android.systemui.qs.customize.QSCustomizerController;
|
||||
import com.android.systemui.qs.dagger.QSScope;
|
||||
@@ -244,5 +245,15 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
public Pair<Integer, Integer> getVisualSideMargins() {
|
||||
return mView.getVisualSideMargins();
|
||||
}
|
||||
|
||||
/** */
|
||||
public void showDetailDapater(DetailAdapter detailAdapter, int x, int y) {
|
||||
mView.showDetailAdapter(true, detailAdapter, new int[]{x, y});
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setFooterPageIndicator(PageIndicator pageIndicator) {
|
||||
mView.setFooterPageIndicator(pageIndicator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class QuickQSPanel extends QSPanel {
|
||||
|
||||
public static final String NUM_QUICK_TILES = "sysui_qqs_count";
|
||||
private static final String TAG = "QuickQSPanel";
|
||||
// Start it at 6 so a non-zero value can be obtained statically.
|
||||
// A default value so that we never return 0.
|
||||
private static int sDefaultMaxTiles = 6;
|
||||
|
||||
private boolean mDisabledByPolicy;
|
||||
@@ -63,6 +63,7 @@ public class QuickQSPanel extends QSPanel {
|
||||
UiEventLogger uiEventLogger) {
|
||||
super(context, attrs, qsLogger, mediaHost, uiEventLogger);
|
||||
sDefaultMaxTiles = getResources().getInteger(R.integer.quick_qs_panel_max_columns);
|
||||
mMaxTiles = sDefaultMaxTiles;
|
||||
applyBottomMargin((View) mRegularTileLayout);
|
||||
}
|
||||
|
||||
@@ -170,10 +171,6 @@ public class QuickQSPanel extends QSPanel {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getDefaultMaxTiles() {
|
||||
return sDefaultMaxTiles;
|
||||
}
|
||||
|
||||
void setDisabledByPolicy(boolean disabled) {
|
||||
if (disabled != mDisabledByPolicy) {
|
||||
mDisabledByPolicy = disabled;
|
||||
|
||||
@@ -84,4 +84,8 @@ public class QuickQSPanelController extends QSPanelControllerBase<QuickQSPanel>
|
||||
}
|
||||
super.setTiles(quickTiles, true);
|
||||
}
|
||||
|
||||
public int getNumQuickTiles() {
|
||||
return mView.getNumQuickTiles();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver;
|
||||
import com.android.systemui.qs.QSPanel;
|
||||
import com.android.systemui.qs.QSDetailDisplayer;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.phone.StatusBarIconController.TintedIconManager;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
@@ -369,8 +369,9 @@ public class KeyguardStatusBarView extends RelativeLayout
|
||||
mMultiUserAvatar.setImageDrawable(picture);
|
||||
}
|
||||
|
||||
public void setQSPanel(QSPanel qsp) {
|
||||
mMultiUserSwitch.setQsPanel(qsp);
|
||||
/** */
|
||||
public void setQSDetailDisplayer(QSDetailDisplayer detailDisplayer) {
|
||||
mMultiUserSwitch.setQSDetailDisplayer(detailDisplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.android.systemui.Prefs;
|
||||
import com.android.systemui.Prefs.Key;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
import com.android.systemui.qs.QSPanel;
|
||||
import com.android.systemui.qs.QSDetailDisplayer;
|
||||
import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
|
||||
import com.android.systemui.statusbar.policy.UserSwitcherController;
|
||||
|
||||
@@ -43,14 +43,13 @@ import com.android.systemui.statusbar.policy.UserSwitcherController;
|
||||
*/
|
||||
public class MultiUserSwitch extends FrameLayout implements View.OnClickListener {
|
||||
|
||||
protected QSPanel mQsPanel;
|
||||
protected QSDetailDisplayer mQSDetailDisplayer;
|
||||
private KeyguardUserSwitcher mKeyguardUserSwitcher;
|
||||
private boolean mKeyguardMode;
|
||||
private UserSwitcherController.BaseUserAdapter mUserListener;
|
||||
|
||||
final UserManager mUserManager;
|
||||
|
||||
private final int[] mTmpInt2 = new int[2];
|
||||
|
||||
protected UserSwitcherController mUserSwitcherController;
|
||||
|
||||
@@ -66,8 +65,9 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
|
||||
refreshContentDescription();
|
||||
}
|
||||
|
||||
public void setQsPanel(QSPanel qsPanel) {
|
||||
mQsPanel = qsPanel;
|
||||
/** */
|
||||
public void setQSDetailDisplayer(QSDetailDisplayer detailDisplayer) {
|
||||
mQSDetailDisplayer = detailDisplayer;
|
||||
setUserSwitcherController(Dependency.get(UserSwitcherController.class));
|
||||
}
|
||||
|
||||
@@ -127,16 +127,15 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
|
||||
if (mKeyguardUserSwitcher != null) {
|
||||
mKeyguardUserSwitcher.show(true /* animate */);
|
||||
}
|
||||
} else if (mQsPanel != null && mUserSwitcherController != null) {
|
||||
} else if (mQSDetailDisplayer != null && mUserSwitcherController != null) {
|
||||
View center = getChildCount() > 0 ? getChildAt(0) : this;
|
||||
|
||||
center.getLocationInWindow(mTmpInt2);
|
||||
mTmpInt2[0] += center.getWidth() / 2;
|
||||
mTmpInt2[1] += center.getHeight() / 2;
|
||||
int[] tmpInt = new int[2];
|
||||
center.getLocationInWindow(tmpInt);
|
||||
tmpInt[0] += center.getWidth() / 2;
|
||||
tmpInt[1] += center.getHeight() / 2;
|
||||
|
||||
mQsPanel.showDetailAdapter(true,
|
||||
getUserDetailAdapter(),
|
||||
mTmpInt2);
|
||||
mQSDetailDisplayer.showDetailAdapter(getUserDetailAdapter(), tmpInt[0], tmpInt[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.qs.QSFragment;
|
||||
import com.android.systemui.qs.QSDetailDisplayer;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.GestureRecorder;
|
||||
import com.android.systemui.statusbar.KeyguardAffordanceView;
|
||||
@@ -268,6 +268,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private final MediaHierarchyManager mMediaHierarchyManager;
|
||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||
private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
|
||||
private final QSDetailDisplayer mQSDetailDisplayer;
|
||||
// Maximum # notifications to show on Keyguard; extras will be collapsed in an overflow card.
|
||||
// If there are exactly 1 + mMaxKeyguardNotifications, then still shows all notifications
|
||||
private final int mMaxKeyguardNotifications;
|
||||
@@ -519,7 +520,8 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory,
|
||||
NotificationGroupManagerLegacy groupManager,
|
||||
NotificationIconAreaController notificationIconAreaController,
|
||||
AuthController authController) {
|
||||
AuthController authController,
|
||||
QSDetailDisplayer qsDetailDisplayer) {
|
||||
super(view, falsingManager, dozeLog, keyguardStateController,
|
||||
(SysuiStatusBarStateController) statusBarStateController, vibratorHelper,
|
||||
latencyTracker, flingAnimationUtilsBuilder, statusBarTouchableRegionManager);
|
||||
@@ -534,6 +536,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mGroupManager = groupManager;
|
||||
mNotificationIconAreaController = notificationIconAreaController;
|
||||
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
|
||||
mQSDetailDisplayer = qsDetailDisplayer;
|
||||
mView.setWillNotDraw(!DEBUG);
|
||||
mInjectionInflationController = injectionInflationController;
|
||||
mFalsingManager = falsingManager;
|
||||
@@ -606,6 +609,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private void onFinishInflate() {
|
||||
loadDimens();
|
||||
mKeyguardStatusBar = mView.findViewById(R.id.keyguard_header);
|
||||
mKeyguardStatusBar.setQSDetailDisplayer(mQSDetailDisplayer);
|
||||
mBigClockContainer = mView.findViewById(R.id.big_clock_container);
|
||||
updateViewControllers(mView.findViewById(R.id.keyguard_status_view));
|
||||
mNotificationContainerParent = mView.findViewById(R.id.notification_container_parent);
|
||||
@@ -2867,9 +2871,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
}
|
||||
});
|
||||
mNotificationStackScrollLayoutController.setQsContainer((ViewGroup) mQs.getView());
|
||||
if (mQs instanceof QSFragment) {
|
||||
mKeyguardStatusBar.setQSPanel(((QSFragment) mQs).getQsPanel());
|
||||
}
|
||||
updateQsExpansion();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.android.systemui.Dependency;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.statusbar.phone.MultiUserSwitch;
|
||||
import com.android.systemui.statusbar.phone.SettingsButton;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
import com.android.systemui.statusbar.policy.UserInfoController;
|
||||
@@ -75,6 +76,8 @@ public class QSFooterViewControllerTest extends LeakCheckedTest {
|
||||
private QSPanelController mQSPanelController;
|
||||
@Mock
|
||||
private ClipboardManager mClipboardManager;
|
||||
@Mock
|
||||
private QuickQSPanelController mQuickQSPanelController;
|
||||
private FakeTunerService mFakeTunerService;
|
||||
private MetricsLogger mMetricsLogger = new FakeMetricsLogger();
|
||||
|
||||
@@ -84,6 +87,8 @@ public class QSFooterViewControllerTest extends LeakCheckedTest {
|
||||
private TextView mBuildText;
|
||||
@Mock
|
||||
private View mEdit;
|
||||
@Mock
|
||||
private MultiUserSwitch mMultiUserSwitch;
|
||||
|
||||
private QSFooterViewController mController;
|
||||
|
||||
@@ -105,10 +110,12 @@ public class QSFooterViewControllerTest extends LeakCheckedTest {
|
||||
when(mView.findViewById(R.id.settings_button)).thenReturn(mSettingsButton);
|
||||
when(mView.findViewById(R.id.build)).thenReturn(mBuildText);
|
||||
when(mView.findViewById(android.R.id.edit)).thenReturn(mEdit);
|
||||
when(mView.findViewById(R.id.multi_user_switch)).thenReturn(mMultiUserSwitch);
|
||||
|
||||
mController = new QSFooterViewController(mView, mUserManager, mUserInfoController,
|
||||
mActivityStarter, mDeviceProvisionedController, mUserTracker, mQSPanelController,
|
||||
mFakeTunerService, mMetricsLogger);
|
||||
new QSDetailDisplayer(), mQuickQSPanelController, mFakeTunerService,
|
||||
mMetricsLogger);
|
||||
|
||||
mController.init();
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ public class QSFragmentTest extends SysuiBaseFragmentTest {
|
||||
mock(QSTileHost.class),
|
||||
mock(StatusBarStateController.class),
|
||||
commandQueue,
|
||||
new QSDetailDisplayer(),
|
||||
mQsComponentFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ import com.android.systemui.classifier.FalsingManagerFake;
|
||||
import com.android.systemui.doze.DozeLog;
|
||||
import com.android.systemui.media.MediaHierarchyManager;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.qs.QSDetailDisplayer;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.KeyguardAffordanceView;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
@@ -214,6 +215,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
mDisplayMetrics.density = 100;
|
||||
when(mResources.getBoolean(R.bool.config_enableNotificationShadeDrag)).thenReturn(true);
|
||||
when(mView.getContext()).thenReturn(getContext());
|
||||
when(mView.findViewById(R.id.keyguard_header)).thenReturn(mKeyguardStatusBar);
|
||||
when(mView.findViewById(R.id.keyguard_clock_container)).thenReturn(mKeyguardClockSwitch);
|
||||
when(mView.findViewById(R.id.notification_stack_scroller))
|
||||
.thenReturn(mNotificationStackScrollLayout);
|
||||
@@ -273,7 +275,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
mKeyguardStatusViewComponentFactory,
|
||||
mGroupManager,
|
||||
mNotificationAreaController,
|
||||
mAuthController);
|
||||
mAuthController,
|
||||
new QSDetailDisplayer());
|
||||
mNotificationPanelViewController.initDependencies(
|
||||
mStatusBar,
|
||||
mNotificationShelfController);
|
||||
|
||||
Reference in New Issue
Block a user