|
|
@ -13,6 +13,8 @@ import android.content.ComponentName;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.IntentFilter;
|
|
|
|
import android.content.IntentFilter;
|
|
|
|
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
|
|
|
|
import android.graphics.ImageDecoder;
|
|
|
|
import android.location.Location;
|
|
|
|
import android.location.Location;
|
|
|
|
import android.location.LocationListener;
|
|
|
|
import android.location.LocationListener;
|
|
|
|
import android.location.LocationManager;
|
|
|
|
import android.location.LocationManager;
|
|
|
@ -392,13 +394,33 @@ public class MicroPhotoService extends Service {
|
|
|
|
mService.reloadConfigs(mService.mNativeHandle);
|
|
|
|
mService.reloadConfigs(mService.mNativeHandle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (TextUtils.equals(ACTION_VIDEO_FINISHED, action)) {
|
|
|
|
} else if (TextUtils.equals(ACTION_VIDEO_FINISHED, action)) {
|
|
|
|
boolean photoOrVideo = intent.getBooleanExtra("photoOrVideo", false);
|
|
|
|
final boolean photoOrVideo = intent.getBooleanExtra("photoOrVideo", false);
|
|
|
|
boolean result = intent.getBooleanExtra("result", false);
|
|
|
|
final boolean result = intent.getBooleanExtra("result", false);
|
|
|
|
String path = intent.getStringExtra("path");
|
|
|
|
final String path = intent.getStringExtra("path");
|
|
|
|
long videoId = intent.getLongExtra("videoId", 0);
|
|
|
|
final long videoId = intent.getLongExtra("videoId", 0);
|
|
|
|
Log.i(TAG, "Recording received(" + Long.toString(videoId) + "):" + path);
|
|
|
|
Log.i(TAG, "Recording received(" + Long.toString(videoId) + "):" + path);
|
|
|
|
|
|
|
|
|
|
|
|
mService.recordingFinished(mService.mNativeHandle, photoOrVideo, result, path, videoId);
|
|
|
|
if (photoOrVideo) {
|
|
|
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
Bitmap bm = null;
|
|
|
|
|
|
|
|
ImageDecoder.Source src = ImageDecoder.createSource(new File(path));
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
bm = ImageDecoder.decodeBitmap(src);
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thread.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mService.recordingFinished(mService.mNativeHandle, photoOrVideo, result, path, videoId);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (TextUtils.equals(ACTION_STOP, action)) {
|
|
|
|
} else if (TextUtils.equals(ACTION_STOP, action)) {
|
|
|
|
mService.stopTerminalService();
|
|
|
|
mService.stopTerminalService();
|
|
|
|
} else if (TextUtils.equals(ACTION_IMP_PUBKRY, action)) {
|
|
|
|
} else if (TextUtils.equals(ACTION_IMP_PUBKRY, action)) {
|
|
|
@ -1206,6 +1228,7 @@ cellSignalStrengthGsm.getDbm();
|
|
|
|
protected native void updatePosition(long handler, double lon, double lat, double radius, long ts);
|
|
|
|
protected native void updatePosition(long handler, double lon, double lat, double radius, long ts);
|
|
|
|
protected native boolean uninit(long handler);
|
|
|
|
protected native boolean uninit(long handler);
|
|
|
|
protected native void recordingFinished(long handler, boolean photoOrVideo, boolean result, String path, long videoId);
|
|
|
|
protected native void recordingFinished(long handler, boolean photoOrVideo, boolean result, String path, long videoId);
|
|
|
|
|
|
|
|
protected native void captureFinished(long handler, boolean photoOrVideo, boolean result, Bitmap bm, long videoId);
|
|
|
|
public static native long takePhoto(int channel, int preset, boolean photoOrVideo, String configFilePath, String path);
|
|
|
|
public static native long takePhoto(int channel, int preset, boolean photoOrVideo, String configFilePath, String path);
|
|
|
|
public static native void releaseDeviceHandle(long deviceHandle);
|
|
|
|
public static native void releaseDeviceHandle(long deviceHandle);
|
|
|
|
public static native boolean sendExternalPhoto(long deviceHandle, String path);
|
|
|
|
public static native boolean sendExternalPhoto(long deviceHandle, String path);
|
|
|
|