package com.otaliastudios.cameraview.internal;

import android.os.Build;
import android.util.Log;
import android.util.Range;

import androidx.annotation.RequiresApi;

import com.otaliastudios.cameraview.CameraLogger;

import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

@RequiresApi(21)
public class FpsRangeValidator {

    private final static CameraLogger LOG = CameraLogger.create("FpsRangeValidator");
    private final static Map<String, List<Range<Integer>>> sIssues = new HashMap<>();

    static {
        sIssues.put("Google Pixel 4", Arrays.asList(new Range<>(15, 60)));
    }

    public static boolean validate(Range<Integer> range) {
        LOG.i("Build.MODEL:", Build.MODEL, "Build.BRAND:", Build.BRAND, "Build.MANUFACTURER:", Build.MANUFACTURER);
        String descriptor = Build.MANUFACTURER + " " + Build.MODEL;
        List<Range<Integer>> ranges = sIssues.get(descriptor);
        if (ranges != null && ranges.contains(range)) {
            LOG.i("Dropping range:", range);
            return false;
        }
        return true;
    }
}

@@ -668,16 +668,92 @@
  60)));%0A
+        sIssues.put(%22Google Pixel 4a%22, Arrays.asList(new Range%3C%3E(15, 60)));%0A
     %7D%0A%0A 

Add Pixel 4a into FpsRangeValidator (#1089)