Initialize executors before updating change PIN state
When the activity is launched it might immediately attempt to verify the stored pin, which happened before the executor is initialized
Bug: 69179171
Test: N/A - legacy code, refactoring required
PiperOrigin-RevId: 176433263
Change-Id: I8202a760dbfc7759e128ef31d477510526d0bee7
diff --git a/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java b/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java
index 4d53d61..13ca5b7 100644
--- a/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java
+++ b/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java
@@ -357,13 +357,6 @@
mHintText = (TextView) view.findViewById(R.id.hintText);
mErrorText = (TextView) view.findViewById(R.id.errorText);
- if (isPinScrambled(this, mPhoneAccountHandle)) {
- mOldPin = mPinChanger.getScrambledPin();
- updateState(State.VerifyOldPin);
- } else {
- updateState(State.EnterOldPin);
- }
-
mChangePinExecutor =
DialerExecutorComponent.get(this)
.dialerExecutorFactory()
@@ -371,6 +364,13 @@
.onSuccess(this::sendResult)
.onFailure((tr) -> sendResult(PinChanger.CHANGE_PIN_SYSTEM_ERROR))
.build();
+
+ if (isPinScrambled(this, mPhoneAccountHandle)) {
+ mOldPin = mPinChanger.getScrambledPin();
+ updateState(State.VerifyOldPin);
+ } else {
+ updateState(State.EnterOldPin);
+ }
}
/** Extracts the pin length requirement sent by the server with a STATUS SMS. */