|
|
@ -48,6 +48,7 @@ import androidx.core.app.NotificationCompat;
|
|
|
|
import androidx.core.content.FileProvider;
|
|
|
|
import androidx.core.content.FileProvider;
|
|
|
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
|
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.provider.MediaStore;
|
|
|
|
import android.telephony.SignalStrength;
|
|
|
|
import android.telephony.SignalStrength;
|
|
|
|
import android.telephony.SubscriptionManager;
|
|
|
|
import android.telephony.SubscriptionManager;
|
|
|
|
import android.telephony.TelephonyManager;
|
|
|
|
import android.telephony.TelephonyManager;
|
|
|
@ -75,6 +76,7 @@ import java.io.RandomAccessFile;
|
|
|
|
import java.io.Reader;
|
|
|
|
import java.io.Reader;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.net.InetAddress;
|
|
|
|
|
|
|
|
import java.net.URI;
|
|
|
|
import java.nio.channels.FileLock;
|
|
|
|
import java.nio.channels.FileLock;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -1552,7 +1554,39 @@ cellSignalStrengthGsm.getDbm();
|
|
|
|
|
|
|
|
|
|
|
|
public void callSystemCamera(final int cameraId, final long photoId) {
|
|
|
|
public void callSystemCamera(final int cameraId, final long photoId) {
|
|
|
|
Context context = getApplicationContext();
|
|
|
|
Context context = getApplicationContext();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Intent intent = null;
|
|
|
|
|
|
|
|
if (cameraId == 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intent.putExtra("android.intent.extras.CAMERA_FACING", android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intent.putExtra("android.intent.extra.USE_FRONT_CAMERA", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else{
|
|
|
|
|
|
|
|
intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String appPath = MicroPhotoContext.buildMpAppDir(context);
|
|
|
|
|
|
|
|
File targetPath = new File(new File(appPath), "tmp/" + Long.toString(photoId) + ".jpg");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Uri uri = FileProvider.getUriForFile(this, getPackageName() + ".fileprovider", targetPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(targetPath));
|
|
|
|
|
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (intent.resolveActivity(getPackageManager()) != null) {
|
|
|
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
final CameraAdb cameraAdb = new CameraAdb(context, MicroPhotoContext.buildMpAppDir(context));
|
|
|
|
final CameraAdb cameraAdb = new CameraAdb(context, MicroPhotoContext.buildMpAppDir(context));
|
|
|
|
|
|
|
|
|
|
|
|
cameraAdb.setCallback(new Runnable() {
|
|
|
|
cameraAdb.setCallback(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
@ -1567,6 +1601,7 @@ cellSignalStrengthGsm.getDbm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
cameraAdb.takePhoto(cameraId);
|
|
|
|
cameraAdb.takePhoto(cameraId);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
////////////////////////GPS////////////////////
|
|
|
|
////////////////////////GPS////////////////////
|
|
|
|
|
|
|
|
|
|
|
|