Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java +2 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.text.TextUtils; import androidx.annotation.IntDef; import com.android.settingslib.Utils; import com.android.systemui.Dumpable; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -164,17 +163,14 @@ public class KeyguardIndicationRotateTextViewController extends * Transient messages: * - show immediately * - will continue to be in the rotation of messages shown until hideTransient is called. * - can be presented with an "error" color if isError is true */ public void showTransient(CharSequence newIndication, boolean isError) { public void showTransient(CharSequence newIndication) { final long inAnimationDuration = 600L; // see KeyguardIndicationTextView.getYInDuration updateIndication(INDICATION_TYPE_TRANSIENT, new KeyguardIndication.Builder() .setMessage(newIndication) .setTextColor(isError ? Utils.getColorError(getContext()) : mInitialTextColorState) .setMinVisibilityMillis(2000L + inAnimationDuration) .setTextColor(mInitialTextColorState) .build(), /* showImmediately */true); } Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +3 −7 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.ViewClippingUtil; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.settingslib.Utils; import com.android.settingslib.fuelgauge.BatteryStatus; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; Loading Loading @@ -130,7 +129,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal private String mRestingIndication; private String mAlignmentIndication; private CharSequence mTransientIndication; private boolean mTransientTextIsError; protected ColorStateList mInitialTextColorState; private boolean mVisible; private boolean mHideTransientMessageOnScreenOff; Loading Loading @@ -382,8 +380,7 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal private void updateTransient() { if (!TextUtils.isEmpty(mTransientIndication)) { mRotateTextViewController.showTransient(mTransientIndication, mTransientTextIsError); mRotateTextViewController.showTransient(mTransientIndication); } else { mRotateTextViewController.hideTransient(); } Loading Loading @@ -421,7 +418,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal INDICATION_TYPE_ALIGNMENT, new KeyguardIndication.Builder() .setMessage(mAlignmentIndication) .setTextColor(Utils.getColorError(mContext)) .setTextColor(ColorStateList.valueOf( mContext.getColor(R.color.misalignment_text_color))) .build(), true); } else { Loading Loading @@ -594,7 +592,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal boolean isError, boolean hideOnScreenOff) { mTransientIndication = transientIndication; mHideTransientMessageOnScreenOff = hideOnScreenOff && transientIndication != null; mTransientTextIsError = isError; mHandler.removeMessages(MSG_HIDE_TRANSIENT); mHandler.removeMessages(MSG_SWIPE_UP_TO_UNLOCK); if (mDozing && !TextUtils.isEmpty(mTransientIndication)) { Loading Loading @@ -811,7 +808,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("KeyguardIndicationController:"); pw.println(" mTransientTextIsError: " + mTransientTextIsError); pw.println(" mInitialTextColorState: " + mInitialTextColorState); pw.println(" mPowerPluggedInWired: " + mPowerPluggedInWired); pw.println(" mPowerPluggedIn: " + mPowerPluggedIn); Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ public class KeyguardIndicationRotateTextViewControllerTest extends SysuiTestCas reset(mExecutor); // WHEN we have a transient message mController.showTransient(TEST_MESSAGE_2, false); mController.showTransient(TEST_MESSAGE_2); // THEN // - we immediately update Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +7 −8 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import androidx.test.runner.AndroidJUnit4; import com.android.internal.app.IBatteryStats; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.settingslib.Utils; import com.android.settingslib.fuelgauge.BatteryStatus; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; Loading Loading @@ -248,8 +247,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { verifyIndicationMessage(INDICATION_TYPE_ALIGNMENT, mContext.getResources().getString(R.string.dock_alignment_slow_charging)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor()) .isEqualTo(Utils.getColorError(mContext)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor().getDefaultColor()) .isEqualTo(mContext.getColor(R.color.misalignment_text_color)); } @Test Loading @@ -265,8 +264,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { verifyIndicationMessage(INDICATION_TYPE_ALIGNMENT, mContext.getResources().getString(R.string.dock_alignment_not_charging)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor()) .isEqualTo(Utils.getColorError(mContext)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor().getDefaultColor()) .isEqualTo(mContext.getColor(R.color.misalignment_text_color)); } @Test Loading Loading @@ -680,7 +679,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { private void verifyHideIndication(int type) { if (type == INDICATION_TYPE_TRANSIENT) { verify(mRotateTextViewController).hideTransient(); verify(mRotateTextViewController, never()).showTransient(anyString(), anyBoolean()); verify(mRotateTextViewController, never()).showTransient(anyString()); } else { verify(mRotateTextViewController).hideIndication(type); verify(mRotateTextViewController, never()).updateIndication(eq(type), Loading @@ -689,10 +688,10 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { } private void verifyTransientMessage(String message) { verify(mRotateTextViewController).showTransient(eq(message), anyBoolean()); verify(mRotateTextViewController).showTransient(eq(message)); } private void verifyNoTransientMessage() { verify(mRotateTextViewController, never()).showTransient(any(), anyBoolean()); verify(mRotateTextViewController, never()).showTransient(any()); } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java +2 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.text.TextUtils; import androidx.annotation.IntDef; import com.android.settingslib.Utils; import com.android.systemui.Dumpable; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -164,17 +163,14 @@ public class KeyguardIndicationRotateTextViewController extends * Transient messages: * - show immediately * - will continue to be in the rotation of messages shown until hideTransient is called. * - can be presented with an "error" color if isError is true */ public void showTransient(CharSequence newIndication, boolean isError) { public void showTransient(CharSequence newIndication) { final long inAnimationDuration = 600L; // see KeyguardIndicationTextView.getYInDuration updateIndication(INDICATION_TYPE_TRANSIENT, new KeyguardIndication.Builder() .setMessage(newIndication) .setTextColor(isError ? Utils.getColorError(getContext()) : mInitialTextColorState) .setMinVisibilityMillis(2000L + inAnimationDuration) .setTextColor(mInitialTextColorState) .build(), /* showImmediately */true); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +3 −7 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.ViewClippingUtil; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.settingslib.Utils; import com.android.settingslib.fuelgauge.BatteryStatus; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; Loading Loading @@ -130,7 +129,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal private String mRestingIndication; private String mAlignmentIndication; private CharSequence mTransientIndication; private boolean mTransientTextIsError; protected ColorStateList mInitialTextColorState; private boolean mVisible; private boolean mHideTransientMessageOnScreenOff; Loading Loading @@ -382,8 +380,7 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal private void updateTransient() { if (!TextUtils.isEmpty(mTransientIndication)) { mRotateTextViewController.showTransient(mTransientIndication, mTransientTextIsError); mRotateTextViewController.showTransient(mTransientIndication); } else { mRotateTextViewController.hideTransient(); } Loading Loading @@ -421,7 +418,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal INDICATION_TYPE_ALIGNMENT, new KeyguardIndication.Builder() .setMessage(mAlignmentIndication) .setTextColor(Utils.getColorError(mContext)) .setTextColor(ColorStateList.valueOf( mContext.getColor(R.color.misalignment_text_color))) .build(), true); } else { Loading Loading @@ -594,7 +592,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal boolean isError, boolean hideOnScreenOff) { mTransientIndication = transientIndication; mHideTransientMessageOnScreenOff = hideOnScreenOff && transientIndication != null; mTransientTextIsError = isError; mHandler.removeMessages(MSG_HIDE_TRANSIENT); mHandler.removeMessages(MSG_SWIPE_UP_TO_UNLOCK); if (mDozing && !TextUtils.isEmpty(mTransientIndication)) { Loading Loading @@ -811,7 +808,6 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("KeyguardIndicationController:"); pw.println(" mTransientTextIsError: " + mTransientTextIsError); pw.println(" mInitialTextColorState: " + mInitialTextColorState); pw.println(" mPowerPluggedInWired: " + mPowerPluggedInWired); pw.println(" mPowerPluggedIn: " + mPowerPluggedIn); Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ public class KeyguardIndicationRotateTextViewControllerTest extends SysuiTestCas reset(mExecutor); // WHEN we have a transient message mController.showTransient(TEST_MESSAGE_2, false); mController.showTransient(TEST_MESSAGE_2); // THEN // - we immediately update Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +7 −8 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import androidx.test.runner.AndroidJUnit4; import com.android.internal.app.IBatteryStats; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.settingslib.Utils; import com.android.settingslib.fuelgauge.BatteryStatus; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; Loading Loading @@ -248,8 +247,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { verifyIndicationMessage(INDICATION_TYPE_ALIGNMENT, mContext.getResources().getString(R.string.dock_alignment_slow_charging)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor()) .isEqualTo(Utils.getColorError(mContext)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor().getDefaultColor()) .isEqualTo(mContext.getColor(R.color.misalignment_text_color)); } @Test Loading @@ -265,8 +264,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { verifyIndicationMessage(INDICATION_TYPE_ALIGNMENT, mContext.getResources().getString(R.string.dock_alignment_not_charging)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor()) .isEqualTo(Utils.getColorError(mContext)); assertThat(mKeyguardIndicationCaptor.getValue().getTextColor().getDefaultColor()) .isEqualTo(mContext.getColor(R.color.misalignment_text_color)); } @Test Loading Loading @@ -680,7 +679,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { private void verifyHideIndication(int type) { if (type == INDICATION_TYPE_TRANSIENT) { verify(mRotateTextViewController).hideTransient(); verify(mRotateTextViewController, never()).showTransient(anyString(), anyBoolean()); verify(mRotateTextViewController, never()).showTransient(anyString()); } else { verify(mRotateTextViewController).hideIndication(type); verify(mRotateTextViewController, never()).updateIndication(eq(type), Loading @@ -689,10 +688,10 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { } private void verifyTransientMessage(String message) { verify(mRotateTextViewController).showTransient(eq(message), anyBoolean()); verify(mRotateTextViewController).showTransient(eq(message)); } private void verifyNoTransientMessage() { verify(mRotateTextViewController, never()).showTransient(any(), anyBoolean()); verify(mRotateTextViewController, never()).showTransient(any()); } }