From: thermatk Date: Fri, 22 Jun 2018 17:04:43 +0200 Subject: kill Vision Barcode, face and text detection APIs License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/BUILD.gn | 2 -- services/shape_detection/BUILD.gn | 8 ------- .../chromium/shape_detection/BitmapUtils.java | 12 ---------- .../shape_detection/InterfaceRegistrar.java | 23 ++----------------- 4 files changed, 2 insertions(+), 43 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -299,8 +299,6 @@ if (current_toolchain == default_toolchain) { "$google_play_services_package:google_play_services_gcm_java", "$google_play_services_package:google_play_services_iid_java", "$google_play_services_package:google_play_services_tasks_java", - "$google_play_services_package:google_play_services_vision_common_java", - "$google_play_services_package:google_play_services_vision_java", "//base:jni_java", "//cc:cc_java", "//cc/mojom:mojom_java", diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn --- a/services/shape_detection/BUILD.gn +++ b/services/shape_detection/BUILD.gn @@ -111,21 +111,13 @@ if (is_android) { android_library("shape_detection_java") { sources = [ - "android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java", - "android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java", "android/java/src/org/chromium/shape_detection/BitmapUtils.java", - "android/java/src/org/chromium/shape_detection/FaceDetectionImpl.java", - "android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java", - "android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java", "android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java", - "android/java/src/org/chromium/shape_detection/TextDetectionImpl.java", ] deps = [ "$google_play_services_package:google_play_services_base_java", "$google_play_services_package:google_play_services_basement_java", - "$google_play_services_package:google_play_services_vision_common_java", - "$google_play_services_package:google_play_services_vision_java", "//base:base_java", "//base:jni_java", "//mojo/public/java:base_java", diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java @@ -6,8 +6,6 @@ package org.chromium.shape_detection; import android.graphics.Bitmap; -import com.google.android.gms.vision.Frame; - import org.chromium.mojo_base.BigBufferUtil; import java.nio.ByteBuffer; @@ -43,14 +41,4 @@ public class BitmapUtils { return bitmap; } } - - public static Frame convertToFrame(org.chromium.skia.mojom.BitmapN32 bitmapData) { - Bitmap bitmap = convertToBitmap(bitmapData); - if (bitmap == null) { - return null; - } - - // This constructor implies a pixel format conversion to YUV. - return new Frame.Builder().setBitmap(bitmap).build(); - } } diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java @@ -8,9 +8,6 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.mojo.system.MessagePipeHandle; import org.chromium.mojo.system.impl.CoreImpl; -import org.chromium.shape_detection.mojom.BarcodeDetectionProvider; -import org.chromium.shape_detection.mojom.FaceDetectionProvider; -import org.chromium.shape_detection.mojom.TextDetection; @JNINamespace("shape_detection") class InterfaceRegistrar { @@ -22,33 +19,17 @@ class InterfaceRegistrar { static void bindBarcodeDetectionProvider(long nativeHandle) { // Immediately wrap |nativeHandle| as it cannot be allowed to leak. MessagePipeHandle handle = messagePipeHandleFromNative(nativeHandle); - - BarcodeDetectionProvider impl = BarcodeDetectionProviderImpl.create(); - if (impl == null) { - handle.close(); - return; - } - - BarcodeDetectionProvider.MANAGER.bind(impl, handle); + handle.close(); } @CalledByNative static void bindFaceDetectionProvider(long nativeHandle) { - FaceDetectionProvider.MANAGER.bind( - new FaceDetectionProviderImpl(), messagePipeHandleFromNative(nativeHandle)); } @CalledByNative static void bindTextDetection(long nativeHandle) { // Immediately wrap |nativeHandle| as it cannot be allowed to leak. MessagePipeHandle handle = messagePipeHandleFromNative(nativeHandle); - - TextDetection impl = TextDetectionImpl.create(); - if (impl == null) { - handle.close(); - return; - } - - TextDetection.MANAGER.bind(impl, handle); + handle.close(); } } -- 2.25.1