[Xiaomi Mi Note 10 Guides, News, & Discussion] TF1920:
And now with the 108Mpx Mode too!!!!

Finally was able to make the 108Mpx mode to work with OpenCamera too!

You need to edit the following files in the OpenCamera Source Code:

1.- build.gradle > to enable a bigger api level at least 26 sdk version

defaultConfig {
applicationId "net.sourceforge.opencamera"
minSdkVersion 26
targetSdkVersion 28

renderscriptTargetApi 26

2.- Edit the file net\sourceforge\opencamera\cameracontroller\CameraController2.java

to override the streaming info for the new resolutions

this is code is around line 2017 of the file

StreamConfigurationMap configs;
try {
configs =CameraStreamConfigurations.getCustomStreamConfigurationMap(characteristics); // New to enable the 108Mpx mode to show
// Updated for 108Mpx older was
//configs = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
}

3.- Add a new java file with the overriding code ( based on code found at https://gist.github.com/lgyjg/07fdc8146f1d472a0941dcd0e470c93d

You need to create a new file named CameraStreamConfigurations.java at

net\sourceforge\opencamera\cameracontroller\CameraStreamConfigurations.java

with the following code:

package net.sourceforge.opencamera.cameracontroller;

import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.params.StreamConfigurationMap;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

public class CameraStreamConfigurations {

@SuppressLint("PrivateApi")
public static StreamConfigurationMap getCustomStreamConfigurationMap(CameraCharacteristics cameraCharacteristics) {

try {
Class<?> streamConfigurationArrayClazz = Class.forName("[Landroid.hardware.camera2.params.StreamConfiguration;");
Class<?> cameraCharacteristicsKeyClazz = Class.forName("android.hardware.camera2.CameraCharacteristics$Key");
Class<?>[] params = {String.class, Class.class};
Object[] values = {"xiaomi.scaler.availableStreamConfigurations", streamConfigurationArrayClazz};
Constructor<?> constructor = cameraCharacteristicsKeyClazz.getDeclaredConstructor(params);
CameraCharacteristics.Key<?> MI_SCALER_AVAILABLE_STREAM_CONFIGURATIONS = (CameraCharacteristics.Key<?>) constructor.newInstance(values);

Object configurations = cameraCharacteristics.get(MI_SCALER_AVAILABLE_STREAM_CONFIGURATIONS);

boolean listHighResolution = true;

Object[] streamConfigurationMapValues = {
configurations,
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_MIN_FRAME_DURATIONS")),
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_STALL_DURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS")),
cameraCharacteristics.get(getFiled("CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS")),
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP")),
listHighResolution
};

Constructor<?> streamConfigurationMapConstructor = android.hardware.camera2.params.StreamConfigurationMap.class.getConstructors()[0];

StreamConfigurationMap mStreamConfigurationMap = (StreamConfigurationMap) streamConfigurationMapConstructor.newInstance(streamConfigurationMapValues);

return mStreamConfigurationMap;
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}

static CameraCharacteristics.Key<Object> getFiled(String filed) {
CameraCharacteristics.Key<Object> result = null;
try {
Field f = CameraCharacteristics.class.getField(filed);
result = (CameraCharacteristics.Key<Object>) f.get(null);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}

return result;
}
}