Revert Keyguard teamfood flags

These flags were never meant for production and already served their
purpose.

Test: manual
Bug: 111414690
Bug: 111405682
Change-Id: I27081fb8caf400781851a09fc7d45e88226abf5f
This commit is contained in:
Lucas Dupin
2018-12-21 12:26:33 -08:00
parent b7fc056068
commit c780404cef
9 changed files with 16 additions and 140 deletions

View File

@@ -17,7 +17,6 @@
package com.android.systemui.doze;
import android.annotation.NonNull;
import android.app.PendingIntent;
/**
* Interface the doze service uses to communicate with the rest of system UI.
@@ -34,7 +33,6 @@ public interface DozeHost {
boolean isProvisioned();
boolean isBlockingDoze();
void startPendingIntentDismissingKeyguard(PendingIntent intent);
void extendPulse();
void setAnimateWakeup(boolean animateWakeup);
@@ -47,12 +45,6 @@ public interface DozeHost {
void onIgnoreTouchWhilePulsing(boolean ignore);
/**
* If the device was waken up by a passive interrupt that will show the lock screen without
* expanding the notification panel/shade.
*/
void setPassiveInterrupt(boolean lightInterrupt);
interface Callback {
/**
* Called when a high priority notification is added.

View File

@@ -151,7 +151,6 @@ public class DozeTriggers implements DozeMachine.Part {
mDozeHost.onDoubleTap(screenX, screenY);
mMachine.wakeUp();
} else if (isPickup) {
mDozeHost.setPassiveInterrupt(true);
mMachine.wakeUp();
} else {
mDozeHost.extendPulse();
@@ -221,7 +220,6 @@ public class DozeTriggers implements DozeMachine.Part {
case INITIALIZED:
mBroadcastReceiver.register(mContext);
mDozeHost.addCallback(mHostCallback);
mDozeHost.setPassiveInterrupt(false);
checkTriggersAtInit();
break;
case DOZE:
@@ -231,7 +229,6 @@ public class DozeTriggers implements DozeMachine.Part {
mDozeSensors.reregisterAllSensors();
}
mDozeSensors.setListening(true);
mDozeHost.setPassiveInterrupt(false);
if (newState == DozeMachine.State.DOZE_AOD && !sWakeDisplaySensorState) {
onWakeScreen(false);
}

View File

@@ -106,7 +106,6 @@ public class LockScreenWakeUpController implements StatusBarStateController.Stat
DozeLog.traceLockScreenWakeUp(wakeEvent);
if (wakeEvent && mDozing) {
mDozeHost.setPassiveInterrupt(true);
if (DEBUG) Log.d(TAG, "Wake up.");
mPowerManager.wakeUp(SystemClock.uptimeMillis(), "com.android.systemui:NODOZE");
} else if (!wakeEvent && !mDozing) {

View File

@@ -5823,7 +5823,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
(int) (dragLengthY / mDisplayMetrics.density),
0 /* velocityDp - N/A */);
if (mNotificationPanel.onDraggedDown() || startingChild != null) {
if (!mAmbientState.isDark() || startingChild != null) {
// We have notifications, go to locked shade.
mShadeController.goToLockedShade(startingChild);
if (startingChild instanceof ExpandableNotificationRow) {

View File

@@ -38,7 +38,6 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.os.PowerManager;
import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.Log;
import android.util.MathUtils;
@@ -106,23 +105,6 @@ public class NotificationPanelView extends PanelView implements
private static final boolean DEBUG = false;
/**
* If passive interrupts expand the NSSL or not
*/
private static final boolean EXPAND_ON_PASSIVE_INTERRUPT = SystemProperties.getBoolean(
"persist.sysui.expand_shade_on_wake_up", true);
/**
* If the notification panel should remain collapsed when the phone wakes up, even if the user
* presses power.
*/
private static final boolean NEVER_EXPAND_WHEN_WAKING_UP = SystemProperties.getBoolean(
"persist.sysui.defer_notifications_on_lock_screen", false);
/**
* If waking up the phone should take you to SHADE_LOCKED instead of KEYGUARD
*/
private static final boolean WAKE_UP_TO_SHADE = SystemProperties.getBoolean(
"persist.sysui.go_to_shade_on_wake_up", false);
/**
* Fling expanding QS.
*/
@@ -283,12 +265,6 @@ public class NotificationPanelView extends PanelView implements
*/
private float mLinearDarkAmount;
/**
* State where the device isn't dozing anymore, but the lock screen isn't fully awake.
* The screen will be dimmed down with the shade collapsed.
*/
private boolean mSemiAwake;
private boolean mPulsing;
private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
private boolean mNoVisibleNotifications = true;
@@ -1256,11 +1232,6 @@ public class NotificationPanelView extends PanelView implements
updateDozingVisibilities(false /* animate */);
}
// Expand notification shade if the device was is semi-awake state
if (mBarState == StatusBarState.SHADE && isSemiAwake()) {
mNotificationStackScroller.setDark(false /* dark */, false /* animated */,
null /* touchLocation */);
}
resetVerticalPanelPosition();
updateQsState();
}
@@ -2790,35 +2761,30 @@ public class NotificationPanelView extends PanelView implements
mNotificationStackScroller.setAnimationsEnabled(!disabled);
}
public void setDozing(boolean dozing, boolean animate, PointF wakeUpTouchLocation,
boolean passivelyInterrupted) {
/**
* Sets the dozing state.
*
* @param dozing {@code true} when dozing.
* @param animate if transition should be animated.
* @param wakeUpTouchLocation touch event location - if woken up by SLPI sensor.
*/
public void setDozing(boolean dozing, boolean animate, PointF wakeUpTouchLocation) {
if (dozing == mDozing) return;
mDozing = dozing;
boolean doNotExpand = (!EXPAND_ON_PASSIVE_INTERRUPT && passivelyInterrupted)
|| NEVER_EXPAND_WHEN_WAKING_UP;
mSemiAwake = doNotExpand && !mDozing;
if (!mSemiAwake) {
mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
}
mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
if (mBarState == StatusBarState.KEYGUARD
|| mBarState == StatusBarState.SHADE_LOCKED) {
updateDozingVisibilities(animate);
}
final float darkAmount = dozing && !mSemiAwake ? 1 : 0;
if (!mSemiAwake) {
mStatusBarStateController.setDozeAmount(darkAmount, animate);
}
final float darkAmount = dozing ? 1 : 0;
mStatusBarStateController.setDozeAmount(darkAmount, animate);
if (animate) {
mNotificationStackScroller.notifyDarkAnimationStart(mDozing);
}
}
public boolean isSemiAwake() {
return mSemiAwake;
}
@Override
public void onDozeAmountChanged(float linearAmount, float amount) {
mInterpolatedDarkAmount = amount;
@@ -3011,23 +2977,4 @@ public class NotificationPanelView extends PanelView implements
public void showTransientIndication(int id) {
mKeyguardBottomArea.showTransientIndication(id);
}
/**
* Whenever a user drags down on the empty area (pulling down the shade and clock) and lets go.
*
* @return {@code true} if dragging down should take the user to SHADE_LOCKED.
*/
public boolean onDraggedDown() {
if (isSemiAwake()) {
mSemiAwake = false;
mNotificationStackScroller.setDark(false /* dark */, true /* animate */,
null /* touchLocation */);
mStatusBarStateController.setDozeAmount(0f, true /* animated */);
mNotificationStackScroller.notifyDarkAnimationStart(mDozing);
mStatusBar.updateScrimController();
return WAKE_UP_TO_SHADE;
}
return true;
}
}

View File

@@ -282,8 +282,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
mTimeTicker.schedule(mDozeParameters.getWallpaperAodDuration(),
AlarmTimeout.MODE_IGNORE_IF_SCHEDULED);
}
// Do not re-schedule timeout when pulsing, let's save some extra battery.
} else if (mState != ScrimState.PULSING) {
} else {
mTimeTicker.cancel();
mWallpaperVisibilityTimedOut = false;
}
@@ -365,7 +364,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
mExpansionFraction = fraction;
final boolean keyguardOrUnlocked = mState == ScrimState.UNLOCKED
|| mState == ScrimState.KEYGUARD || mState == ScrimState.DARK_KEYGUARD;
|| mState == ScrimState.KEYGUARD;
if (!keyguardOrUnlocked || !mExpansionAffectsAlpha) {
return;
}

