Merge "Move sysui QS user detail config to feature flag"

This commit is contained in:
Peter Kalauskas
2021-09-02 14:47:43 +00:00
committed by Android (Google) Code Review
5 changed files with 20 additions and 8 deletions

View File

@@ -310,11 +310,6 @@
<!-- Whether to show the full screen user switcher. -->
<bool name="config_enableFullscreenUserSwitcher">false</bool>
<!-- Whether the multi-user switch on the keyguard opens QS user panel. If false, clicking the
user switch on the keyguard will replace the notifications and status area with the user
switcher. The multi-user switch is only shown if config_keyguardUserSwitcher=false. -->
<bool name="config_keyguard_user_switch_opens_qs_details">false</bool>
<!-- SystemUIFactory component -->
<string name="config_systemUIFactoryComponent" translatable="false">com.android.systemui.SystemUIFactory</string>

View File

@@ -34,9 +34,14 @@
<bool name="flag_lockscreen_animations">true</bool>
<!-- The new swipe to unlock animation, which shows the app/launcher behind the keyguard during
the swipe. -->
the swipe. -->
<bool name="flag_new_unlock_swipe_animation">true</bool>
<!-- Whether the multi-user icon on the lockscreen opens the QS user detail. If false, clicking
the multi-user icon will display a list of users directly on the lockscreen. The multi-user
icon is only shown if config_keyguardUserSwitcher=false in the frameworks config. -->
<bool name="flag_lockscreen_qs_user_detail_shortcut">false</bool>
<!-- The shared-element transition between lockscreen smartspace and launcher smartspace. -->
<bool name="flag_smartspace_shared_element_transition">false</bool>

View File

@@ -173,6 +173,10 @@ public class FeatureFlags {
return mFlagReader.isEnabled(R.bool.flag_new_unlock_swipe_animation);
}
public boolean isKeyguardQsUserDetailsShortcutEnabled() {
return mFlagReader.isEnabled(R.bool.flag_lockscreen_qs_user_detail_shortcut);
}
public boolean isSmartSpaceSharedElementTransitionEnabled() {
return mFlagReader.isEnabled(R.bool.flag_smartspace_shared_element_transition);
}

View File

@@ -117,6 +117,7 @@ import com.android.systemui.controls.dagger.ControlsComponent;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.idle.IdleHostView;
@@ -273,6 +274,7 @@ public class NotificationPanelViewController extends PanelViewController {
private static final Rect EMPTY_RECT = new Rect();
private final LayoutInflater mLayoutInflater;
private final FeatureFlags mFeatureFlags;
private final PowerManager mPowerManager;
private final AccessibilityManager mAccessibilityManager;
private final NotificationWakeUpCoordinator mWakeUpCoordinator;
@@ -700,6 +702,7 @@ public class NotificationPanelViewController extends PanelViewController {
@Main Resources resources,
@Main Handler handler,
LayoutInflater layoutInflater,
FeatureFlags featureFlags,
NotificationWakeUpCoordinator coordinator, PulseExpansionHandler pulseExpansionHandler,
DynamicPrivacyController dynamicPrivacyController,
KeyguardBypassController bypassController, FalsingManager falsingManager,
@@ -798,6 +801,7 @@ public class NotificationPanelViewController extends PanelViewController {
mView.setWillNotDraw(!DEBUG);
mSplitShadeHeaderController = splitShadeHeaderController;
mLayoutInflater = layoutInflater;
mFeatureFlags = featureFlags;
mFalsingManager = falsingManager;
mFalsingCollector = falsingCollector;
mPowerManager = powerManager;
@@ -4023,8 +4027,8 @@ public class NotificationPanelViewController extends PanelViewController {
mKeyguardUserSwitcherEnabled = mResources.getBoolean(
com.android.internal.R.bool.config_keyguardUserSwitcher);
mKeyguardQsUserSwitchEnabled =
mKeyguardUserSwitcherEnabled && mResources.getBoolean(
R.bool.config_keyguard_user_switch_opens_qs_details);
mKeyguardUserSwitcherEnabled
&& mFeatureFlags.isKeyguardQsUserDetailsShortcutEnabled();
}
private void registerSettingsChangeListener() {

View File

@@ -96,6 +96,7 @@ import com.android.systemui.communal.CommunalStateController;
import com.android.systemui.communal.dagger.CommunalViewComponent;
import com.android.systemui.controls.dagger.ControlsComponent;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.idle.IdleHostViewController;
@@ -200,6 +201,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
@Mock
private LayoutInflater mLayoutInflater;
@Mock
private FeatureFlags mFeatureFlags;
@Mock
private DynamicPrivacyController mDynamicPrivacyController;
@Mock
private ShadeController mShadeController;
@@ -465,6 +468,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
mResources,
new Handler(Looper.getMainLooper()),
mLayoutInflater,
mFeatureFlags,
coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController,
mFalsingManager, new FalsingCollectorFake(),
mNotificationLockscreenUserManager, mNotificationEntryManager,