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

Commit bc903e8e authored by Chun Zhang's avatar Chun Zhang
Browse files

Check intent null before calling

Bug: 413766370
Test: TreeHugger
Test: manual
Test: atest SafetySourceBroadcastReceiverTest
Test: atest LockScreenSafetySourceTest
Test: atest ActiveUnlockStatusUtilsTest
Test: atest WearSafetySourceTest
Flag: com.android.settings.flags.biometrics_onboarding_education
Change-Id: Ifff4ce2d33d56e001bf800ecc1ec357273ceeaf9
parent 52e9b923
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.settings.biometrics.combination.BiometricsSettingsBase


import android.app.PendingIntent;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.os.UserManager;
import android.os.UserManager;
import android.safetycenter.SafetyEvent;
import android.safetycenter.SafetyEvent;


@@ -91,13 +92,19 @@ public final class WearSafetySource {
                summary = getSummaryFromContentProvider(context, authority);
                summary = getSummaryFromContentProvider(context, authority);
            }
            }


            Intent activeUnlockIntent = activeUnlockStatusUtils.getIntent();
            if (activeUnlockIntent == null) {
                sendNullData(context, safetyEvent);
                return;
            }

            BiometricSourcesUtils.setBiometricSafetySourceData(
            BiometricSourcesUtils.setBiometricSafetySourceData(
                    SAFETY_SOURCE_ID,
                    SAFETY_SOURCE_ID,
                    context,
                    context,
                    activeUnlockStatusUtils.getTitleForActiveUnlockOnly(),
                    activeUnlockStatusUtils.getTitleForActiveUnlockOnly(),
                    summary,
                    summary,
                    PendingIntent.getActivity(context, ACTIVE_UNLOCK_REQUEST,
                    PendingIntent.getActivity(context, ACTIVE_UNLOCK_REQUEST,
                            activeUnlockStatusUtils.getIntent(),
                            activeUnlockIntent,
                            PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT),
                            PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT),
                    /* enabled= */ true,
                    /* enabled= */ true,
                    hasEnrolled,
                    hasEnrolled,