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

Commit b0056642 authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera2: Fix wrong usage of toArray

Change to use "<T> T[]" version of toArray.

Change-Id: I021ed5a4e446b34028810e8acea3395c1c3387e7
parent 63e44bd9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Size;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;
import java.util.Set;

import static com.android.internal.util.Preconditions.*;

@@ -398,7 +399,8 @@ public final class StreamConfigurationMap {
     * @see #getHighSpeedVideoFpsRangesFor(Size)
     */
    public Size[] getHighSpeedVideoSizes() {
        return (Size[]) mHighSpeedVideoSizeMap.keySet().toArray();
        Set<Size> keySet = mHighSpeedVideoSizeMap.keySet();
        return keySet.toArray(new Size[keySet.size()]);
    }

    /**
@@ -475,7 +477,8 @@ public final class StreamConfigurationMap {
     */
    @SuppressWarnings("unchecked")
    public Range<Integer>[] getHighSpeedVideoFpsRanges() {
        return (Range<Integer>[]) mHighSpeedVideoFpsRangeMap.keySet().toArray();
        Set<Range<Integer>> keySet = mHighSpeedVideoFpsRangeMap.keySet();
        return keySet.toArray(new Range[keySet.size()]);
    }

    /**