public void onReceive()

in DirectBoot/Application/src/main/java/com/example/android/directboot/BootBroadcastReceiver.java [45:63]


    public void onReceive(Context context, Intent intent) {
        boolean bootCompleted;
        String action = intent.getAction();
        Log.i(TAG, "Received action: " + action + ", user unlocked: " + UserManagerCompat
                .isUserUnlocked(context));
        if (BuildCompat.isAtLeastN()) {
            bootCompleted = Intent.ACTION_LOCKED_BOOT_COMPLETED.equals(action);
        } else {
            bootCompleted = Intent.ACTION_BOOT_COMPLETED.equals(action);
        }
        if (!bootCompleted) {
            return;
        }
        AlarmUtil util = new AlarmUtil(context);
        AlarmStorage alarmStorage = new AlarmStorage(context);
        for (Alarm alarm : alarmStorage.getAlarms()) {
            util.scheduleAlarm(alarm);
        }
    }