View File

@@ -17,7 +17,6 @@
package com.android.systemui.statusbar.phone;
import android.graphics.Color;
import android.os.SystemProperties;
import android.os.Trace;
import android.util.MathUtils;
@@ -67,27 +66,6 @@ public enum ScrimState {
}
},
/**
* On semi-awake lock screen.
*/
DARK_KEYGUARD(7) {
@Override
public void prepare(ScrimState previousState) {
mBlankScreen = mDisplayRequiresBlanking && previousState != ScrimState.AOD;
mAnimationDuration = StackStateAnimator.ANIMATION_DURATION_WAKEUP;
String opacity = SystemProperties.get("persist.sysui.aod2_scrim_opacity", "0.8");
try {
mCurrentBehindAlpha = Float.parseFloat(opacity);
} catch (RuntimeException e) {
mCurrentBehindAlpha = ScrimController.GRADIENT_SCRIM_DARK_KEYGUARD;
}
mCurrentInFrontAlpha = 0;
mCurrentInFrontTint = Color.BLACK;
mCurrentBehindTint = Color.BLACK;
}
},
/**
* Showing password challenge on the keyguard.
*/

View File

@@ -3312,12 +3312,7 @@ public class StatusBar extends SystemUI implements DemoMode,
boolean animate = (!mDozing && mDozeServiceHost.shouldAnimateWakeup())
|| (mDozing && mDozeServiceHost.shouldAnimateScreenOff() && sleepingFromKeyguard);
mNotificationPanel.setDozing(mDozing, animate, mWakeUpTouchLocation,
mDozeServiceHost.wasPassivelyInterrupted());
if (mNotificationPanel.isSemiAwake()
&& SystemProperties.getBoolean("persist.systemui.show_swipe_up", false)) {
mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock);
}
mNotificationPanel.setDozing(mDozing, animate, mWakeUpTouchLocation);
updateQsExpansionEnabled();
Trace.endSection();
}
@@ -3883,9 +3878,6 @@ public class StatusBar extends SystemUI implements DemoMode,
// FLAG_DISMISS_KEYGUARD_ACTIVITY.
ScrimState state = mStatusBarKeyguardViewManager.bouncerNeedsScrimming()
? ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER;
if (mNotificationPanel.isSemiAwake()) {
state = ScrimState.DARK_KEYGUARD;
}
mScrimController.transitionTo(state);
} else if (isInLaunchTransition() || mLaunchCameraOnScreenTurningOn
|| launchingAffordanceWithPreview) {
@@ -3898,8 +3890,7 @@ public class StatusBar extends SystemUI implements DemoMode,
} else if (mDozing && !wakeAndUnlocking) {
mScrimController.transitionTo(ScrimState.AOD);
} else if (mIsKeyguard && !wakeAndUnlocking) {
mScrimController.transitionTo(mNotificationPanel.isSemiAwake()
? ScrimState.DARK_KEYGUARD : ScrimState.KEYGUARD);
mScrimController.transitionTo(ScrimState.KEYGUARD);
} else if (mBubbleController.isStackExpanded()) {
mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED);
} else {
@@ -3922,7 +3913,6 @@ public class StatusBar extends SystemUI implements DemoMode,
private boolean mAnimateWakeup;
private boolean mAnimateScreenOff;
private boolean mIgnoreTouchWhilePulsing;
private boolean mPassivelyInterrupted;
@Override
public String toString() {
@@ -4013,11 +4003,6 @@ public class StatusBar extends SystemUI implements DemoMode,
}
}
@Override
public void setPassiveInterrupt(boolean passiveInterrupt) {
mPassivelyInterrupted = passiveInterrupt;
}
@Override
public void onIgnoreTouchWhilePulsing(boolean ignore) {
if (ignore != mIgnoreTouchWhilePulsing) {
@@ -4064,11 +4049,6 @@ public class StatusBar extends SystemUI implements DemoMode,
return false;
}
@Override
public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
StatusBar.this.startPendingIntentDismissingKeyguard(intent);
}
@Override
public void extendPulse() {
if (mDozeScrimController.isPulsing() && mAmbientPulseManager.hasNotifications()) {
@@ -4131,10 +4111,6 @@ public class StatusBar extends SystemUI implements DemoMode,
public boolean shouldAnimateScreenOff() {
return mAnimateScreenOff;
}
public boolean wasPassivelyInterrupted() {
return mPassivelyInterrupted;
}
}
public boolean shouldIgnoreTouch() {

View File

@@ -19,8 +19,6 @@ package com.android.systemui.doze;
import android.annotation.NonNull;
import android.app.PendingIntent;
import com.android.systemui.util.wakelock.WakeLock;
/**
* A rudimentary fake for DozeHost.
*/
@@ -84,11 +82,6 @@ class DozeHostFake implements DozeHost {
return false;
}
@Override
public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
throw new RuntimeException("not implemented");
}
@Override
public void onIgnoreTouchWhilePulsing(boolean ignore) {
}
@@ -114,11 +107,6 @@ class DozeHostFake implements DozeHost {
doubleTapY = y;
}
@Override
public void setPassiveInterrupt(boolean lightInterrupt) {
}
@Override
public void setDozeScreenBrightness(int value) {
}