Skip to content

Commit fd25cdc

Browse files
authored
chore(SimPinFeeder): resolve Missing @IntDef in Switch lint warning (#56)
../../src/com/github/iusmac/sevensim/telephony/SimPinFeeder.java:126: Switch statement on an int with known associated constant missing case PinResultWrapper.PIN_RESULT_TYPE_ABORTED, PinResultWrapper.PIN_RESULT_TYPE_FAILURE Signed-off-by: iusmac <iusico.maxim@libero.it>
1 parent f337ecb commit fd25cdc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/com/github/iusmac/sevensim/telephony/SimPinFeeder.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void run() {
124124
mLogger.d("Attempted to unlock %s with %s.", simCard, result);
125125

126126
switch (result.getResult()) {
127-
case PinResultWrapper.PIN_RESULT_TYPE_SUCCESS -> {
127+
case PinResultWrapper.PIN_RESULT_TYPE_SUCCESS:
128128
// Persist on disk the PIN that was marked as invalid the last time
129129
// it was used, which is now valid
130130
if (pinEntity.isInvalid()) {
@@ -134,21 +134,22 @@ public void run() {
134134
mPinStorageLazy.get().storePin(encryptedPin);
135135
});
136136
}
137-
}
137+
break;
138138

139-
case PinResultWrapper.PIN_RESULT_TYPE_INCORRECT -> {
139+
case PinResultWrapper.PIN_RESULT_TYPE_INCORRECT:
140140
// Detected an incorrect SIM PIN code. Mark it as such and delegate
141141
// to the PIN storage to do its job
142142
pinEntity.setInvalid(true);
143143
mPinStorageLazy.get().handleBadPinEntity(pinEntity);
144-
}
144+
break;
145145

146-
default -> {
146+
case PinResultWrapper.PIN_RESULT_TYPE_ABORTED:
147+
case PinResultWrapper.PIN_RESULT_TYPE_FAILURE:
148+
default:
147149
mLogger.w("Retry attempt %d of 3 failed to unlock SIM card: %s.",
148150
retries, simCard);
149151
// No idea what this was and no way to find out. Retrying... :/
150152
continue retrySupplyPinLoop;
151-
}
152153
}
153154

154155
// PIN entity has been successfully supplied -- dropping it

0 commit comments

Comments
 (0)