Skip to content

Commit

Permalink
refactor(android): cleanup unused or obsolete code (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
breautek authored Dec 28, 2024
1 parent d5ba992 commit ce42ab4
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/android/Capture.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ce42ab4

Please sign in to comment.