Merge "Fix doze bug in keyguard user switcher" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e7283b94bc
@@ -405,14 +405,19 @@ public class KeyguardSliceView extends LinearLayout {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the amount (ratio) that the device has transitioned to doze.
|
||||
*
|
||||
* @param darkAmount Amount of transition to doze: 1f for doze and 0f for awake.
|
||||
*/
|
||||
public void setDarkAmount(float darkAmount) {
|
||||
boolean isAwake = darkAmount != 0;
|
||||
boolean wasAwake = mDarkAmount != 0;
|
||||
if (isAwake == wasAwake) {
|
||||
boolean isDozing = darkAmount != 0;
|
||||
boolean wasDozing = mDarkAmount != 0;
|
||||
if (isDozing == wasDozing) {
|
||||
return;
|
||||
}
|
||||
mDarkAmount = darkAmount;
|
||||
setLayoutAnimationListener(isAwake ? null : mKeepAwakeListener);
|
||||
setLayoutAnimationListener(isDozing ? null : mKeepAwakeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -94,15 +94,6 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie
|
||||
goingToFullShade,
|
||||
oldState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDozeAmountChanged(float linearAmount, float amount) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, String.format("onDozeAmountChanged: linearAmount=%f amount=%f",
|
||||
linearAmount, amount));
|
||||
}
|
||||
setDarkAmount(amount);
|
||||
}
|
||||
};
|
||||
|
||||
@Inject
|
||||
@@ -294,20 +285,6 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the amount (ratio) that the device has transitioned to doze.
|
||||
*
|
||||
* @param darkAmount Amount of transition to doze: 1f for doze and 0f for awake.
|
||||
*/
|
||||
private void setDarkAmount(float darkAmount) {
|
||||
boolean isAwake = darkAmount != 0;
|
||||
if (darkAmount == mDarkAmount) {
|
||||
return;
|
||||
}
|
||||
mDarkAmount = darkAmount;
|
||||
mView.setVisibility(isAwake ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private boolean isListAnimating() {
|
||||
return mKeyguardVisibilityHelper.isVisibilityAnimating();
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class KeyguardUserSwitcherController extends ViewController<KeyguardUserS
|
||||
protected void onViewAttached() {
|
||||
if (DEBUG) Log.d(TAG, "onViewAttached");
|
||||
mAdapter.registerDataSetObserver(mDataSetObserver);
|
||||
mDataSetObserver.onChanged();
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mKeyguardUpdateMonitor.registerCallback(mInfoCallback);
|
||||
mStatusBarStateController.addCallback(mStatusBarStateListener);
|
||||
mScreenLifecycle.addObserver(mScreenObserver);
|
||||
@@ -373,14 +373,13 @@ public class KeyguardUserSwitcherController extends ViewController<KeyguardUserS
|
||||
* @param darkAmount Amount of transition to doze: 1f for doze and 0f for awake.
|
||||
*/
|
||||
private void setDarkAmount(float darkAmount) {
|
||||
boolean isAwake = darkAmount != 0;
|
||||
boolean isFullyDozed = darkAmount == 1;
|
||||
if (darkAmount == mDarkAmount) {
|
||||
return;
|
||||
}
|
||||
mDarkAmount = darkAmount;
|
||||
mListView.setDarkAmount(darkAmount);
|
||||
mView.setVisibility(isAwake ? View.VISIBLE : View.GONE);
|
||||
if (!isAwake) {
|
||||
if (isFullyDozed) {
|
||||
closeSwitcherIfOpenAndNotSimple(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user