Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9d42a05 authored by Julian Thomassie's avatar Julian Thomassie
Browse files

PinStorage: Record missing encryption key metric.

Fixes: 224871949
Test: none, simple metrics improvement
Change-Id: Id80213e76fb692a727720f4f30594512d4894677
parent 716d26ed
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_COUNT_NOT_MATCHING_AFTER_REBOOT;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_DECRYPTION_ERROR;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_ENCRYPTION_ERROR;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_ENCRYPTION_KEY_MISSING;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_REQUIRED_AFTER_REBOOT;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_STORED_FOR_VERIFICATION;
import static com.android.internal.telephony.TelephonyStatsLog.PIN_STORAGE_EVENT__EVENT__PIN_VERIFICATION_FAILURE;
@@ -723,7 +724,11 @@ public class PinStorage extends Handler {
     */
    @Nullable
    private StoredPin decryptStoredPin(byte[] blob, @Nullable SecretKey secretKey) {
        if (secretKey != null) {
        if (secretKey == null) {
            TelephonyStatsLog.write(PIN_STORAGE_EVENT,
                    PIN_STORAGE_EVENT__EVENT__PIN_ENCRYPTION_KEY_MISSING,
                    /* number_of_pins= */ 1, /* package_name= */ "");
        } else {
            try {
                byte[] decryptedPin = decrypt(secretKey, blob);
                if (decryptedPin.length > 0) {