Merge changes I5694a38e,I488f90aa,Ie9644dc8,I8d5b5b53,Ib8a0fa19 into qt-r1-dev
* changes: Continued the bypass experience Changing the lockscreen layout for the bypass Enabling auth to succeed whenever the bouncer is showing Enabled dragging down from the lock screen when bypassing Made sure huns can show on the lock screen even when awake
This commit is contained in:
@@ -170,11 +170,6 @@ public class CarQSFragment extends Fragment implements QS {
|
|||||||
// No detail panel to close.
|
// No detail panel to close.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setKeyguardShowing(boolean keyguardShowing) {
|
|
||||||
// No keyguard to show.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void animateHeaderSlidingIn(long delay) {
|
public void animateHeaderSlidingIn(long delay) {
|
||||||
// No header to animate.
|
// No header to animate.
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ android_library {
|
|||||||
"--extra-packages",
|
"--extra-packages",
|
||||||
"com.android.keyguard",
|
"com.android.keyguard",
|
||||||
],
|
],
|
||||||
|
kotlincflags: ["-Xjvm-default=enable"],
|
||||||
|
|
||||||
plugins: ["dagger2-compiler-2.19"],
|
plugins: ["dagger2-compiler-2.19"],
|
||||||
}
|
}
|
||||||
@@ -128,6 +129,7 @@ android_library {
|
|||||||
"telephony-common",
|
"telephony-common",
|
||||||
"android.test.base",
|
"android.test.base",
|
||||||
],
|
],
|
||||||
|
kotlincflags: ["-Xjvm-default=enable"],
|
||||||
aaptflags: [
|
aaptflags: [
|
||||||
"--extra-packages",
|
"--extra-packages",
|
||||||
"com.android.keyguard:com.android.systemui",
|
"com.android.keyguard:com.android.systemui",
|
||||||
@@ -155,6 +157,8 @@ android_app {
|
|||||||
"telephony-common",
|
"telephony-common",
|
||||||
],
|
],
|
||||||
|
|
||||||
|
kotlincflags: ["-Xjvm-default=enable"],
|
||||||
|
|
||||||
dxflags: ["--multi-dex"],
|
dxflags: ["--multi-dex"],
|
||||||
aaptflags: [
|
aaptflags: [
|
||||||
"--extra-packages",
|
"--extra-packages",
|
||||||
@@ -191,6 +195,8 @@ android_app {
|
|||||||
"telephony-common",
|
"telephony-common",
|
||||||
],
|
],
|
||||||
|
|
||||||
|
kotlincflags: ["-Xjvm-default=enable"],
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
"legacy/recents/src/**/*.java",
|
"legacy/recents/src/**/*.java",
|
||||||
"legacy/recents/src/**/I*.aidl",
|
"legacy/recents/src/**/I*.aidl",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public interface QS extends FragmentBase {
|
|||||||
|
|
||||||
String ACTION = "com.android.systemui.action.PLUGIN_QS";
|
String ACTION = "com.android.systemui.action.PLUGIN_QS";
|
||||||
|
|
||||||
int VERSION = 6;
|
int VERSION = 7;
|
||||||
|
|
||||||
String TAG = "QS";
|
String TAG = "QS";
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ public interface QS extends FragmentBase {
|
|||||||
void setListening(boolean listening);
|
void setListening(boolean listening);
|
||||||
boolean isShowingDetail();
|
boolean isShowingDetail();
|
||||||
void closeDetail();
|
void closeDetail();
|
||||||
void setKeyguardShowing(boolean keyguardShowing);
|
default void setShowCollapsedOnKeyguard(boolean showCollapsedOnKeyguard) {}
|
||||||
void animateHeaderSlidingIn(long delay);
|
void animateHeaderSlidingIn(long delay);
|
||||||
void animateHeaderSlidingOut();
|
void animateHeaderSlidingOut();
|
||||||
void setQsExpansion(float qsExpansionFraction, float headerTranslation);
|
void setQsExpansion(float qsExpansionFraction, float headerTranslation);
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ import com.android.systemui.statusbar.NotificationMediaManager;
|
|||||||
import com.android.systemui.statusbar.ScrimView;
|
import com.android.systemui.statusbar.ScrimView;
|
||||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||||
import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
|
import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
|
||||||
|
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationData;
|
import com.android.systemui.statusbar.notification.collection.NotificationData;
|
||||||
import com.android.systemui.statusbar.phone.DozeParameters;
|
import com.android.systemui.statusbar.phone.DozeParameters;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBouncer;
|
import com.android.systemui.statusbar.phone.KeyguardBouncer;
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
|
import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
|
||||||
import com.android.systemui.statusbar.phone.LockIcon;
|
import com.android.systemui.statusbar.phone.LockIcon;
|
||||||
import com.android.systemui.statusbar.phone.LockscreenWallpaper;
|
import com.android.systemui.statusbar.phone.LockscreenWallpaper;
|
||||||
@@ -145,10 +147,14 @@ public class SystemUIFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public NotificationIconAreaController createNotificationIconAreaController(Context context,
|
public NotificationIconAreaController createNotificationIconAreaController(Context context,
|
||||||
StatusBar statusBar, StatusBarStateController statusBarStateController,
|
StatusBar statusBar,
|
||||||
|
NotificationWakeUpCoordinator wakeUpCoordinator,
|
||||||
|
KeyguardBypassController keyguardBypassController,
|
||||||
|
StatusBarStateController statusBarStateController,
|
||||||
NotificationListener listener) {
|
NotificationListener listener) {
|
||||||
return new NotificationIconAreaController(context, statusBar, statusBarStateController,
|
return new NotificationIconAreaController(context, statusBar, statusBarStateController,
|
||||||
listener, Dependency.get(NotificationMediaManager.class));
|
wakeUpCoordinator, keyguardBypassController, listener,
|
||||||
|
Dependency.get(NotificationMediaManager.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyguardIndicationController createKeyguardIndicationController(Context context,
|
public KeyguardIndicationController createKeyguardIndicationController(Context context,
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
private int mNumQuickTiles;
|
private int mNumQuickTiles;
|
||||||
private float mLastPosition;
|
private float mLastPosition;
|
||||||
private QSTileHost mHost;
|
private QSTileHost mHost;
|
||||||
|
private boolean mShowCollapsedOnKeyguard;
|
||||||
|
|
||||||
public QSAnimator(QS qs, QuickQSPanel quickPanel, QSPanel panel) {
|
public QSAnimator(QS qs, QuickQSPanel quickPanel, QSPanel panel) {
|
||||||
mQs = qs;
|
mQs = qs;
|
||||||
@@ -98,12 +99,32 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
|
|
||||||
public void setOnKeyguard(boolean onKeyguard) {
|
public void setOnKeyguard(boolean onKeyguard) {
|
||||||
mOnKeyguard = onKeyguard;
|
mOnKeyguard = onKeyguard;
|
||||||
mQuickQsPanel.setVisibility(mOnKeyguard ? View.INVISIBLE : View.VISIBLE);
|
updateQQSVisibility();
|
||||||
if (mOnKeyguard) {
|
if (mOnKeyguard) {
|
||||||
clearAnimationState();
|
clearAnimationState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether or not the keyguard is currently being shown with a collapsed header.
|
||||||
|
*/
|
||||||
|
void setShowCollapsedOnKeyguard(boolean showCollapsedOnKeyguard) {
|
||||||
|
mShowCollapsedOnKeyguard = showCollapsedOnKeyguard;
|
||||||
|
updateQQSVisibility();
|
||||||
|
setCurrentPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setCurrentPosition() {
|
||||||
|
setPosition(mLastPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateQQSVisibility() {
|
||||||
|
mQuickQsPanel.setVisibility(mOnKeyguard
|
||||||
|
&& !mShowCollapsedOnKeyguard ? View.INVISIBLE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
public void setHost(QSTileHost qsh) {
|
public void setHost(QSTileHost qsh) {
|
||||||
mHost = qsh;
|
mHost = qsh;
|
||||||
qsh.addCallback(this);
|
qsh.addCallback(this);
|
||||||
@@ -322,7 +343,11 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
public void setPosition(float position) {
|
public void setPosition(float position) {
|
||||||
if (mFirstPageAnimator == null) return;
|
if (mFirstPageAnimator == null) return;
|
||||||
if (mOnKeyguard) {
|
if (mOnKeyguard) {
|
||||||
return;
|
if (mShowCollapsedOnKeyguard) {
|
||||||
|
position = 0;
|
||||||
|
} else {
|
||||||
|
position = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mLastPosition = position;
|
mLastPosition = position;
|
||||||
if (mOnFirstPage && mAllowFancy) {
|
if (mOnFirstPage && mAllowFancy) {
|
||||||
@@ -356,7 +381,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStarted() {
|
public void onAnimationStarted() {
|
||||||
mQuickQsPanel.setVisibility(mOnKeyguard ? View.INVISIBLE : View.VISIBLE);
|
updateQQSVisibility();
|
||||||
if (mOnFirstPage) {
|
if (mOnFirstPage) {
|
||||||
final int N = mQuickQsViews.size();
|
final int N = mQuickQsViews.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
@@ -410,7 +435,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
updateAnimators();
|
updateAnimators();
|
||||||
setPosition(mLastPosition);
|
setCurrentPosition();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,10 @@ import com.android.systemui.R;
|
|||||||
import com.android.systemui.R.id;
|
import com.android.systemui.R.id;
|
||||||
import com.android.systemui.SysUiServiceProvider;
|
import com.android.systemui.SysUiServiceProvider;
|
||||||
import com.android.systemui.plugins.qs.QS;
|
import com.android.systemui.plugins.qs.QS;
|
||||||
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.qs.customize.QSCustomizer;
|
import com.android.systemui.qs.customize.QSCustomizer;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
||||||
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
|
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
|
||||||
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
|
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
|
||||||
@@ -50,16 +52,17 @@ import com.android.systemui.util.LifecycleFragment;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Callbacks {
|
public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Callbacks,
|
||||||
|
StatusBarStateController.StateListener {
|
||||||
private static final String TAG = "QS";
|
private static final String TAG = "QS";
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
private static final String EXTRA_EXPANDED = "expanded";
|
private static final String EXTRA_EXPANDED = "expanded";
|
||||||
private static final String EXTRA_LISTENING = "listening";
|
private static final String EXTRA_LISTENING = "listening";
|
||||||
|
|
||||||
private final Rect mQsBounds = new Rect();
|
private final Rect mQsBounds = new Rect();
|
||||||
|
private final StatusBarStateController mStatusBarStateController;
|
||||||
private boolean mQsExpanded;
|
private boolean mQsExpanded;
|
||||||
private boolean mHeaderAnimating;
|
private boolean mHeaderAnimating;
|
||||||
private boolean mKeyguardShowing;
|
|
||||||
private boolean mStackScrollerOverscrolling;
|
private boolean mStackScrollerOverscrolling;
|
||||||
|
|
||||||
private long mDelay;
|
private long mDelay;
|
||||||
@@ -80,17 +83,27 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler;
|
private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler;
|
||||||
private final InjectionInflationController mInjectionInflater;
|
private final InjectionInflationController mInjectionInflater;
|
||||||
private final QSTileHost mHost;
|
private final QSTileHost mHost;
|
||||||
|
private boolean mShowCollapsedOnKeyguard;
|
||||||
|
private boolean mLastKeyguardAndExpanded;
|
||||||
|
/**
|
||||||
|
* The last received state from the controller. This should not be used directly to check if
|
||||||
|
* we're on keyguard but use {@link #isKeyguardShowing()} instead since that is more accurate
|
||||||
|
* during state transitions which often call into us.
|
||||||
|
*/
|
||||||
|
private int mState;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public QSFragment(RemoteInputQuickSettingsDisabler remoteInputQsDisabler,
|
public QSFragment(RemoteInputQuickSettingsDisabler remoteInputQsDisabler,
|
||||||
InjectionInflationController injectionInflater,
|
InjectionInflationController injectionInflater,
|
||||||
Context context,
|
Context context,
|
||||||
QSTileHost qsTileHost) {
|
QSTileHost qsTileHost,
|
||||||
|
StatusBarStateController statusBarStateController) {
|
||||||
mRemoteInputQuickSettingsDisabler = remoteInputQsDisabler;
|
mRemoteInputQuickSettingsDisabler = remoteInputQsDisabler;
|
||||||
mInjectionInflater = injectionInflater;
|
mInjectionInflater = injectionInflater;
|
||||||
SysUiServiceProvider.getComponent(context, CommandQueue.class)
|
SysUiServiceProvider.getComponent(context, CommandQueue.class)
|
||||||
.observe(getLifecycle(), this);
|
.observe(getLifecycle(), this);
|
||||||
mHost = qsTileHost;
|
mHost = qsTileHost;
|
||||||
|
mStatusBarStateController = statusBarStateController;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -126,11 +139,14 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setHost(mHost);
|
setHost(mHost);
|
||||||
|
mStatusBarStateController.addCallback(this);
|
||||||
|
onStateChanged(mStatusBarStateController.getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
mStatusBarStateController.removeCallback(this);
|
||||||
if (mListening) {
|
if (mListening) {
|
||||||
setListening(false);
|
setListening(false);
|
||||||
}
|
}
|
||||||
@@ -235,20 +251,43 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
|| mHeaderAnimating;
|
|| mHeaderAnimating;
|
||||||
mQSPanel.setExpanded(mQsExpanded);
|
mQSPanel.setExpanded(mQsExpanded);
|
||||||
mQSDetail.setExpanded(mQsExpanded);
|
mQSDetail.setExpanded(mQsExpanded);
|
||||||
mHeader.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
|
boolean keyguardShowing = isKeyguardShowing();
|
||||||
|
mHeader.setVisibility((mQsExpanded || !keyguardShowing || mHeaderAnimating
|
||||||
|
|| mShowCollapsedOnKeyguard)
|
||||||
? View.VISIBLE
|
? View.VISIBLE
|
||||||
: View.INVISIBLE);
|
: View.INVISIBLE);
|
||||||
mHeader.setExpanded((mKeyguardShowing && !mHeaderAnimating)
|
mHeader.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
|
||||||
|| (mQsExpanded && !mStackScrollerOverscrolling));
|
|| (mQsExpanded && !mStackScrollerOverscrolling));
|
||||||
mFooter.setVisibility(
|
mFooter.setVisibility(
|
||||||
!mQsDisabled && (mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
|
!mQsDisabled && (mQsExpanded || !keyguardShowing || mHeaderAnimating
|
||||||
|
|| mShowCollapsedOnKeyguard)
|
||||||
? View.VISIBLE
|
? View.VISIBLE
|
||||||
: View.INVISIBLE);
|
: View.INVISIBLE);
|
||||||
mFooter.setExpanded((mKeyguardShowing && !mHeaderAnimating)
|
mFooter.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
|
||||||
|| (mQsExpanded && !mStackScrollerOverscrolling));
|
|| (mQsExpanded && !mStackScrollerOverscrolling));
|
||||||
mQSPanel.setVisibility(!mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
|
mQSPanel.setVisibility(!mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isKeyguardShowing() {
|
||||||
|
// We want the freshest state here since otherwise we'll have some weirdness if earlier
|
||||||
|
// listeners trigger updates
|
||||||
|
return mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowCollapsedOnKeyguard(boolean showCollapsedOnKeyguard) {
|
||||||
|
if (showCollapsedOnKeyguard != mShowCollapsedOnKeyguard) {
|
||||||
|
mShowCollapsedOnKeyguard = showCollapsedOnKeyguard;
|
||||||
|
updateQsState();
|
||||||
|
if (mQSAnimator != null) {
|
||||||
|
mQSAnimator.setShowCollapsedOnKeyguard(showCollapsedOnKeyguard);
|
||||||
|
}
|
||||||
|
if (!showCollapsedOnKeyguard && isKeyguardShowing()) {
|
||||||
|
setQsExpansion(mLastQSExpansion, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public QSPanel getQsPanel() {
|
public QSPanel getQsPanel() {
|
||||||
return mQSPanel;
|
return mQSPanel;
|
||||||
}
|
}
|
||||||
@@ -280,10 +319,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
updateQsState();
|
updateQsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void setKeyguardShowing(boolean keyguardShowing) {
|
||||||
public void setKeyguardShowing(boolean keyguardShowing) {
|
|
||||||
if (DEBUG) Log.d(TAG, "setKeyguardShowing " + keyguardShowing);
|
if (DEBUG) Log.d(TAG, "setKeyguardShowing " + keyguardShowing);
|
||||||
mKeyguardShowing = keyguardShowing;
|
|
||||||
mLastQSExpansion = -1;
|
mLastQSExpansion = -1;
|
||||||
|
|
||||||
if (mQSAnimator != null) {
|
if (mQSAnimator != null) {
|
||||||
@@ -321,16 +358,18 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
if (DEBUG) Log.d(TAG, "setQSExpansion " + expansion + " " + headerTranslation);
|
if (DEBUG) Log.d(TAG, "setQSExpansion " + expansion + " " + headerTranslation);
|
||||||
mContainer.setExpansion(expansion);
|
mContainer.setExpansion(expansion);
|
||||||
final float translationScaleY = expansion - 1;
|
final float translationScaleY = expansion - 1;
|
||||||
if (!mHeaderAnimating) {
|
boolean onKeyguardAndExpanded = isKeyguardShowing() && !mShowCollapsedOnKeyguard;
|
||||||
|
if (!mHeaderAnimating && !headerWillBeAnimating()) {
|
||||||
getView().setTranslationY(
|
getView().setTranslationY(
|
||||||
mKeyguardShowing
|
onKeyguardAndExpanded
|
||||||
? translationScaleY * mHeader.getHeight()
|
? translationScaleY * mHeader.getHeight()
|
||||||
: headerTranslation);
|
: headerTranslation);
|
||||||
}
|
}
|
||||||
if (expansion == mLastQSExpansion) {
|
if (expansion == mLastQSExpansion && mLastKeyguardAndExpanded == onKeyguardAndExpanded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mLastQSExpansion = expansion;
|
mLastQSExpansion = expansion;
|
||||||
|
mLastKeyguardAndExpanded = onKeyguardAndExpanded;
|
||||||
|
|
||||||
boolean fullyExpanded = expansion == 1;
|
boolean fullyExpanded = expansion == 1;
|
||||||
int heightDiff = mQSPanel.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom()
|
int heightDiff = mQSPanel.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom()
|
||||||
@@ -338,8 +377,9 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
float panelTranslationY = translationScaleY * heightDiff;
|
float panelTranslationY = translationScaleY * heightDiff;
|
||||||
|
|
||||||
// Let the views animate their contents correctly by giving them the necessary context.
|
// Let the views animate their contents correctly by giving them the necessary context.
|
||||||
mHeader.setExpansion(mKeyguardShowing, expansion, panelTranslationY);
|
mHeader.setExpansion(onKeyguardAndExpanded, expansion,
|
||||||
mFooter.setExpansion(mKeyguardShowing ? 1 : expansion);
|
panelTranslationY);
|
||||||
|
mFooter.setExpansion(onKeyguardAndExpanded ? 1 : expansion);
|
||||||
mQSPanel.getQsTileRevealController().setExpansion(expansion);
|
mQSPanel.getQsTileRevealController().setExpansion(expansion);
|
||||||
mQSPanel.getTileLayout().setExpansion(expansion);
|
mQSPanel.getTileLayout().setExpansion(expansion);
|
||||||
mQSPanel.setTranslationY(translationScaleY * heightDiff);
|
mQSPanel.setTranslationY(translationScaleY * heightDiff);
|
||||||
@@ -361,12 +401,17 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean headerWillBeAnimating() {
|
||||||
|
return mState == StatusBarState.KEYGUARD && mShowCollapsedOnKeyguard
|
||||||
|
&& !isKeyguardShowing();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void animateHeaderSlidingIn(long delay) {
|
public void animateHeaderSlidingIn(long delay) {
|
||||||
if (DEBUG) Log.d(TAG, "animateHeaderSlidingIn");
|
if (DEBUG) Log.d(TAG, "animateHeaderSlidingIn");
|
||||||
// If the QS is already expanded we don't need to slide in the header as it's already
|
// If the QS is already expanded we don't need to slide in the header as it's already
|
||||||
// visible.
|
// visible.
|
||||||
if (!mQsExpanded) {
|
if (!mQsExpanded && getView().getTranslationY() != 0) {
|
||||||
mHeaderAnimating = true;
|
mHeaderAnimating = true;
|
||||||
mDelay = delay;
|
mDelay = delay;
|
||||||
getView().getViewTreeObserver().addOnPreDrawListener(mStartHeaderSlidingIn);
|
getView().getViewTreeObserver().addOnPreDrawListener(mStartHeaderSlidingIn);
|
||||||
@@ -376,6 +421,9 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
@Override
|
@Override
|
||||||
public void animateHeaderSlidingOut() {
|
public void animateHeaderSlidingOut() {
|
||||||
if (DEBUG) Log.d(TAG, "animateHeaderSlidingOut");
|
if (DEBUG) Log.d(TAG, "animateHeaderSlidingOut");
|
||||||
|
if (getView().getY() == -mHeader.getHeight()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mHeaderAnimating = true;
|
mHeaderAnimating = true;
|
||||||
getView().animate().y(-mHeader.getHeight())
|
getView().animate().y(-mHeader.getHeight())
|
||||||
.setStartDelay(0)
|
.setStartDelay(0)
|
||||||
@@ -463,7 +511,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
|
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
|
||||||
.setListener(mAnimateHeaderSlidingInListener)
|
.setListener(mAnimateHeaderSlidingInListener)
|
||||||
.start();
|
.start();
|
||||||
getView().setY(-mHeader.getHeight());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -476,4 +523,10 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
updateQsState();
|
updateQsState();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStateChanged(int newState) {
|
||||||
|
mState = newState;
|
||||||
|
setKeyguardShowing(newState == StatusBarState.KEYGUARD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -439,19 +439,19 @@ public class QuickStatusBarHeader extends RelativeLayout implements
|
|||||||
/**
|
/**
|
||||||
* Animates the inner contents based on the given expansion details.
|
* Animates the inner contents based on the given expansion details.
|
||||||
*
|
*
|
||||||
* @param isKeyguardShowing whether or not we're showing the keyguard (a.k.a. lockscreen)
|
* @param forceExpanded whether we should show the state expanded forcibly
|
||||||
* @param expansionFraction how much the QS panel is expanded/pulled out (up to 1f)
|
* @param expansionFraction how much the QS panel is expanded/pulled out (up to 1f)
|
||||||
* @param panelTranslationY how much the panel has physically moved down vertically (required
|
* @param panelTranslationY how much the panel has physically moved down vertically (required
|
||||||
* for keyguard animations only)
|
* for keyguard animations only)
|
||||||
*/
|
*/
|
||||||
public void setExpansion(boolean isKeyguardShowing, float expansionFraction,
|
public void setExpansion(boolean forceExpanded, float expansionFraction,
|
||||||
float panelTranslationY) {
|
float panelTranslationY) {
|
||||||
final float keyguardExpansionFraction = isKeyguardShowing ? 1f : expansionFraction;
|
final float keyguardExpansionFraction = forceExpanded ? 1f : expansionFraction;
|
||||||
if (mStatusIconsAlphaAnimator != null) {
|
if (mStatusIconsAlphaAnimator != null) {
|
||||||
mStatusIconsAlphaAnimator.setPosition(keyguardExpansionFraction);
|
mStatusIconsAlphaAnimator.setPosition(keyguardExpansionFraction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isKeyguardShowing) {
|
if (forceExpanded) {
|
||||||
// If the keyguard is showing, we want to offset the text so that it comes in at the
|
// If the keyguard is showing, we want to offset the text so that it comes in at the
|
||||||
// same time as the panel as it slides down.
|
// same time as the panel as it slides down.
|
||||||
mHeaderTextContainerView.setTranslationY(panelTranslationY);
|
mHeaderTextContainerView.setTranslationY(panelTranslationY);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.android.systemui.statusbar.notification.VisualStabilityManager;
|
|||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.NotificationGroupManager;
|
import com.android.systemui.statusbar.phone.NotificationGroupManager;
|
||||||
import com.android.systemui.statusbar.phone.ShadeController;
|
import com.android.systemui.statusbar.phone.ShadeController;
|
||||||
import com.android.systemui.statusbar.phone.UnlockMethodCache;
|
import com.android.systemui.statusbar.phone.UnlockMethodCache;
|
||||||
@@ -80,6 +81,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
private final boolean mAlwaysExpandNonGroupedNotification;
|
private final boolean mAlwaysExpandNonGroupedNotification;
|
||||||
private final BubbleData mBubbleData;
|
private final BubbleData mBubbleData;
|
||||||
private final DynamicPrivacyController mDynamicPrivacyController;
|
private final DynamicPrivacyController mDynamicPrivacyController;
|
||||||
|
private final KeyguardBypassController mBypassController;
|
||||||
|
|
||||||
private NotificationPresenter mPresenter;
|
private NotificationPresenter mPresenter;
|
||||||
private NotificationListContainer mListContainer;
|
private NotificationListContainer mListContainer;
|
||||||
@@ -93,8 +95,10 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
NotificationEntryManager notificationEntryManager,
|
NotificationEntryManager notificationEntryManager,
|
||||||
Lazy<ShadeController> shadeController,
|
Lazy<ShadeController> shadeController,
|
||||||
BubbleData bubbleData,
|
BubbleData bubbleData,
|
||||||
|
KeyguardBypassController bypassController,
|
||||||
DynamicPrivacyController privacyController) {
|
DynamicPrivacyController privacyController) {
|
||||||
mLockscreenUserManager = notificationLockscreenUserManager;
|
mLockscreenUserManager = notificationLockscreenUserManager;
|
||||||
|
mBypassController = bypassController;
|
||||||
mGroupManager = groupManager;
|
mGroupManager = groupManager;
|
||||||
mVisualStabilityManager = visualStabilityManager;
|
mVisualStabilityManager = visualStabilityManager;
|
||||||
mStatusBarStateController = (SysuiStatusBarStateController) statusBarStateController;
|
mStatusBarStateController = (SysuiStatusBarStateController) statusBarStateController;
|
||||||
@@ -336,7 +340,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
int visibleNotifications = 0;
|
int visibleNotifications = 0;
|
||||||
boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
|
boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
|
||||||
int maxNotifications = -1;
|
int maxNotifications = -1;
|
||||||
if (onKeyguard) {
|
if (onKeyguard && !mBypassController.getBypassEnabled()) {
|
||||||
maxNotifications = mPresenter.getMaxNotificationsWhileLocked(true /* recompute */);
|
maxNotifications = mPresenter.getMaxNotificationsWhileLocked(true /* recompute */);
|
||||||
}
|
}
|
||||||
mListContainer.setMaxDisplayedNotifications(maxNotifications);
|
mListContainer.setMaxDisplayedNotifications(maxNotifications);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.os.PowerManager
|
|||||||
import android.os.PowerManager.WAKE_REASON_GESTURE
|
import android.os.PowerManager.WAKE_REASON_GESTURE
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
|
import android.view.VelocityTracker
|
||||||
import android.view.ViewConfiguration
|
import android.view.ViewConfiguration
|
||||||
|
|
||||||
import com.android.systemui.Gefingerpoken
|
import com.android.systemui.Gefingerpoken
|
||||||
@@ -36,6 +37,7 @@ import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
|
|||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableView
|
import com.android.systemui.statusbar.notification.row.ExpandableView
|
||||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
|
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController
|
||||||
import com.android.systemui.statusbar.phone.ShadeController
|
import com.android.systemui.statusbar.phone.ShadeController
|
||||||
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -48,22 +50,33 @@ import kotlin.math.max
|
|||||||
@Singleton
|
@Singleton
|
||||||
class PulseExpansionHandler @Inject
|
class PulseExpansionHandler @Inject
|
||||||
constructor(context: Context,
|
constructor(context: Context,
|
||||||
private val mWakeUpCoordinator: NotificationWakeUpCoordinator) : Gefingerpoken {
|
private val wakeUpCoordinator: NotificationWakeUpCoordinator,
|
||||||
|
private val bypassController: KeyguardBypassController) : Gefingerpoken {
|
||||||
companion object {
|
companion object {
|
||||||
private val RUBBERBAND_FACTOR_STATIC = 0.25f
|
private val RUBBERBAND_FACTOR_STATIC = 0.25f
|
||||||
private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
|
private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
|
||||||
}
|
}
|
||||||
private val mPowerManager: PowerManager?
|
private val mPowerManager: PowerManager?
|
||||||
private var mShadeController: ShadeController? = null
|
private lateinit var shadeController: ShadeController
|
||||||
|
|
||||||
private val mMinDragDistance: Int
|
private val mMinDragDistance: Int
|
||||||
private var mInitialTouchX: Float = 0.0f
|
private var mInitialTouchX: Float = 0.0f
|
||||||
private var mInitialTouchY: Float = 0.0f
|
private var mInitialTouchY: Float = 0.0f
|
||||||
var isExpanding: Boolean = false
|
var isExpanding: Boolean = false
|
||||||
|
private set(value) {
|
||||||
|
val changed = field != value
|
||||||
|
field = value
|
||||||
|
bypassController.isPulseExpanding = value
|
||||||
|
if (changed && !value && !leavingLockscreen) {
|
||||||
|
bypassController.maybePerformPendingUnlock()
|
||||||
|
pulseExpandAbortListener?.run()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var leavingLockscreen: Boolean = false
|
||||||
private set
|
private set
|
||||||
private val mTouchSlop: Float
|
private val mTouchSlop: Float
|
||||||
private var mExpansionCallback: ExpansionCallback? = null
|
private lateinit var expansionCallback: ExpansionCallback
|
||||||
private lateinit var mStackScroller: NotificationStackScrollLayout
|
private lateinit var stackScroller: NotificationStackScrollLayout
|
||||||
private val mTemp2 = IntArray(2)
|
private val mTemp2 = IntArray(2)
|
||||||
private var mDraggedFarEnough: Boolean = false
|
private var mDraggedFarEnough: Boolean = false
|
||||||
private var mStartingChild: ExpandableView? = null
|
private var mStartingChild: ExpandableView? = null
|
||||||
@@ -74,9 +87,13 @@ constructor(context: Context,
|
|||||||
private var mEmptyDragAmount: Float = 0.0f
|
private var mEmptyDragAmount: Float = 0.0f
|
||||||
private var mWakeUpHeight: Float = 0.0f
|
private var mWakeUpHeight: Float = 0.0f
|
||||||
private var mReachedWakeUpHeight: Boolean = false
|
private var mReachedWakeUpHeight: Boolean = false
|
||||||
|
private var velocityTracker: VelocityTracker? = null
|
||||||
|
|
||||||
private val isFalseTouch: Boolean
|
private val isFalseTouch: Boolean
|
||||||
get() = mFalsingManager.isFalseTouch
|
get() = mFalsingManager.isFalseTouch
|
||||||
|
var qsExpanded: Boolean = false
|
||||||
|
var pulseExpandAbortListener: Runnable? = null
|
||||||
|
var bouncerShowing: Boolean = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
mMinDragDistance = context.resources.getDimensionPixelSize(
|
mMinDragDistance = context.resources.getDimensionPixelSize(
|
||||||
@@ -91,9 +108,14 @@ constructor(context: Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun maybeStartExpansion(event: MotionEvent): Boolean {
|
private fun maybeStartExpansion(event: MotionEvent): Boolean {
|
||||||
if (!mPulsing) {
|
if (!wakeUpCoordinator.canShowPulsingHuns || qsExpanded
|
||||||
|
|| bouncerShowing) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (velocityTracker == null) {
|
||||||
|
velocityTracker = VelocityTracker.obtain()
|
||||||
|
}
|
||||||
|
velocityTracker!!.addMovement(event)
|
||||||
val x = event.x
|
val x = event.x
|
||||||
val y = event.y
|
val y = event.y
|
||||||
|
|
||||||
@@ -101,6 +123,7 @@ constructor(context: Context,
|
|||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
mDraggedFarEnough = false
|
mDraggedFarEnough = false
|
||||||
isExpanding = false
|
isExpanding = false
|
||||||
|
leavingLockscreen = false
|
||||||
mStartingChild = null
|
mStartingChild = null
|
||||||
mInitialTouchY = y
|
mInitialTouchY = y
|
||||||
mInitialTouchX = x
|
mInitialTouchX = x
|
||||||
@@ -114,29 +137,52 @@ constructor(context: Context,
|
|||||||
captureStartingChild(mInitialTouchX, mInitialTouchY)
|
captureStartingChild(mInitialTouchX, mInitialTouchY)
|
||||||
mInitialTouchY = y
|
mInitialTouchY = y
|
||||||
mInitialTouchX = x
|
mInitialTouchX = x
|
||||||
mWakeUpHeight = mWakeUpCoordinator.getWakeUpHeight()
|
mWakeUpHeight = wakeUpCoordinator.getWakeUpHeight()
|
||||||
mReachedWakeUpHeight = false
|
mReachedWakeUpHeight = false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_UP -> {
|
||||||
|
recycleVelocityTracker();
|
||||||
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_CANCEL -> {
|
||||||
|
recycleVelocityTracker();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun recycleVelocityTracker() {
|
||||||
|
velocityTracker?.recycle();
|
||||||
|
velocityTracker = null
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||||
if (!isExpanding) {
|
if (!isExpanding) {
|
||||||
return maybeStartExpansion(event)
|
return maybeStartExpansion(event)
|
||||||
}
|
}
|
||||||
|
velocityTracker!!.addMovement(event)
|
||||||
val y = event.y
|
val y = event.y
|
||||||
|
|
||||||
|
val moveDistance = y - mInitialTouchY
|
||||||
when (event.actionMasked) {
|
when (event.actionMasked) {
|
||||||
MotionEvent.ACTION_MOVE -> updateExpansionHeight(y - mInitialTouchY)
|
MotionEvent.ACTION_MOVE -> updateExpansionHeight(moveDistance)
|
||||||
MotionEvent.ACTION_UP -> if (!mFalsingManager.isUnlockingDisabled && !isFalseTouch) {
|
MotionEvent.ACTION_UP -> {
|
||||||
finishExpansion()
|
velocityTracker!!.computeCurrentVelocity(1000 /* units */)
|
||||||
} else {
|
val canExpand = moveDistance > 0 && velocityTracker!!.getYVelocity() > -1000
|
||||||
cancelExpansion()
|
if (!mFalsingManager.isUnlockingDisabled && !isFalseTouch && canExpand) {
|
||||||
|
finishExpansion()
|
||||||
|
} else {
|
||||||
|
cancelExpansion()
|
||||||
|
}
|
||||||
|
recycleVelocityTracker()
|
||||||
|
}
|
||||||
|
MotionEvent.ACTION_CANCEL -> {
|
||||||
|
cancelExpansion()
|
||||||
|
recycleVelocityTracker()
|
||||||
}
|
}
|
||||||
MotionEvent.ACTION_CANCEL -> cancelExpansion()
|
|
||||||
}
|
}
|
||||||
return isExpanding
|
return isExpanding
|
||||||
}
|
}
|
||||||
@@ -147,12 +193,15 @@ constructor(context: Context,
|
|||||||
setUserLocked(mStartingChild!!, false)
|
setUserLocked(mStartingChild!!, false)
|
||||||
mStartingChild = null
|
mStartingChild = null
|
||||||
}
|
}
|
||||||
|
if (shadeController.isDozing) {
|
||||||
|
isWakingToShadeLocked = true
|
||||||
|
wakeUpCoordinator.willWakeUp = true
|
||||||
|
mPowerManager!!.wakeUp(SystemClock.uptimeMillis(), WAKE_REASON_GESTURE,
|
||||||
|
"com.android.systemui:PULSEDRAG")
|
||||||
|
}
|
||||||
|
shadeController.goToLockedShade(mStartingChild)
|
||||||
|
leavingLockscreen = true;
|
||||||
isExpanding = false
|
isExpanding = false
|
||||||
isWakingToShadeLocked = true
|
|
||||||
mWakeUpCoordinator.willWakeUp = true
|
|
||||||
mPowerManager!!.wakeUp(SystemClock.uptimeMillis(), WAKE_REASON_GESTURE,
|
|
||||||
"com.android.systemui:PULSEDRAG")
|
|
||||||
mShadeController!!.goToLockedShade(mStartingChild)
|
|
||||||
if (mStartingChild is ExpandableNotificationRow) {
|
if (mStartingChild is ExpandableNotificationRow) {
|
||||||
val row = mStartingChild as ExpandableNotificationRow?
|
val row = mStartingChild as ExpandableNotificationRow?
|
||||||
row!!.onExpandedByGesture(true /* userExpanded */)
|
row!!.onExpandedByGesture(true /* userExpanded */)
|
||||||
@@ -172,12 +221,12 @@ constructor(context: Context,
|
|||||||
expansionHeight = max(newHeight.toFloat(), expansionHeight)
|
expansionHeight = max(newHeight.toFloat(), expansionHeight)
|
||||||
} else {
|
} else {
|
||||||
val target = if (mReachedWakeUpHeight) mWakeUpHeight else 0.0f
|
val target = if (mReachedWakeUpHeight) mWakeUpHeight else 0.0f
|
||||||
mWakeUpCoordinator.setNotificationsVisibleForExpansion(height > target,
|
wakeUpCoordinator.setNotificationsVisibleForExpansion(height > target,
|
||||||
true /* animate */,
|
true /* animate */,
|
||||||
true /* increaseSpeed */)
|
true /* increaseSpeed */)
|
||||||
expansionHeight = max(mWakeUpHeight, expansionHeight)
|
expansionHeight = max(mWakeUpHeight, expansionHeight)
|
||||||
}
|
}
|
||||||
val emptyDragAmount = mWakeUpCoordinator.setPulseHeight(expansionHeight)
|
val emptyDragAmount = wakeUpCoordinator.setPulseHeight(expansionHeight)
|
||||||
setEmptyDragAmount(emptyDragAmount * RUBBERBAND_FACTOR_STATIC)
|
setEmptyDragAmount(emptyDragAmount * RUBBERBAND_FACTOR_STATIC)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +241,7 @@ constructor(context: Context,
|
|||||||
|
|
||||||
private fun setEmptyDragAmount(amount: Float) {
|
private fun setEmptyDragAmount(amount: Float) {
|
||||||
mEmptyDragAmount = amount
|
mEmptyDragAmount = amount
|
||||||
mExpansionCallback!!.setEmptyDragAmount(amount)
|
expansionCallback.setEmptyDragAmount(amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun reset(child: ExpandableView) {
|
private fun reset(child: ExpandableView) {
|
||||||
@@ -227,6 +276,7 @@ constructor(context: Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun cancelExpansion() {
|
private fun cancelExpansion() {
|
||||||
|
isExpanding = false
|
||||||
mFalsingManager.onExpansionFromPulseStopped()
|
mFalsingManager.onExpansionFromPulseStopped()
|
||||||
if (mStartingChild != null) {
|
if (mStartingChild != null) {
|
||||||
reset(mStartingChild!!)
|
reset(mStartingChild!!)
|
||||||
@@ -234,30 +284,29 @@ constructor(context: Context,
|
|||||||
} else {
|
} else {
|
||||||
resetClock()
|
resetClock()
|
||||||
}
|
}
|
||||||
mWakeUpCoordinator.setNotificationsVisibleForExpansion(false /* visible */,
|
wakeUpCoordinator.setNotificationsVisibleForExpansion(false /* visible */,
|
||||||
true /* animate */,
|
true /* animate */,
|
||||||
false /* increaseSpeed */)
|
false /* increaseSpeed */)
|
||||||
isExpanding = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findView(x: Float, y: Float): ExpandableView? {
|
private fun findView(x: Float, y: Float): ExpandableView? {
|
||||||
var totalX = x
|
var totalX = x
|
||||||
var totalY = y
|
var totalY = y
|
||||||
mStackScroller.getLocationOnScreen(mTemp2)
|
stackScroller.getLocationOnScreen(mTemp2)
|
||||||
totalX += mTemp2[0].toFloat()
|
totalX += mTemp2[0].toFloat()
|
||||||
totalY += mTemp2[1].toFloat()
|
totalY += mTemp2[1].toFloat()
|
||||||
val childAtRawPosition = mStackScroller.getChildAtRawPosition(totalX, totalY)
|
val childAtRawPosition = stackScroller.getChildAtRawPosition(totalX, totalY)
|
||||||
return if (childAtRawPosition != null && childAtRawPosition.isContentExpandable) {
|
return if (childAtRawPosition != null && childAtRawPosition.isContentExpandable) {
|
||||||
childAtRawPosition
|
childAtRawPosition
|
||||||
} else null
|
} else null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setUp(notificationStackScroller: NotificationStackScrollLayout,
|
fun setUp(stackScroller: NotificationStackScrollLayout,
|
||||||
expansionCallback: ExpansionCallback,
|
expansionCallback: ExpansionCallback,
|
||||||
shadeController: ShadeController) {
|
shadeController: ShadeController) {
|
||||||
mExpansionCallback = expansionCallback
|
this.expansionCallback = expansionCallback
|
||||||
mShadeController = shadeController
|
this.shadeController = shadeController
|
||||||
mStackScroller = notificationStackScroller
|
this.stackScroller = stackScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setPulsing(pulsing: Boolean) {
|
fun setPulsing(pulsing: Boolean) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
private val mContext: Context,
|
private val mContext: Context,
|
||||||
private val mHeadsUpManagerPhone: HeadsUpManagerPhone,
|
private val mHeadsUpManagerPhone: HeadsUpManagerPhone,
|
||||||
private val mStatusBarStateController: StatusBarStateController,
|
private val mStatusBarStateController: StatusBarStateController,
|
||||||
private val mBypassController: KeyguardBypassController)
|
private val bypassController: KeyguardBypassController)
|
||||||
: OnHeadsUpChangedListener, StatusBarStateController.StateListener {
|
: OnHeadsUpChangedListener, StatusBarStateController.StateListener {
|
||||||
|
|
||||||
private val mNotificationVisibility
|
private val mNotificationVisibility
|
||||||
@@ -66,7 +66,11 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
private var mLinearVisibilityAmount = 0.0f
|
private var mLinearVisibilityAmount = 0.0f
|
||||||
private var mWakingUp = false
|
private var mWakingUp = false
|
||||||
private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>()
|
private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>()
|
||||||
private val mDozeParameters: DozeParameters;
|
private val mDozeParameters: DozeParameters
|
||||||
|
private var pulseExpanding: Boolean = false
|
||||||
|
private val wakeUpListeners = arrayListOf<WakeUpListener>()
|
||||||
|
var fullyAwake: Boolean = false
|
||||||
|
|
||||||
var willWakeUp = false
|
var willWakeUp = false
|
||||||
set(value) {
|
set(value) {
|
||||||
if (!value || mDozeAmount != 0.0f) {
|
if (!value || mDozeAmount != 0.0f) {
|
||||||
@@ -75,7 +79,6 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
lateinit var iconAreaController : NotificationIconAreaController
|
lateinit var iconAreaController : NotificationIconAreaController
|
||||||
|
|
||||||
var pulsing: Boolean = false
|
var pulsing: Boolean = false
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
@@ -88,6 +91,30 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var notificationsFullyHidden: Boolean = false
|
||||||
|
private set(value) {
|
||||||
|
if (field != value) {
|
||||||
|
field = value
|
||||||
|
for (listener in wakeUpListeners) {
|
||||||
|
listener.onFullyHiddenChanged(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if we can show pulsing heads up notifications
|
||||||
|
*/
|
||||||
|
var canShowPulsingHuns: Boolean = false
|
||||||
|
private set
|
||||||
|
get() {
|
||||||
|
var canShow = pulsing
|
||||||
|
if (bypassController.bypassEnabled) {
|
||||||
|
// We also allow pulsing on the lock screen!
|
||||||
|
canShow = canShow || (mWakingUp || willWakeUp || fullyAwake)
|
||||||
|
&& mStatusBarStateController.state == StatusBarState.KEYGUARD
|
||||||
|
}
|
||||||
|
return canShow
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
mHeadsUpManagerPhone.addListener(this)
|
mHeadsUpManagerPhone.addListener(this)
|
||||||
@@ -97,8 +124,19 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
|
|
||||||
fun setStackScroller(stackScroller: NotificationStackScrollLayout) {
|
fun setStackScroller(stackScroller: NotificationStackScrollLayout) {
|
||||||
mStackScroller = stackScroller
|
mStackScroller = stackScroller
|
||||||
|
pulseExpanding = stackScroller.isPulseExpanding
|
||||||
|
stackScroller.setOnPulseHeightChangedListener {
|
||||||
|
val nowExpanding = isPulseExpanding()
|
||||||
|
val changed = nowExpanding != pulseExpanding
|
||||||
|
pulseExpanding = nowExpanding
|
||||||
|
for (listener in wakeUpListeners) {
|
||||||
|
listener.onPulseExpansionChanged(changed)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isPulseExpanding(): Boolean = mStackScroller.isPulseExpanding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param visible should notifications be visible
|
* @param visible should notifications be visible
|
||||||
* @param animate should this change be animated
|
* @param animate should this change be animated
|
||||||
@@ -116,10 +154,19 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addListener(listener: WakeUpListener) {
|
||||||
|
wakeUpListeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeFullyHiddenChangedListener(listener: WakeUpListener) {
|
||||||
|
wakeUpListeners.remove(listener);
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateNotificationVisibility(animate: Boolean, increaseSpeed: Boolean) {
|
private fun updateNotificationVisibility(animate: Boolean, increaseSpeed: Boolean) {
|
||||||
// TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore
|
// TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore
|
||||||
var visible = (mNotificationsVisibleForExpansion || mHeadsUpManagerPhone.hasNotifications())
|
var visible = mNotificationsVisibleForExpansion || mHeadsUpManagerPhone.hasNotifications()
|
||||||
&& pulsing
|
visible = visible && canShowPulsingHuns
|
||||||
|
|
||||||
if (!visible && mNotificationsVisible && (mWakingUp || willWakeUp) && mDozeAmount != 0.0f) {
|
if (!visible && mNotificationsVisible && (mWakingUp || willWakeUp) && mDozeAmount != 0.0f) {
|
||||||
// let's not make notifications invisible while waking up, otherwise the animation
|
// let's not make notifications invisible while waking up, otherwise the animation
|
||||||
// is strange
|
// is strange
|
||||||
@@ -173,7 +220,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateDozeAmountIfBypass(): Boolean {
|
private fun updateDozeAmountIfBypass(): Boolean {
|
||||||
if (mBypassController.bypassEnabled) {
|
if (bypassController.bypassEnabled) {
|
||||||
var amount = 1.0f;
|
var amount = 1.0f;
|
||||||
if (mStatusBarStateController.state == StatusBarState.SHADE
|
if (mStatusBarStateController.state == StatusBarState.SHADE
|
||||||
|| mStatusBarStateController.state == StatusBarState.SHADE_LOCKED) {
|
|| mStatusBarStateController.state == StatusBarState.SHADE_LOCKED) {
|
||||||
@@ -220,14 +267,14 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getWakeUpHeight() : Float {
|
fun getWakeUpHeight() : Float {
|
||||||
return mStackScroller.pulseHeight
|
return mStackScroller.wakeUpHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateHideAmount() {
|
private fun updateHideAmount() {
|
||||||
val linearAmount = Math.min(1.0f - mLinearVisibilityAmount, mLinearDozeAmount)
|
val linearAmount = Math.min(1.0f - mLinearVisibilityAmount, mLinearDozeAmount)
|
||||||
val amount = Math.min(1.0f - mVisibilityAmount, mDozeAmount)
|
val amount = Math.min(1.0f - mVisibilityAmount, mDozeAmount)
|
||||||
mStackScroller.setHideAmount(linearAmount, amount)
|
mStackScroller.setHideAmount(linearAmount, amount)
|
||||||
iconAreaController.setFullyHidden(linearAmount == 1.0f);
|
notificationsFullyHidden = linearAmount == 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun notifyAnimationStart(awake: Boolean) {
|
private fun notifyAnimationStart(awake: Boolean) {
|
||||||
@@ -240,14 +287,21 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the height how tall notifications are pulsing. This is only set whenever we are expanding
|
||||||
|
* from a pulse and determines how much the notifications are expanded.
|
||||||
|
*/
|
||||||
fun setPulseHeight(height: Float): Float {
|
fun setPulseHeight(height: Float): Float {
|
||||||
return mStackScroller.setPulseHeight(height)
|
val overflow = mStackScroller.setPulseHeight(height)
|
||||||
|
// no overflow for the bypass experience
|
||||||
|
return if (bypassController.bypassEnabled) 0.0f else overflow
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setWakingUp(wakingUp: Boolean) {
|
fun setWakingUp(wakingUp: Boolean) {
|
||||||
willWakeUp = false
|
willWakeUp = false
|
||||||
mWakingUp = wakingUp
|
mWakingUp = wakingUp
|
||||||
if (wakingUp && mNotificationsVisible && !mNotificationsVisibleForExpansion) {
|
if (wakingUp && mNotificationsVisible && !mNotificationsVisibleForExpansion
|
||||||
|
&& !bypassController.bypassEnabled) {
|
||||||
// We're waking up while pulsing, let's make sure the animation looks nice
|
// We're waking up while pulsing, let's make sure the animation looks nice
|
||||||
mStackScroller.wakeUpFromPulse();
|
mStackScroller.wakeUpFromPulse();
|
||||||
}
|
}
|
||||||
@@ -276,4 +330,17 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
|||||||
|
|
||||||
private fun shouldAnimateVisibility() =
|
private fun shouldAnimateVisibility() =
|
||||||
mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking()
|
mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking()
|
||||||
|
|
||||||
|
interface WakeUpListener {
|
||||||
|
/**
|
||||||
|
* Called whenever the notifications are fully hidden or shown
|
||||||
|
*/
|
||||||
|
@JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called whenever the pulseExpansion changes
|
||||||
|
* @param expandingChanged if the user has started or stopped expanding
|
||||||
|
*/
|
||||||
|
@JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -660,6 +660,10 @@ public final class NotificationEntry {
|
|||||||
return row != null && row.isHeadsUp();
|
return row != null && row.isHeadsUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean showingPulsing() {
|
||||||
|
return row != null && row.showingPulsing();
|
||||||
|
}
|
||||||
|
|
||||||
public void setHeadsUp(boolean shouldHeadsUp) {
|
public void setHeadsUp(boolean shouldHeadsUp) {
|
||||||
if (row != null) row.setHeadsUp(shouldHeadsUp);
|
if (row != null) row.setHeadsUp(shouldHeadsUp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class AmbientState {
|
|||||||
private float mPulseHeight = MAX_PULSE_HEIGHT;
|
private float mPulseHeight = MAX_PULSE_HEIGHT;
|
||||||
private float mDozeAmount = 0.0f;
|
private float mDozeAmount = 0.0f;
|
||||||
private HeadsUpManager mHeadUpManager;
|
private HeadsUpManager mHeadUpManager;
|
||||||
|
private Runnable mOnPulseHeightChangedListener;
|
||||||
|
|
||||||
public AmbientState(
|
public AmbientState(
|
||||||
Context context,
|
Context context,
|
||||||
@@ -191,7 +192,7 @@ public class AmbientState {
|
|||||||
public void setHideAmount(float hidemount) {
|
public void setHideAmount(float hidemount) {
|
||||||
if (hidemount == 1.0f && mHideAmount != hidemount) {
|
if (hidemount == 1.0f && mHideAmount != hidemount) {
|
||||||
// Whenever we are fully hidden, let's reset the pulseHeight again
|
// Whenever we are fully hidden, let's reset the pulseHeight again
|
||||||
mPulseHeight = MAX_PULSE_HEIGHT;
|
setPulseHeight(MAX_PULSE_HEIGHT);
|
||||||
}
|
}
|
||||||
mHideAmount = hidemount;
|
mHideAmount = hidemount;
|
||||||
}
|
}
|
||||||
@@ -502,7 +503,20 @@ public class AmbientState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPulseHeight(float height) {
|
public void setPulseHeight(float height) {
|
||||||
mPulseHeight = height;
|
if (height != mPulseHeight) {
|
||||||
|
mPulseHeight = height;
|
||||||
|
if (mOnPulseHeightChangedListener != null) {
|
||||||
|
mOnPulseHeightChangedListener.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPulseHeight() {
|
||||||
|
if (mPulseHeight == MAX_PULSE_HEIGHT) {
|
||||||
|
// If we're not pulse expanding, the height should be 0
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mPulseHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDozeAmount(float dozeAmount) {
|
public void setDozeAmount(float dozeAmount) {
|
||||||
@@ -510,7 +524,7 @@ public class AmbientState {
|
|||||||
mDozeAmount = dozeAmount;
|
mDozeAmount = dozeAmount;
|
||||||
if (dozeAmount == 0.0f || dozeAmount == 1.0f) {
|
if (dozeAmount == 0.0f || dozeAmount == 1.0f) {
|
||||||
// We woke all the way up, let's reset the pulse height
|
// We woke all the way up, let's reset the pulse height
|
||||||
mPulseHeight = MAX_PULSE_HEIGHT;
|
setPulseHeight(MAX_PULSE_HEIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -522,4 +536,12 @@ public class AmbientState {
|
|||||||
public boolean isFullyAwake() {
|
public boolean isFullyAwake() {
|
||||||
return mDozeAmount == 0.0f;
|
return mDozeAmount == 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnPulseHeightChangedListener(Runnable onPulseHeightChangedListener) {
|
||||||
|
mOnPulseHeightChangedListener = onPulseHeightChangedListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Runnable getOnPulseHeightChangedListener() {
|
||||||
|
return mOnPulseHeightChangedListener;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
/**
|
/**
|
||||||
* @return the height at which we will wake up when pulsing
|
* @return the height at which we will wake up when pulsing
|
||||||
*/
|
*/
|
||||||
public float getPulseHeight() {
|
public float getWakeUpHeight() {
|
||||||
ActivatableNotificationView firstChild = getFirstChildWithBackground();
|
ActivatableNotificationView firstChild = getFirstChildWithBackground();
|
||||||
if (firstChild != null) {
|
if (firstChild != null) {
|
||||||
return firstChild.getCollapsedHeight();
|
return firstChild.getCollapsedHeight();
|
||||||
@@ -986,6 +986,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPulseExpanding() {
|
||||||
|
return mAmbientState.isPulseExpanding();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
@@ -2782,7 +2786,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
} else {
|
} else {
|
||||||
mTopPaddingOverflow = 0;
|
mTopPaddingOverflow = 0;
|
||||||
}
|
}
|
||||||
setTopPadding(topPadding, animate);
|
setTopPadding(topPadding, animate && !mKeyguardBypassController.getBypassEnabled());
|
||||||
setExpandedHeight(mExpandedHeight);
|
setExpandedHeight(mExpandedHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3276,7 +3280,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
@Override
|
@Override
|
||||||
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
|
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
|
||||||
public void generateAddAnimation(ExpandableView child, boolean fromMoreCard) {
|
public void generateAddAnimation(ExpandableView child, boolean fromMoreCard) {
|
||||||
if (mIsExpanded && mAnimationsEnabled && !mChangePositionInProgress) {
|
if (mIsExpanded && mAnimationsEnabled && !mChangePositionInProgress && !isFullyHidden()) {
|
||||||
// Generate Animations
|
// Generate Animations
|
||||||
mChildrenToAddAnimated.add(child);
|
mChildrenToAddAnimated.add(child);
|
||||||
if (fromMoreCard) {
|
if (fromMoreCard) {
|
||||||
@@ -3284,7 +3288,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
}
|
}
|
||||||
mNeedsAnimation = true;
|
mNeedsAnimation = true;
|
||||||
}
|
}
|
||||||
if (isHeadsUp(child) && mAnimationsEnabled && !mChangePositionInProgress) {
|
if (isHeadsUp(child) && mAnimationsEnabled && !mChangePositionInProgress
|
||||||
|
&& !isFullyHidden()) {
|
||||||
mAddedHeadsUpChildren.add(child);
|
mAddedHeadsUpChildren.add(child);
|
||||||
mChildrenToAddAnimated.remove(child);
|
mChildrenToAddAnimated.remove(child);
|
||||||
}
|
}
|
||||||
@@ -5585,6 +5590,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
return Math.max(0, height - mAmbientState.getInnerHeight(true /* ignorePulseHeight */));
|
return Math.max(0, height - mAmbientState.getInnerHeight(true /* ignorePulseHeight */));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getPulseHeight() {
|
||||||
|
return mAmbientState.getPulseHeight();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the amount how much we're dozing. This is different from how hidden the shade is, when
|
* Set the amount how much we're dozing. This is different from how hidden the shade is, when
|
||||||
* the notification is pulsing.
|
* the notification is pulsing.
|
||||||
@@ -5596,7 +5605,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void wakeUpFromPulse() {
|
public void wakeUpFromPulse() {
|
||||||
setPulseHeight(getPulseHeight());
|
setPulseHeight(getWakeUpHeight());
|
||||||
// Let's place the hidden views at the end of the pulsing notification to make sure we have
|
// Let's place the hidden views at the end of the pulsing notification to make sure we have
|
||||||
// a smooth animation
|
// a smooth animation
|
||||||
boolean firstVisibleView = true;
|
boolean firstVisibleView = true;
|
||||||
@@ -5632,6 +5641,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnPulseHeightChangedListener(Runnable listener) {
|
||||||
|
mAmbientState.setOnPulseHeightChangedListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A listener that is notified when the empty space below the notifications is clicked on
|
* A listener that is notified when the empty space below the notifications is clicked on
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startWakeAndUnlock(BiometricSourceType biometricSourceType) {
|
public void startWakeAndUnlock(BiometricSourceType biometricSourceType) {
|
||||||
startWakeAndUnlock(calculateMode(biometricSourceType));
|
startWakeAndUnlock(calculateMode(biometricSourceType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -472,8 +472,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
Runnable removeHeadsUpRunnable = () -> {
|
Runnable removeHeadsUpRunnable = () -> {
|
||||||
if (!mVisualStabilityManager.isReorderingAllowed()
|
if (!mVisualStabilityManager.isReorderingAllowed()
|
||||||
// We don't want to allow reordering while pulsing, but headsup need to
|
// We don't want to allow reordering while pulsing, but headsup need to
|
||||||
// time out if we're dozing.
|
// time out anyway
|
||||||
&& !mStatusBarStateController.isDozing()) {
|
&& !entry.showingPulsing()) {
|
||||||
mEntriesToRemoveWhenReorderingAllowed.add(entry);
|
mEntriesToRemoveWhenReorderingAllowed.add(entry);
|
||||||
mVisualStabilityManager.addReorderingAllowedCallback(
|
mVisualStabilityManager.addReorderingAllowedCallback(
|
||||||
HeadsUpManagerPhone.this);
|
HeadsUpManagerPhone.this);
|
||||||
|
|||||||
@@ -33,6 +33,14 @@ class KeyguardBypassController {
|
|||||||
private val unlockMethodCache: UnlockMethodCache
|
private val unlockMethodCache: UnlockMethodCache
|
||||||
private val statusBarStateController: StatusBarStateController
|
private val statusBarStateController: StatusBarStateController
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The pending unlock type which is set if the bypass was blocked when it happened.
|
||||||
|
*/
|
||||||
|
private var pendingUnlockType: BiometricSourceType? = null
|
||||||
|
|
||||||
|
lateinit var unlockController: BiometricUnlockController
|
||||||
|
var isPulseExpanding = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If face unlock dismisses the lock screen or keeps user on keyguard for the current user.
|
* If face unlock dismisses the lock screen or keeps user on keyguard for the current user.
|
||||||
*/
|
*/
|
||||||
@@ -40,13 +48,20 @@ class KeyguardBypassController {
|
|||||||
get() = field && unlockMethodCache.isUnlockingWithFacePossible
|
get() = field && unlockMethodCache.isUnlockingWithFacePossible
|
||||||
private set
|
private set
|
||||||
|
|
||||||
lateinit var unlockController: BiometricUnlockController
|
var bouncerShowing: Boolean = false
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
constructor(context: Context, tunerService: TunerService,
|
constructor(context: Context, tunerService: TunerService,
|
||||||
statusBarStateController: StatusBarStateController) {
|
statusBarStateController: StatusBarStateController) {
|
||||||
unlockMethodCache = UnlockMethodCache.getInstance(context)
|
unlockMethodCache = UnlockMethodCache.getInstance(context)
|
||||||
this.statusBarStateController = statusBarStateController
|
this.statusBarStateController = statusBarStateController
|
||||||
|
statusBarStateController.addCallback(object : StatusBarStateController.StateListener {
|
||||||
|
override fun onStateChanged(newState: Int) {
|
||||||
|
if (newState != StatusBarState.KEYGUARD) {
|
||||||
|
pendingUnlockType = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
val faceManager = context.getSystemService(FaceManager::class.java)
|
val faceManager = context.getSystemService(FaceManager::class.java)
|
||||||
if (faceManager?.isHardwareDetected != true) {
|
if (faceManager?.isHardwareDetected != true) {
|
||||||
return
|
return
|
||||||
@@ -72,11 +87,35 @@ class KeyguardBypassController {
|
|||||||
* @return false if we can not wake and unlock right now
|
* @return false if we can not wake and unlock right now
|
||||||
*/
|
*/
|
||||||
fun onBiometricAuthenticated(biometricSourceType: BiometricSourceType): Boolean {
|
fun onBiometricAuthenticated(biometricSourceType: BiometricSourceType): Boolean {
|
||||||
if (bypassEnabled && statusBarStateController.state != StatusBarState.KEYGUARD) {
|
if (bypassEnabled) {
|
||||||
// We're bypassing but not actually on the lockscreen, the user should decide when
|
if (bouncerShowing) {
|
||||||
// to unlock
|
// Whenever the bouncer is showing, we want to unlock. Otherwise we can get stuck
|
||||||
return false
|
// in the shade locked where the bouncer wouldn't unlock
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (statusBarStateController.state != StatusBarState.KEYGUARD) {
|
||||||
|
// We're bypassing but not actually on the lockscreen, the user should decide when
|
||||||
|
// to unlock
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (isPulseExpanding) {
|
||||||
|
pendingUnlockType = biometricSourceType
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun maybePerformPendingUnlock() {
|
||||||
|
if (pendingUnlockType != null) {
|
||||||
|
if (onBiometricAuthenticated(pendingUnlockType!!)) {
|
||||||
|
unlockController.startWakeAndUnlock(pendingUnlockType)
|
||||||
|
pendingUnlockType = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onStartedGoingToSleep() {
|
||||||
|
pendingUnlockType = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,10 +112,15 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
private float mEmptyDragAmount;
|
private float mEmptyDragAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true the clock should always be positioned like it's dark. Used in the bypass, where
|
* Setting if bypass is enabled. If true the clock should always be positioned like it's dark
|
||||||
* notifications don't expand on the lock screen and should be kept stable
|
* and other minor adjustments.
|
||||||
*/
|
*/
|
||||||
private boolean mPositionLikeDark;
|
private boolean mBypassEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The stackscroller padding when unlocked
|
||||||
|
*/
|
||||||
|
private int mUnlockedStackScrollerPadding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refreshes the dimension values.
|
* Refreshes the dimension values.
|
||||||
@@ -139,7 +144,7 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight,
|
public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight,
|
||||||
float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY,
|
float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY,
|
||||||
boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount,
|
boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount,
|
||||||
boolean positionLikeDark) {
|
boolean bypassEnabled, int unlockedStackScrollerPadding) {
|
||||||
mMinTopMargin = minTopMargin + mContainerTopPadding;
|
mMinTopMargin = minTopMargin + mContainerTopPadding;
|
||||||
mMaxShadeBottom = maxShadeBottom;
|
mMaxShadeBottom = maxShadeBottom;
|
||||||
mNotificationStackHeight = notificationStackHeight;
|
mNotificationStackHeight = notificationStackHeight;
|
||||||
@@ -151,20 +156,24 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
mHasVisibleNotifs = hasVisibleNotifs;
|
mHasVisibleNotifs = hasVisibleNotifs;
|
||||||
mDarkAmount = dark;
|
mDarkAmount = dark;
|
||||||
mEmptyDragAmount = emptyDragAmount;
|
mEmptyDragAmount = emptyDragAmount;
|
||||||
mPositionLikeDark = positionLikeDark;
|
mBypassEnabled = bypassEnabled;
|
||||||
|
mUnlockedStackScrollerPadding = unlockedStackScrollerPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Result result) {
|
public void run(Result result) {
|
||||||
final int y = getClockY(mPanelExpansion);
|
final int y = getClockY(mPanelExpansion);
|
||||||
result.clockY = y;
|
result.clockY = y;
|
||||||
result.clockAlpha = getClockAlpha(y);
|
result.clockAlpha = getClockAlpha(y);
|
||||||
result.stackScrollerPadding = y + mKeyguardStatusHeight;
|
result.stackScrollerPadding = mBypassEnabled ? mUnlockedStackScrollerPadding
|
||||||
result.stackScrollerPaddingExpanded = getClockY(1.0f) + mKeyguardStatusHeight;
|
: y + mKeyguardStatusHeight;
|
||||||
|
result.stackScrollerPaddingExpanded = mBypassEnabled ? mUnlockedStackScrollerPadding
|
||||||
|
: getClockY(1.0f) + mKeyguardStatusHeight;
|
||||||
result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount);
|
result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getMinStackScrollerPadding() {
|
public float getMinStackScrollerPadding() {
|
||||||
return mMinTopMargin + mKeyguardStatusHeight + mClockNotificationsMargin;
|
return mBypassEnabled ? mUnlockedStackScrollerPadding
|
||||||
|
: mMinTopMargin + mKeyguardStatusHeight + mClockNotificationsMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMaxClockY() {
|
private int getMaxClockY() {
|
||||||
@@ -176,7 +185,7 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getExpandedPreferredClockY() {
|
private int getExpandedPreferredClockY() {
|
||||||
return (mHasCustomClock && (!mHasVisibleNotifs || mPositionLikeDark)) ? getPreferredClockY()
|
return (mHasCustomClock && (!mHasVisibleNotifs || mBypassEnabled)) ? getPreferredClockY()
|
||||||
: getExpandedClockPosition();
|
: getExpandedClockPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +227,7 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion);
|
float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion);
|
||||||
clockYDark = MathUtils.lerp(clockYBouncer, clockYDark, shadeExpansion);
|
clockYDark = MathUtils.lerp(clockYBouncer, clockYDark, shadeExpansion);
|
||||||
|
|
||||||
float darkAmount = mPositionLikeDark && !mHasCustomClock ? 1.0f : mDarkAmount;
|
float darkAmount = mBypassEnabled && !mHasCustomClock ? 1.0f : mDarkAmount;
|
||||||
return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mEmptyDragAmount);
|
return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mEmptyDragAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ import com.android.systemui.R;
|
|||||||
import com.android.systemui.dock.DockManager;
|
import com.android.systemui.dock.DockManager;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.statusbar.KeyguardAffordanceView;
|
import com.android.systemui.statusbar.KeyguardAffordanceView;
|
||||||
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
|
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||||
import com.android.systemui.statusbar.phone.ScrimController.ScrimVisibility;
|
import com.android.systemui.statusbar.phone.ScrimController.ScrimVisibility;
|
||||||
import com.android.systemui.statusbar.policy.AccessibilityController;
|
import com.android.systemui.statusbar.policy.AccessibilityController;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
@@ -64,7 +66,8 @@ import javax.inject.Named;
|
|||||||
*/
|
*/
|
||||||
public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChangedListener,
|
public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChangedListener,
|
||||||
StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener,
|
StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener,
|
||||||
UnlockMethodCache.OnUnlockMethodChangedListener {
|
UnlockMethodCache.OnUnlockMethodChangedListener,
|
||||||
|
NotificationWakeUpCoordinator.WakeUpListener {
|
||||||
|
|
||||||
private static final int STATE_LOCKED = 0;
|
private static final int STATE_LOCKED = 0;
|
||||||
private static final int STATE_LOCK_OPEN = 1;
|
private static final int STATE_LOCK_OPEN = 1;
|
||||||
@@ -78,6 +81,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
private final DockManager mDockManager;
|
private final DockManager mDockManager;
|
||||||
private final Handler mMainHandler;
|
private final Handler mMainHandler;
|
||||||
private final KeyguardMonitor mKeyguardMonitor;
|
private final KeyguardMonitor mKeyguardMonitor;
|
||||||
|
private final KeyguardBypassController mBypassController;
|
||||||
|
private final NotificationWakeUpCoordinator mWakeUpCoordinator;
|
||||||
|
|
||||||
private int mLastState = 0;
|
private int mLastState = 0;
|
||||||
private boolean mTransientBiometricsError;
|
private boolean mTransientBiometricsError;
|
||||||
@@ -92,6 +97,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
private int mIconColor;
|
private int mIconColor;
|
||||||
private float mDozeAmount;
|
private float mDozeAmount;
|
||||||
private int mIconRes;
|
private int mIconRes;
|
||||||
|
private boolean mBouncerShowing;
|
||||||
private boolean mWasPulsingOnThisFrame;
|
private boolean mWasPulsingOnThisFrame;
|
||||||
private boolean mWakeAndUnlockRunning;
|
private boolean mWakeAndUnlockRunning;
|
||||||
private boolean mKeyguardShowing;
|
private boolean mKeyguardShowing;
|
||||||
@@ -150,6 +156,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
StatusBarStateController statusBarStateController,
|
StatusBarStateController statusBarStateController,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
AccessibilityController accessibilityController,
|
AccessibilityController accessibilityController,
|
||||||
|
KeyguardBypassController bypassController,
|
||||||
|
NotificationWakeUpCoordinator wakeUpCoordinator,
|
||||||
KeyguardMonitor keyguardMonitor,
|
KeyguardMonitor keyguardMonitor,
|
||||||
@Nullable DockManager dockManager,
|
@Nullable DockManager dockManager,
|
||||||
@Named(MAIN_HANDLER_NAME) Handler mainHandler) {
|
@Named(MAIN_HANDLER_NAME) Handler mainHandler) {
|
||||||
@@ -160,6 +168,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
mAccessibilityController = accessibilityController;
|
mAccessibilityController = accessibilityController;
|
||||||
mConfigurationController = configurationController;
|
mConfigurationController = configurationController;
|
||||||
mStatusBarStateController = statusBarStateController;
|
mStatusBarStateController = statusBarStateController;
|
||||||
|
mBypassController = bypassController;
|
||||||
|
mWakeUpCoordinator = wakeUpCoordinator;
|
||||||
mKeyguardMonitor = keyguardMonitor;
|
mKeyguardMonitor = keyguardMonitor;
|
||||||
mDockManager = dockManager;
|
mDockManager = dockManager;
|
||||||
mMainHandler = mainHandler;
|
mMainHandler = mainHandler;
|
||||||
@@ -173,6 +183,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
mKeyguardMonitor.addCallback(mKeyguardMonitorCallback);
|
mKeyguardMonitor.addCallback(mKeyguardMonitorCallback);
|
||||||
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
|
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
|
||||||
mUnlockMethodCache.addListener(this);
|
mUnlockMethodCache.addListener(this);
|
||||||
|
mWakeUpCoordinator.addListener(this);
|
||||||
mSimLocked = mKeyguardUpdateMonitor.isSimPinSecure();
|
mSimLocked = mKeyguardUpdateMonitor.isSimPinSecure();
|
||||||
if (mDockManager != null) {
|
if (mDockManager != null) {
|
||||||
mDockManager.addListener(mDockEventListener);
|
mDockManager.addListener(mDockEventListener);
|
||||||
@@ -187,6 +198,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
mConfigurationController.removeCallback(this);
|
mConfigurationController.removeCallback(this);
|
||||||
mKeyguardUpdateMonitor.removeCallback(mUpdateMonitorCallback);
|
mKeyguardUpdateMonitor.removeCallback(mUpdateMonitorCallback);
|
||||||
mKeyguardMonitor.removeCallback(mKeyguardMonitorCallback);
|
mKeyguardMonitor.removeCallback(mKeyguardMonitorCallback);
|
||||||
|
mWakeUpCoordinator.removeFullyHiddenChangedListener(this);
|
||||||
mUnlockMethodCache.removeListener(this);
|
mUnlockMethodCache.removeListener(this);
|
||||||
if (mDockManager != null) {
|
if (mDockManager != null) {
|
||||||
mDockManager.removeListener(mDockEventListener);
|
mDockManager.removeListener(mDockEventListener);
|
||||||
@@ -279,6 +291,12 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked);
|
boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked);
|
||||||
boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
|
boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
|
||||||
|| mShowingLaunchAffordance;
|
|| mShowingLaunchAffordance;
|
||||||
|
if (mBypassController.getBypassEnabled()
|
||||||
|
&& mStatusBarStateController.getState() == StatusBarState.KEYGUARD
|
||||||
|
&& !mWakeUpCoordinator.getNotificationsFullyHidden()
|
||||||
|
&& !mBouncerShowing) {
|
||||||
|
invisible = true;
|
||||||
|
}
|
||||||
setVisibility(invisible ? INVISIBLE : VISIBLE);
|
setVisibility(invisible ? INVISIBLE : VISIBLE);
|
||||||
updateClickability();
|
updateClickability();
|
||||||
}
|
}
|
||||||
@@ -369,6 +387,20 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFullyHiddenChanged(boolean isFullyHidden) {
|
||||||
|
if (mBypassController.getBypassEnabled()) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBouncerShowing(boolean bouncerShowing) {
|
||||||
|
mBouncerShowing = bouncerShowing;
|
||||||
|
if (mBypassController.getBypassEnabled()) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({ERROR, UNLOCK, LOCK, SCANNING, LOCK_IN})
|
@IntDef({ERROR, UNLOCK, LOCK, SCANNING, LOCK_IN})
|
||||||
@interface LockAnimIndex {}
|
@interface LockAnimIndex {}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.android.systemui.statusbar.StatusBarIconView;
|
|||||||
import com.android.systemui.statusbar.StatusBarState;
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||||
import com.android.systemui.statusbar.notification.NotificationUtils;
|
import com.android.systemui.statusbar.notification.NotificationUtils;
|
||||||
|
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||||
|
|
||||||
@@ -41,7 +42,8 @@ import java.util.function.Function;
|
|||||||
* normally reserved for notifications.
|
* normally reserved for notifications.
|
||||||
*/
|
*/
|
||||||
public class NotificationIconAreaController implements DarkReceiver,
|
public class NotificationIconAreaController implements DarkReceiver,
|
||||||
StatusBarStateController.StateListener {
|
StatusBarStateController.StateListener,
|
||||||
|
NotificationWakeUpCoordinator.WakeUpListener {
|
||||||
|
|
||||||
public static final String HIGH_PRIORITY = "high_priority";
|
public static final String HIGH_PRIORITY = "high_priority";
|
||||||
private static final long AOD_ICONS_APPEAR_DURATION = 200;
|
private static final long AOD_ICONS_APPEAR_DURATION = 200;
|
||||||
@@ -51,6 +53,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons;
|
private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons;
|
||||||
private final StatusBarStateController mStatusBarStateController;
|
private final StatusBarStateController mStatusBarStateController;
|
||||||
private final NotificationMediaManager mMediaManager;
|
private final NotificationMediaManager mMediaManager;
|
||||||
|
private final NotificationWakeUpCoordinator mWakeUpCoordinator;
|
||||||
|
private final KeyguardBypassController mBypassController;
|
||||||
private final DozeParameters mDozeParameters;
|
private final DozeParameters mDozeParameters;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final NotificationListener.NotificationSettingsListener mSettingsListener =
|
final NotificationListener.NotificationSettingsListener mSettingsListener =
|
||||||
@@ -91,6 +95,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
|
|
||||||
public NotificationIconAreaController(Context context, StatusBar statusBar,
|
public NotificationIconAreaController(Context context, StatusBar statusBar,
|
||||||
StatusBarStateController statusBarStateController,
|
StatusBarStateController statusBarStateController,
|
||||||
|
NotificationWakeUpCoordinator wakeUpCoordinator,
|
||||||
|
KeyguardBypassController keyguardBypassController,
|
||||||
NotificationListener notificationListener,
|
NotificationListener notificationListener,
|
||||||
NotificationMediaManager notificationMediaManager) {
|
NotificationMediaManager notificationMediaManager) {
|
||||||
mStatusBar = statusBar;
|
mStatusBar = statusBar;
|
||||||
@@ -102,6 +108,9 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
mMediaManager = notificationMediaManager;
|
mMediaManager = notificationMediaManager;
|
||||||
notificationListener.addNotificationSettingsListener(mSettingsListener);
|
notificationListener.addNotificationSettingsListener(mSettingsListener);
|
||||||
mDozeParameters = DozeParameters.getInstance(mContext);
|
mDozeParameters = DozeParameters.getInstance(mContext);
|
||||||
|
mWakeUpCoordinator = wakeUpCoordinator;
|
||||||
|
wakeUpCoordinator.addListener(this);
|
||||||
|
mBypassController = keyguardBypassController;
|
||||||
|
|
||||||
initializeNotificationAreaViews(context);
|
initializeNotificationAreaViews(context);
|
||||||
reloadAodColor();
|
reloadAodColor();
|
||||||
@@ -238,7 +247,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
|
|
||||||
protected boolean shouldShowNotificationIcon(NotificationEntry entry,
|
protected boolean shouldShowNotificationIcon(NotificationEntry entry,
|
||||||
boolean showAmbient, boolean showLowPriority, boolean hideDismissed,
|
boolean showAmbient, boolean showLowPriority, boolean hideDismissed,
|
||||||
boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon) {
|
boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon,
|
||||||
|
boolean hidePulsing) {
|
||||||
|
|
||||||
final boolean isCenteredNotificationIcon = entry.centeredIcon != null
|
final boolean isCenteredNotificationIcon = entry.centeredIcon != null
|
||||||
&& Objects.equals(entry.centeredIcon, mCenteredIconView);
|
&& Objects.equals(entry.centeredIcon, mCenteredIconView);
|
||||||
@@ -270,6 +280,9 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
if (!showAmbient && entry.shouldSuppressStatusBar()) {
|
if (!showAmbient && entry.shouldSuppressStatusBar()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (hidePulsing && entry.showingPulsing()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +305,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
false /* hideDismissed */,
|
false /* hideDismissed */,
|
||||||
false /* hideRepliedMessages */,
|
false /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
true /* hide centered icon */);
|
true /* hide centered icon */,
|
||||||
|
false /* hidePulsing */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateStatusBarIcons() {
|
public void updateStatusBarIcons() {
|
||||||
@@ -302,7 +316,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
true /* hideDismissed */,
|
true /* hideDismissed */,
|
||||||
true /* hideRepliedMessages */,
|
true /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
true /* hide centered icon */);
|
true /* hide centered icon */,
|
||||||
|
false /* hidePulsing */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCenterIcon() {
|
private void updateCenterIcon() {
|
||||||
@@ -312,7 +327,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
false /* hideDismissed */,
|
false /* hideDismissed */,
|
||||||
false /* hideRepliedMessages */,
|
false /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
false /* hide centered icon */);
|
false /* hide centered icon */,
|
||||||
|
false /* hidePulsing */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAodIcons() {
|
public void updateAodIcons() {
|
||||||
@@ -322,7 +338,8 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
true /* hideDismissed */,
|
true /* hideDismissed */,
|
||||||
true /* hideRepliedMessages */,
|
true /* hideRepliedMessages */,
|
||||||
true /* hideCurrentMedia */,
|
true /* hideCurrentMedia */,
|
||||||
true /* hide centered icon */);
|
true /* hide centered icon */,
|
||||||
|
mBypassController.getBypassEnabled() /* hidePulsing */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -338,11 +355,12 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
* @param showAmbient should ambient notification icons be shown
|
* @param showAmbient should ambient notification icons be shown
|
||||||
* @param hideDismissed should dismissed icons be hidden
|
* @param hideDismissed should dismissed icons be hidden
|
||||||
* @param hideRepliedMessages should messages that have been replied to be hidden
|
* @param hideRepliedMessages should messages that have been replied to be hidden
|
||||||
|
* @param hidePulsing should pulsing notifications be hidden
|
||||||
*/
|
*/
|
||||||
private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function,
|
private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function,
|
||||||
NotificationIconContainer hostLayout, boolean showAmbient, boolean showLowPriority,
|
NotificationIconContainer hostLayout, boolean showAmbient, boolean showLowPriority,
|
||||||
boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia,
|
boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia,
|
||||||
boolean hideCenteredIcon) {
|
boolean hideCenteredIcon, boolean hidePulsing) {
|
||||||
ArrayList<StatusBarIconView> toShow = new ArrayList<>(
|
ArrayList<StatusBarIconView> toShow = new ArrayList<>(
|
||||||
mNotificationScrollLayout.getChildCount());
|
mNotificationScrollLayout.getChildCount());
|
||||||
|
|
||||||
@@ -352,7 +370,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
if (view instanceof ExpandableNotificationRow) {
|
if (view instanceof ExpandableNotificationRow) {
|
||||||
NotificationEntry ent = ((ExpandableNotificationRow) view).getEntry();
|
NotificationEntry ent = ((ExpandableNotificationRow) view).getEntry();
|
||||||
if (shouldShowNotificationIcon(ent, showAmbient, showLowPriority, hideDismissed,
|
if (shouldShowNotificationIcon(ent, showAmbient, showLowPriority, hideDismissed,
|
||||||
hideRepliedMessages, hideCurrentMedia, hideCenteredIcon)) {
|
hideRepliedMessages, hideCurrentMedia, hideCenteredIcon, hidePulsing)) {
|
||||||
StatusBarIconView iconView = function.apply(ent);
|
StatusBarIconView iconView = function.apply(ent);
|
||||||
if (iconView != null) {
|
if (iconView != null) {
|
||||||
toShow.add(iconView);
|
toShow.add(iconView);
|
||||||
@@ -514,6 +532,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStateChanged(int newState) {
|
public void onStateChanged(int newState) {
|
||||||
|
updateAodIconsVisibility();
|
||||||
updateAnimations();
|
updateAnimations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,17 +581,31 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFullyHidden(boolean fullyHidden) {
|
@Override
|
||||||
if (mFullyHidden != fullyHidden) {
|
public void onFullyHiddenChanged(boolean fullyHidden) {
|
||||||
mFullyHidden = fullyHidden;
|
if (fullyHidden && !mBypassController.getBypassEnabled()) {
|
||||||
if (fullyHidden) {
|
appearAodIcons();
|
||||||
appearAodIcons();
|
}
|
||||||
}
|
updateAodIconsVisibility();
|
||||||
|
updateAodIcons();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPulseExpansionChanged(boolean expandingChanged) {
|
||||||
|
if (expandingChanged) {
|
||||||
updateAodIconsVisibility();
|
updateAodIconsVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAodIconsVisibility() {
|
private void updateAodIconsVisibility() {
|
||||||
mAodIcons.setVisibility(mFullyHidden ? View.VISIBLE : View.INVISIBLE);
|
boolean visible = mBypassController.getBypassEnabled()
|
||||||
|
|| mWakeUpCoordinator.getNotificationsFullyHidden();
|
||||||
|
if (mStatusBarStateController.getState() != StatusBarState.KEYGUARD) {
|
||||||
|
visible = false;
|
||||||
|
}
|
||||||
|
if (visible && mWakeUpCoordinator.isPulseExpanding()) {
|
||||||
|
visible = false;
|
||||||
|
}
|
||||||
|
mAodIcons.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
KeyguardAffordanceHelper.Callback, NotificationStackScrollLayout.OnEmptySpaceClickListener,
|
KeyguardAffordanceHelper.Callback, NotificationStackScrollLayout.OnEmptySpaceClickListener,
|
||||||
OnHeadsUpChangedListener, QS.HeightListener, ZenModeController.Callback,
|
OnHeadsUpChangedListener, QS.HeightListener, ZenModeController.Callback,
|
||||||
ConfigurationController.ConfigurationListener, StateListener,
|
ConfigurationController.ConfigurationListener, StateListener,
|
||||||
PulseExpansionHandler.ExpansionCallback, DynamicPrivacyController.Listener {
|
PulseExpansionHandler.ExpansionCallback, DynamicPrivacyController.Listener,
|
||||||
|
NotificationWakeUpCoordinator.WakeUpListener {
|
||||||
|
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
@@ -213,6 +214,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
private int mNotificationsHeaderCollideDistance;
|
private int mNotificationsHeaderCollideDistance;
|
||||||
private int mUnlockMoveDistance;
|
private int mUnlockMoveDistance;
|
||||||
private float mEmptyDragAmount;
|
private float mEmptyDragAmount;
|
||||||
|
private float mDownX;
|
||||||
|
private float mDownY;
|
||||||
|
|
||||||
private final KeyguardClockPositionAlgorithm mClockPositionAlgorithm =
|
private final KeyguardClockPositionAlgorithm mClockPositionAlgorithm =
|
||||||
new KeyguardClockPositionAlgorithm();
|
new KeyguardClockPositionAlgorithm();
|
||||||
@@ -350,6 +353,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
private int mShelfHeight;
|
private int mShelfHeight;
|
||||||
private Runnable mOnReinflationListener;
|
private Runnable mOnReinflationListener;
|
||||||
private int mDarkIconSize;
|
private int mDarkIconSize;
|
||||||
|
private int mHeadsUpInset;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
|
public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
|
||||||
@@ -371,6 +375,11 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mCommandQueue = getComponent(context, CommandQueue.class);
|
mCommandQueue = getComponent(context, CommandQueue.class);
|
||||||
mDisplayId = context.getDisplayId();
|
mDisplayId = context.getDisplayId();
|
||||||
mPulseExpansionHandler = pulseExpansionHandler;
|
mPulseExpansionHandler = pulseExpansionHandler;
|
||||||
|
pulseExpansionHandler.setPulseExpandAbortListener(() -> {
|
||||||
|
if (mQs != null) {
|
||||||
|
mQs.animateHeaderSlidingOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
mThemeResId = context.getThemeResId();
|
mThemeResId = context.getThemeResId();
|
||||||
mKeyguardBypassController = bypassController;
|
mKeyguardBypassController = bypassController;
|
||||||
dynamicPrivacyController.addListener(this);
|
dynamicPrivacyController.addListener(this);
|
||||||
@@ -421,6 +430,16 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mWakeUpCoordinator.setStackScroller(mNotificationStackScroller);
|
mWakeUpCoordinator.setStackScroller(mNotificationStackScroller);
|
||||||
mQsFrame = findViewById(R.id.qs_frame);
|
mQsFrame = findViewById(R.id.qs_frame);
|
||||||
mPulseExpansionHandler.setUp(mNotificationStackScroller, this, mShadeController);
|
mPulseExpansionHandler.setUp(mNotificationStackScroller, this, mShadeController);
|
||||||
|
mWakeUpCoordinator.addListener(new NotificationWakeUpCoordinator.WakeUpListener() {
|
||||||
|
@Override
|
||||||
|
public void onPulseExpansionChanged(boolean expandingChanged) {
|
||||||
|
if (mKeyguardBypassController.getBypassEnabled()) {
|
||||||
|
// Position the notifications while dragging down while pulsing
|
||||||
|
requestScrollerTopPaddingUpdate(false /* animate */);
|
||||||
|
updateQSPulseExpansion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -468,6 +487,10 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mShelfHeight = getResources().getDimensionPixelSize(R.dimen.notification_shelf_height);
|
mShelfHeight = getResources().getDimensionPixelSize(R.dimen.notification_shelf_height);
|
||||||
mDarkIconSize = getResources().getDimensionPixelSize(
|
mDarkIconSize = getResources().getDimensionPixelSize(
|
||||||
R.dimen.status_bar_icon_drawing_size_dark);
|
R.dimen.status_bar_icon_drawing_size_dark);
|
||||||
|
int statusbarHeight = getResources().getDimensionPixelSize(
|
||||||
|
com.android.internal.R.dimen.status_bar_height);
|
||||||
|
mHeadsUpInset = statusbarHeight + getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.heads_up_status_bar_padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -681,12 +704,12 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
boolean animateClock = animate || mAnimateNextPositionUpdate;
|
boolean animateClock = animate || mAnimateNextPositionUpdate;
|
||||||
int stackScrollerPadding;
|
int stackScrollerPadding;
|
||||||
if (mBarState != StatusBarState.KEYGUARD) {
|
if (mBarState != StatusBarState.KEYGUARD) {
|
||||||
stackScrollerPadding = (mQs != null ? mQs.getHeader().getHeight() : 0) + mQsPeekHeight
|
stackScrollerPadding = getUnlockedStackScrollerPadding();
|
||||||
+ mQsNotificationTopPadding;
|
|
||||||
} else {
|
} else {
|
||||||
int totalHeight = getHeight();
|
int totalHeight = getHeight();
|
||||||
int bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding);
|
int bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding);
|
||||||
int clockPreferredY = mKeyguardStatusView.getClockPreferredY(totalHeight);
|
int clockPreferredY = mKeyguardStatusView.getClockPreferredY(totalHeight);
|
||||||
|
boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled();
|
||||||
mClockPositionAlgorithm.setup(
|
mClockPositionAlgorithm.setup(
|
||||||
mStatusBarMinHeight,
|
mStatusBarMinHeight,
|
||||||
totalHeight - bottomPadding,
|
totalHeight - bottomPadding,
|
||||||
@@ -700,7 +723,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mNotificationStackScroller.getVisibleNotificationCount() != 0,
|
mNotificationStackScroller.getVisibleNotificationCount() != 0,
|
||||||
mInterpolatedDarkAmount,
|
mInterpolatedDarkAmount,
|
||||||
mEmptyDragAmount,
|
mEmptyDragAmount,
|
||||||
mKeyguardBypassController.getBypassEnabled());
|
bypassEnabled,
|
||||||
|
getUnlockedStackScrollerPadding());
|
||||||
mClockPositionAlgorithm.run(mClockPositionResult);
|
mClockPositionAlgorithm.run(mClockPositionResult);
|
||||||
PropertyAnimator.setProperty(mKeyguardStatusView, AnimatableProperty.X,
|
PropertyAnimator.setProperty(mKeyguardStatusView, AnimatableProperty.X,
|
||||||
mClockPositionResult.clockX, CLOCK_ANIMATION_PROPERTIES, animateClock);
|
mClockPositionResult.clockX, CLOCK_ANIMATION_PROPERTIES, animateClock);
|
||||||
@@ -720,6 +744,14 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mAnimateNextPositionUpdate = false;
|
mAnimateNextPositionUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the padding of the stackscroller when unlocked
|
||||||
|
*/
|
||||||
|
private int getUnlockedStackScrollerPadding() {
|
||||||
|
return (mQs != null ? mQs.getHeader().getHeight() : 0) + mQsPeekHeight
|
||||||
|
+ mQsNotificationTopPadding;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param maximum the maximum to return at most
|
* @param maximum the maximum to return at most
|
||||||
* @return the maximum keyguard notifications that can fit on the screen
|
* @return the maximum keyguard notifications that can fit on the screen
|
||||||
@@ -902,7 +934,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_PEEK, 1);
|
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_PEEK, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mPulseExpansionHandler.onInterceptTouchEvent(event)) {
|
if (!shouldQuickSettingsIntercept(mDownX, mDownY, 0)
|
||||||
|
&& mPulseExpansionHandler.onInterceptTouchEvent(event)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1003,6 +1036,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mOnlyAffordanceInThisMotion = false;
|
mOnlyAffordanceInThisMotion = false;
|
||||||
mQsTouchAboveFalsingThreshold = mQsFullyExpanded;
|
mQsTouchAboveFalsingThreshold = mQsFullyExpanded;
|
||||||
mDozingOnDown = isDozing();
|
mDozingOnDown = isDozing();
|
||||||
|
mDownX = event.getX();
|
||||||
|
mDownY = event.getY();
|
||||||
mCollapsedOnDown = isFullyCollapsed();
|
mCollapsedOnDown = isFullyCollapsed();
|
||||||
mListenForHeadsUp = mCollapsedOnDown && mHeadsUpManager.hasPinnedHeadsUp();
|
mListenForHeadsUp = mCollapsedOnDown && mHeadsUpManager.hasPinnedHeadsUp();
|
||||||
}
|
}
|
||||||
@@ -1076,7 +1111,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|| event.getAction() == MotionEvent.ACTION_CANCEL) {
|
|| event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||||
mBlockingExpansionForCurrentTouch = false;
|
mBlockingExpansionForCurrentTouch = false;
|
||||||
}
|
}
|
||||||
if (!mIsExpanding && mPulseExpansionHandler.onTouchEvent(event)) {
|
if (!mIsExpanding && !shouldQuickSettingsIntercept(mDownX, mDownY, 0)
|
||||||
|
&& mPulseExpansionHandler.onTouchEvent(event)) {
|
||||||
// We're expanding all the other ones shouldn't get this anymore
|
// We're expanding all the other ones shouldn't get this anymore
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1347,6 +1383,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mFalsingManager.setQsExpanded(expanded);
|
mFalsingManager.setQsExpanded(expanded);
|
||||||
mStatusBar.setQsExpanded(expanded);
|
mStatusBar.setQsExpanded(expanded);
|
||||||
mNotificationContainerParent.setQsExpanded(expanded);
|
mNotificationContainerParent.setQsExpanded(expanded);
|
||||||
|
mPulseExpansionHandler.setQsExpanded(expanded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1361,9 +1398,6 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
mBarState = statusBarState;
|
mBarState = statusBarState;
|
||||||
mKeyguardShowing = keyguardShowing;
|
mKeyguardShowing = keyguardShowing;
|
||||||
if (mQs != null) {
|
|
||||||
mQs.setKeyguardShowing(mKeyguardShowing);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oldState == StatusBarState.KEYGUARD
|
if (oldState == StatusBarState.KEYGUARD
|
||||||
&& (goingToFullShade || statusBarState == StatusBarState.SHADE_LOCKED)) {
|
&& (goingToFullShade || statusBarState == StatusBarState.SHADE_LOCKED)) {
|
||||||
@@ -1391,7 +1425,9 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
if (keyguardShowing) {
|
if (keyguardShowing) {
|
||||||
updateDozingVisibilities(false /* animate */);
|
updateDozingVisibilities(false /* animate */);
|
||||||
}
|
}
|
||||||
|
// THe update needs to happen after the headerSlide in above, otherwise the translation
|
||||||
|
// would reset
|
||||||
|
updateQSPulseExpansion();
|
||||||
maybeAnimateBottomAreaAlpha();
|
maybeAnimateBottomAreaAlpha();
|
||||||
resetHorizontalPanelPosition();
|
resetHorizontalPanelPosition();
|
||||||
updateQsState();
|
updateQsState();
|
||||||
@@ -1640,7 +1676,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
// padding on Keyguard, maxQsPadding denotes the top padding from the quick settings
|
// padding on Keyguard, maxQsPadding denotes the top padding from the quick settings
|
||||||
// panel. We need to take the maximum and linearly interpolate with the panel expansion
|
// panel. We need to take the maximum and linearly interpolate with the panel expansion
|
||||||
// for a nice motion.
|
// for a nice motion.
|
||||||
int maxNotificationPadding = mClockPositionResult.stackScrollerPadding;
|
int maxNotificationPadding = getKeyguardNotificationStaticPadding();
|
||||||
int maxQsPadding = mQsMaxExpansionHeight + mQsNotificationTopPadding;
|
int maxQsPadding = mQsMaxExpansionHeight + mQsNotificationTopPadding;
|
||||||
int max = mBarState == StatusBarState.KEYGUARD
|
int max = mBarState == StatusBarState.KEYGUARD
|
||||||
? Math.max(maxNotificationPadding, maxQsPadding)
|
? Math.max(maxNotificationPadding, maxQsPadding)
|
||||||
@@ -1648,11 +1684,12 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
return (int) MathUtils.lerp((float) mQsMinExpansionHeight, (float) max,
|
return (int) MathUtils.lerp((float) mQsMinExpansionHeight, (float) max,
|
||||||
getExpandedFraction());
|
getExpandedFraction());
|
||||||
} else if (mQsSizeChangeAnimator != null) {
|
} else if (mQsSizeChangeAnimator != null) {
|
||||||
return (int) mQsSizeChangeAnimator.getAnimatedValue();
|
return Math.max((int) mQsSizeChangeAnimator.getAnimatedValue(),
|
||||||
|
getKeyguardNotificationStaticPadding());
|
||||||
} else if (mKeyguardShowing) {
|
} else if (mKeyguardShowing) {
|
||||||
// We can only do the smoother transition on Keyguard when we also are not collapsing
|
// We can only do the smoother transition on Keyguard when we also are not collapsing
|
||||||
// from a scrolled quick settings.
|
// from a scrolled quick settings.
|
||||||
return MathUtils.lerp((float) mClockPositionResult.stackScrollerPadding,
|
return MathUtils.lerp((float) getKeyguardNotificationStaticPadding(),
|
||||||
(float) (mQsMaxExpansionHeight + mQsNotificationTopPadding),
|
(float) (mQsMaxExpansionHeight + mQsNotificationTopPadding),
|
||||||
getQsExpansionFraction());
|
getQsExpansionFraction());
|
||||||
} else {
|
} else {
|
||||||
@@ -1660,8 +1697,53 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the topPadding of notifications when on keyguard not respecting quick settings
|
||||||
|
* expansion
|
||||||
|
*/
|
||||||
|
private int getKeyguardNotificationStaticPadding() {
|
||||||
|
if (!mKeyguardShowing) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!mKeyguardBypassController.getBypassEnabled()) {
|
||||||
|
return mClockPositionResult.stackScrollerPadding;
|
||||||
|
}
|
||||||
|
int collapsedPosition = mHeadsUpInset;
|
||||||
|
if (!mNotificationStackScroller.isPulseExpanding()) {
|
||||||
|
return collapsedPosition;
|
||||||
|
} else {
|
||||||
|
int expandedPosition = mClockPositionResult.stackScrollerPadding;
|
||||||
|
return (int) MathUtils.lerp(collapsedPosition, expandedPosition,
|
||||||
|
calculateHeaderAppearAmountBypass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private float calculateHeaderAppearAmountBypass() {
|
||||||
|
float pulseHeight = mNotificationStackScroller.getPulseHeight();
|
||||||
|
float wakeUpHeight = mNotificationStackScroller.getWakeUpHeight();
|
||||||
|
float dragDownAmount = pulseHeight - wakeUpHeight;
|
||||||
|
|
||||||
|
// The total distance required to fully reveal the header
|
||||||
|
float totalDistance = mClockPositionResult.stackScrollerPadding;
|
||||||
|
return MathUtils.smoothStep(0, totalDistance, dragDownAmount);
|
||||||
|
}
|
||||||
|
|
||||||
protected void requestScrollerTopPaddingUpdate(boolean animate) {
|
protected void requestScrollerTopPaddingUpdate(boolean animate) {
|
||||||
mNotificationStackScroller.updateTopPadding(calculateQsTopPadding(), animate);
|
mNotificationStackScroller.updateTopPadding(calculateQsTopPadding(), animate);
|
||||||
|
if (mKeyguardShowing && mKeyguardBypassController.getBypassEnabled()) {
|
||||||
|
// update the position of the header
|
||||||
|
updateQsExpansion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void updateQSPulseExpansion() {
|
||||||
|
if (mQs != null) {
|
||||||
|
mQs.setShowCollapsedOnKeyguard(mKeyguardShowing
|
||||||
|
&& mKeyguardBypassController.getBypassEnabled()
|
||||||
|
&& mNotificationStackScroller.isPulseExpanding());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackMovement(MotionEvent event) {
|
private void trackMovement(MotionEvent event) {
|
||||||
@@ -1792,8 +1874,16 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getMaxPanelHeight() {
|
protected int getMaxPanelHeight() {
|
||||||
|
if (mKeyguardBypassController.getBypassEnabled() && mBarState == StatusBarState.KEYGUARD) {
|
||||||
|
return getMaxPanelHeightBypass();
|
||||||
|
} else {
|
||||||
|
return getMaxPanelHeightNonBypass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getMaxPanelHeightNonBypass() {
|
||||||
int min = mStatusBarMinHeight;
|
int min = mStatusBarMinHeight;
|
||||||
if (mBarState != StatusBarState.KEYGUARD
|
if (!(mBarState == StatusBarState.KEYGUARD)
|
||||||
&& mNotificationStackScroller.getNotGoneChildCount() == 0) {
|
&& mNotificationStackScroller.getNotGoneChildCount() == 0) {
|
||||||
int minHeight = (int) (mQsMinExpansionHeight + getOverExpansionAmount());
|
int minHeight = (int) (mQsMinExpansionHeight + getOverExpansionAmount());
|
||||||
min = Math.max(min, minHeight);
|
min = Math.max(min, minHeight);
|
||||||
@@ -1809,6 +1899,15 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
return maxHeight;
|
return maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getMaxPanelHeightBypass() {
|
||||||
|
int position = mClockPositionAlgorithm.getExpandedClockPosition()
|
||||||
|
+ mKeyguardStatusView.getHeight();
|
||||||
|
if (mNotificationStackScroller.getVisibleNotificationCount() != 0) {
|
||||||
|
position += mShelfHeight / 2.0f + mDarkIconSize / 2.0f;
|
||||||
|
}
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isInSettings() {
|
public boolean isInSettings() {
|
||||||
return mQsExpanded;
|
return mQsExpanded;
|
||||||
}
|
}
|
||||||
@@ -1958,11 +2057,25 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected float getHeaderTranslation() {
|
protected float getHeaderTranslation() {
|
||||||
if (mBarState == StatusBarState.KEYGUARD) {
|
if (mBarState == StatusBarState.KEYGUARD && !mKeyguardBypassController.getBypassEnabled()) {
|
||||||
return 0;
|
return -mQs.getQsMinExpansionHeight();
|
||||||
}
|
}
|
||||||
float translation = MathUtils.lerp(-mQsMinExpansionHeight, 0,
|
float appearAmount = mNotificationStackScroller.getAppearFraction(mExpandedHeight);
|
||||||
Math.min(1.0f, mNotificationStackScroller.getAppearFraction(mExpandedHeight)))
|
float startHeight = -mQsExpansionHeight;
|
||||||
|
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()
|
||||||
|
&& mNotificationStackScroller.isPulseExpanding()) {
|
||||||
|
if (!mPulseExpansionHandler.isExpanding()
|
||||||
|
&& !mPulseExpansionHandler.getLeavingLockscreen()) {
|
||||||
|
// If we aborted the expansion we need to make sure the header doesn't reappear
|
||||||
|
// again after the header has animated away
|
||||||
|
appearAmount = 0;
|
||||||
|
} else {
|
||||||
|
appearAmount = calculateHeaderAppearAmountBypass();
|
||||||
|
}
|
||||||
|
startHeight = -mQs.getQsMinExpansionHeight();
|
||||||
|
}
|
||||||
|
float translation = MathUtils.lerp(startHeight, 0,
|
||||||
|
Math.min(1.0f, appearAmount))
|
||||||
+ mExpandOffset;
|
+ mExpandOffset;
|
||||||
return Math.min(0, translation);
|
return Math.min(0, translation);
|
||||||
}
|
}
|
||||||
@@ -2723,6 +2836,10 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
if (mTracking) {
|
if (mTracking) {
|
||||||
mNotificationStackScroller.setExpandingVelocity(getCurrentExpandVelocity());
|
mNotificationStackScroller.setExpandingVelocity(getCurrentExpandVelocity());
|
||||||
}
|
}
|
||||||
|
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
||||||
|
// The expandedHeight is always the full panel Height when bypassing
|
||||||
|
expandedHeight = getMaxPanelHeightNonBypass();
|
||||||
|
}
|
||||||
mNotificationStackScroller.setExpandedHeight(expandedHeight);
|
mNotificationStackScroller.setExpandedHeight(expandedHeight);
|
||||||
updateKeyguardBottomAreaAlpha();
|
updateKeyguardBottomAreaAlpha();
|
||||||
updateBigClockAlpha();
|
updateBigClockAlpha();
|
||||||
@@ -2872,7 +2989,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mQs.setPanelView(NotificationPanelView.this);
|
mQs.setPanelView(NotificationPanelView.this);
|
||||||
mQs.setExpandClickListener(NotificationPanelView.this);
|
mQs.setExpandClickListener(NotificationPanelView.this);
|
||||||
mQs.setHeaderClickable(mQsExpansionEnabled);
|
mQs.setHeaderClickable(mQsExpansionEnabled);
|
||||||
mQs.setKeyguardShowing(mKeyguardShowing);
|
updateQSPulseExpansion();
|
||||||
mQs.setOverscrolling(mStackScrollerOverscrolling);
|
mQs.setOverscrolling(mStackScrollerOverscrolling);
|
||||||
|
|
||||||
// recompute internal state when qspanel height changes
|
// recompute internal state when qspanel height changes
|
||||||
|
|||||||
@@ -786,6 +786,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
inflateStatusBarWindow(context);
|
inflateStatusBarWindow(context);
|
||||||
mStatusBarWindow.setService(this);
|
mStatusBarWindow.setService(this);
|
||||||
|
mStatusBarWindow.setBypassController(mKeyguardBypassController);
|
||||||
mStatusBarWindow.setOnTouchListener(getStatusBarWindowTouchListener());
|
mStatusBarWindow.setOnTouchListener(getStatusBarWindowTouchListener());
|
||||||
|
|
||||||
// TODO: Deal with the ugliness that comes from having some of the statusbar broken out
|
// TODO: Deal with the ugliness that comes from having some of the statusbar broken out
|
||||||
@@ -798,6 +799,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
mNotificationIconAreaController = SystemUIFactory.getInstance()
|
mNotificationIconAreaController = SystemUIFactory.getInstance()
|
||||||
.createNotificationIconAreaController(context, this,
|
.createNotificationIconAreaController(context, this,
|
||||||
|
mWakeUpCoordinator, mKeyguardBypassController,
|
||||||
mStatusBarStateController, mNotificationListener);
|
mStatusBarStateController, mNotificationListener);
|
||||||
mWakeUpCoordinator.setIconAreaController(mNotificationIconAreaController);
|
mWakeUpCoordinator.setIconAreaController(mNotificationIconAreaController);
|
||||||
inflateShelf();
|
inflateShelf();
|
||||||
@@ -3570,6 +3572,9 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
*/
|
*/
|
||||||
public void setBouncerShowing(boolean bouncerShowing) {
|
public void setBouncerShowing(boolean bouncerShowing) {
|
||||||
mBouncerShowing = bouncerShowing;
|
mBouncerShowing = bouncerShowing;
|
||||||
|
mKeyguardBypassController.setBouncerShowing(bouncerShowing);
|
||||||
|
mPulseExpansionHandler.setBouncerShowing(bouncerShowing);
|
||||||
|
mStatusBarWindow.setBouncerShowing(bouncerShowing);
|
||||||
if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing);
|
if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing);
|
||||||
updateHideIconsForBouncer(true /* animate */);
|
updateHideIconsForBouncer(true /* animate */);
|
||||||
mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);
|
mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);
|
||||||
@@ -3621,6 +3626,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
notifyHeadsUpGoingToSleep();
|
notifyHeadsUpGoingToSleep();
|
||||||
dismissVolumeDialog();
|
dismissVolumeDialog();
|
||||||
|
mWakeUpCoordinator.setFullyAwake(false);
|
||||||
|
mKeyguardBypassController.onStartedGoingToSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -3643,6 +3650,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinishedWakingUp() {
|
public void onFinishedWakingUp() {
|
||||||
|
mWakeUpCoordinator.setFullyAwake(true);
|
||||||
mWakeUpCoordinator.setWakingUp(false);
|
mWakeUpCoordinator.setWakingUp(false);
|
||||||
if (mLaunchCameraWhenFinishedWaking) {
|
if (mLaunchCameraWhenFinishedWaking) {
|
||||||
mNotificationPanel.launchCamera(false /* animate */, mLastCameraLaunchSource);
|
mNotificationPanel.launchCamera(false /* animate */, mLastCameraLaunchSource);
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
* events manually as it's outside of the regular view bounds.
|
* events manually as it's outside of the regular view bounds.
|
||||||
*/
|
*/
|
||||||
private boolean mExpandingBelowNotch;
|
private boolean mExpandingBelowNotch;
|
||||||
|
private KeyguardBypassController mBypassController;
|
||||||
|
|
||||||
public StatusBarWindowView(Context context, AttributeSet attrs) {
|
public StatusBarWindowView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -417,6 +418,7 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
if (mNotificationPanel.isFullyExpanded()
|
if (mNotificationPanel.isFullyExpanded()
|
||||||
&& mStatusBarStateController.getState() == StatusBarState.KEYGUARD
|
&& mStatusBarStateController.getState() == StatusBarState.KEYGUARD
|
||||||
&& !mService.isBouncerShowing()
|
&& !mService.isBouncerShowing()
|
||||||
|
&& !mBypassController.getBypassEnabled()
|
||||||
&& !mService.isDozing()) {
|
&& !mService.isDozing()) {
|
||||||
intercept = mDragDownHelper.onInterceptTouchEvent(ev);
|
intercept = mDragDownHelper.onInterceptTouchEvent(ev);
|
||||||
}
|
}
|
||||||
@@ -439,7 +441,8 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
if (mService.isDozing()) {
|
if (mService.isDozing()) {
|
||||||
handled = !mService.isPulsing();
|
handled = !mService.isPulsing();
|
||||||
}
|
}
|
||||||
if ((mStatusBarStateController.getState() == StatusBarState.KEYGUARD && !handled)
|
if ((mStatusBarStateController.getState() == StatusBarState.KEYGUARD && !handled
|
||||||
|
&& !mBypassController.getBypassEnabled())
|
||||||
|| mDragDownHelper.isDraggingDown()) {
|
|| mDragDownHelper.isDraggingDown()) {
|
||||||
// we still want to finish our drag down gesture when locking the screen
|
// we still want to finish our drag down gesture when locking the screen
|
||||||
handled = mDragDownHelper.onTouchEvent(ev);
|
handled = mDragDownHelper.onTouchEvent(ev);
|
||||||
@@ -518,6 +521,16 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBypassController(KeyguardBypassController bypassController) {
|
||||||
|
mBypassController = bypassController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBouncerShowing(boolean bouncerShowing) {
|
||||||
|
if (mLockIcon != null) {
|
||||||
|
mLockIcon.setBouncerShowing(bouncerShowing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class LayoutParams extends FrameLayout.LayoutParams {
|
public class LayoutParams extends FrameLayout.LayoutParams {
|
||||||
|
|
||||||
public boolean ignoreRightInset;
|
public boolean ignoreRightInset;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.android.systemui.DumpController;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.SystemUIFactory;
|
import com.android.systemui.SystemUIFactory;
|
||||||
import com.android.systemui.SysuiBaseFragmentTest;
|
import com.android.systemui.SysuiBaseFragmentTest;
|
||||||
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.qs.tileimpl.QSFactoryImpl;
|
import com.android.systemui.qs.tileimpl.QSFactoryImpl;
|
||||||
import com.android.systemui.shared.plugins.PluginManager;
|
import com.android.systemui.shared.plugins.PluginManager;
|
||||||
import com.android.systemui.statusbar.phone.AutoTileManager;
|
import com.android.systemui.statusbar.phone.AutoTileManager;
|
||||||
@@ -139,6 +140,7 @@ public class QSFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
new RemoteInputQuickSettingsDisabler(context, mock(ConfigurationController.class)),
|
new RemoteInputQuickSettingsDisabler(context, mock(ConfigurationController.class)),
|
||||||
new InjectionInflationController(SystemUIFactory.getInstance().getRootComponent()),
|
new InjectionInflationController(SystemUIFactory.getInstance().getRootComponent()),
|
||||||
context,
|
context,
|
||||||
mock(QSTileHost.class));
|
mock(QSTileHost.class),
|
||||||
|
mock(StatusBarStateController.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import com.android.systemui.statusbar.notification.logging.NotificationLogger;
|
|||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableView;
|
import com.android.systemui.statusbar.notification.row.ExpandableView;
|
||||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.NotificationGroupManager;
|
import com.android.systemui.statusbar.phone.NotificationGroupManager;
|
||||||
import com.android.systemui.statusbar.phone.ShadeController;
|
import com.android.systemui.statusbar.phone.ShadeController;
|
||||||
import com.android.systemui.util.Assert;
|
import com.android.systemui.util.Assert;
|
||||||
@@ -99,7 +100,9 @@ public class NotificationViewHierarchyManagerTest extends SysuiTestCase {
|
|||||||
mViewHierarchyManager = new NotificationViewHierarchyManager(mContext,
|
mViewHierarchyManager = new NotificationViewHierarchyManager(mContext,
|
||||||
mLockscreenUserManager, mGroupManager, mVisualStabilityManager,
|
mLockscreenUserManager, mGroupManager, mVisualStabilityManager,
|
||||||
mock(StatusBarStateControllerImpl.class), mEntryManager,
|
mock(StatusBarStateControllerImpl.class), mEntryManager,
|
||||||
() -> mShadeController, new BubbleData(mContext), mock(DynamicPrivacyController.class));
|
() -> mShadeController, new BubbleData(mContext),
|
||||||
|
mock(KeyguardBypassController.class),
|
||||||
|
mock(DynamicPrivacyController.class));
|
||||||
Dependency.get(InitController.class).executePostInitTasks();
|
Dependency.get(InitController.class).executePostInitTasks();
|
||||||
mViewHierarchyManager.setUpWithPresenter(mPresenter, mListContainer);
|
mViewHierarchyManager.setUpWithPresenter(mPresenter, mListContainer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,7 +383,8 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
|||||||
private void positionClock() {
|
private void positionClock() {
|
||||||
mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight,
|
mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight,
|
||||||
mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, mPreferredClockY,
|
mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, mPreferredClockY,
|
||||||
mHasCustomClock, mHasVisibleNotifs, mDark, ZERO_DRAG, false /* positionLikeDark */);
|
mHasCustomClock, mHasVisibleNotifs, mDark, ZERO_DRAG, false /* bypassEnabled */,
|
||||||
|
0 /* unlockedStackScrollerPadding */);
|
||||||
mClockPositionAlgorithm.run(mClockPosition);
|
mClockPositionAlgorithm.run(mClockPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ import com.android.systemui.SysuiTestCase;
|
|||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.statusbar.NotificationListener;
|
import com.android.systemui.statusbar.NotificationListener;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
|
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -57,6 +57,10 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
|
|||||||
@Mock
|
@Mock
|
||||||
StatusBarStateController mStatusBarStateController;
|
StatusBarStateController mStatusBarStateController;
|
||||||
@Mock
|
@Mock
|
||||||
|
NotificationWakeUpCoordinator mNotificationWakeUpCoordinator;
|
||||||
|
@Mock
|
||||||
|
KeyguardBypassController mBypassController;
|
||||||
|
@Mock
|
||||||
private NotificationMediaManager mMediaManager;
|
private NotificationMediaManager mMediaManager;
|
||||||
private NotificationIconAreaController mController;
|
private NotificationIconAreaController mController;
|
||||||
|
|
||||||
@@ -67,7 +71,8 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
|
|||||||
when(mStatusBarWindowView.findViewById(R.id.clock_notification_icon_container)).thenReturn(
|
when(mStatusBarWindowView.findViewById(R.id.clock_notification_icon_container)).thenReturn(
|
||||||
mIconContainer);
|
mIconContainer);
|
||||||
mController = new NotificationIconAreaController(mContext, mStatusBar,
|
mController = new NotificationIconAreaController(mContext, mStatusBar,
|
||||||
mStatusBarStateController, mListener, mMediaManager);
|
mStatusBarStateController, mNotificationWakeUpCoordinator, mBypassController,
|
||||||
|
mListener, mMediaManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
mock(HeadsUpManagerPhone.class),
|
mock(HeadsUpManagerPhone.class),
|
||||||
new StatusBarStateControllerImpl(),
|
new StatusBarStateControllerImpl(),
|
||||||
bypassController);
|
bypassController);
|
||||||
PulseExpansionHandler expansionHandler = new PulseExpansionHandler(mContext, coordinator);
|
PulseExpansionHandler expansionHandler = new PulseExpansionHandler(mContext, coordinator,
|
||||||
|
bypassController);
|
||||||
mNotificationPanelView = new TestableNotificationPanelView(coordinator, expansionHandler,
|
mNotificationPanelView = new TestableNotificationPanelView(coordinator, expansionHandler,
|
||||||
bypassController);
|
bypassController);
|
||||||
mNotificationPanelView.setHeadsUpManager(mHeadsUpManager);
|
mNotificationPanelView.setHeadsUpManager(mHeadsUpManager);
|
||||||
|
|||||||
Reference in New Issue
Block a user