From 949370eca613e746674e84d276235270d76e02b9 Mon Sep 17 00:00:00 2001 From: Norman Breau Date: Wed, 25 Dec 2024 14:28:26 -0400 Subject: [PATCH] refactor: cleanup unused or obsolete code --- src/android/Capture.java | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/android/Capture.java b/src/android/Capture.java index 29111f24..0399563a 100644 --- a/src/android/Capture.java +++ b/src/android/Capture.java @@ -28,9 +28,7 @@ Licensed to the Apache Software Foundation (ASF) under one import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import java.util.Date; import org.apache.cordova.CallbackContext; @@ -48,20 +46,15 @@ Licensed to the Apache Software Foundation (ASF) under one import android.Manifest; import android.app.Activity; import android.content.ActivityNotFoundException; -import android.content.ContentResolver; -import android.content.ContentValues; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; -import android.database.Cursor; import android.graphics.BitmapFactory; -import android.icu.util.Output; import android.media.MediaPlayer; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; -import android.provider.MediaStore; import android.system.Os; import android.system.OsConstants; @@ -329,11 +322,8 @@ private void captureVideo(Request req) { intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, videoUri); intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); LOG.d(LOG_TAG, "Recording a video and saving to: " + this.videoAbsolutePath); - - if(Build.VERSION.SDK_INT > 7){ - intent.putExtra("android.intent.extra.durationLimit", req.duration); - intent.putExtra("android.intent.extra.videoQuality", req.quality); - } + intent.putExtra("android.intent.extra.durationLimit", req.duration); + intent.putExtra("android.intent.extra.videoQuality", req.quality); this.cordova.startActivityForResult((CordovaPlugin) this, intent, req.requestCode); } @@ -557,18 +547,6 @@ private JSONObject createErrorObject(int code, String message) { return obj; } - /** - * Determine if we are storing the images in internal or external storage - * @return Uri - */ - private Uri whichContentStore() { - if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { - return android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI; - } else { - return android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI; - } - } - private void executeRequest(Request req) { switch (req.action) { case CAPTURE_AUDIO: