Merge "Add an option for vendors to provide a camera extensions proxy" into sc-dev

This commit is contained in:
Diego Wilson
2021-06-17 23:16:34 +00:00
committed by Android (Google) Code Review

View File

@@ -20,6 +20,7 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.ServiceConnection; import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.graphics.ImageFormat; import android.graphics.ImageFormat;
import android.hardware.camera2.extension.IAdvancedExtenderImpl; import android.hardware.camera2.extension.IAdvancedExtenderImpl;
import android.hardware.camera2.extension.ICameraExtensionsProxyService; import android.hardware.camera2.extension.ICameraExtensionsProxyService;
@@ -32,6 +33,7 @@ import android.hardware.camera2.params.StreamConfigurationMap;
import android.os.ConditionVariable; import android.os.ConditionVariable;
import android.os.IBinder; import android.os.IBinder;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.SystemProperties;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.util.Log; import android.util.Log;
@@ -235,6 +237,19 @@ public final class CameraExtensionCharacteristics {
if (mConnection == null) { if (mConnection == null) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClassName(PROXY_PACKAGE_NAME, PROXY_SERVICE_NAME); intent.setClassName(PROXY_PACKAGE_NAME, PROXY_SERVICE_NAME);
String vendorProxyPackage = SystemProperties.get(
"ro.vendor.camera.extensions.package");
String vendorProxyService = SystemProperties.get(
"ro.vendor.camera.extensions.service");
if (!vendorProxyPackage.isEmpty() && !vendorProxyService.isEmpty()) {
Log.v(TAG,
"Choosing the vendor camera extensions proxy package: "
+ vendorProxyPackage);
Log.v(TAG,
"Choosing the vendor camera extensions proxy service: "
+ vendorProxyService);
intent.setClassName(vendorProxyPackage, vendorProxyService);
}
mInitFuture = new InitializerFuture(); mInitFuture = new InitializerFuture();
mConnection = new ServiceConnection() { mConnection = new ServiceConnection() {
@Override @Override