|
|
|
@ -30,8 +30,18 @@ import com.dowse.camera.client.DSCameraManager;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.LocalTime;
|
|
|
|
|
import java.time.ZoneOffset;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
public class MicroPhotoService extends Service {
|
|
|
|
|
|
|
|
|
@ -55,6 +65,19 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
private static String ACTION_HEARTBEAT = "ACT_HB";
|
|
|
|
|
private static String ACTION_TAKE_PHOTO = "ACT_TP";
|
|
|
|
|
|
|
|
|
|
private static String ACTION_TIMEOUT = "ACT_TIMEOUT";
|
|
|
|
|
|
|
|
|
|
private static String EXTRA_PARAM_CHANNEL = "Channel";
|
|
|
|
|
private static String EXTRA_PARAM_SCHEDULES = "Schedules";
|
|
|
|
|
private static String EXTRA_PARAM_SCHEDULE = "Schedule_";
|
|
|
|
|
private static String EXTRA_PARAM_PRESET = "Preset";
|
|
|
|
|
private static String EXTRA_PARAM_TIME = "Time";
|
|
|
|
|
// private static String EXTRA_PARAM_FILENAME = "FileName";
|
|
|
|
|
|
|
|
|
|
private static String EXTRA_PARAM_TIMER_UID = "TimerUid";
|
|
|
|
|
// private static String EXTRA_PARAM_TIMER_TYPE = "TimerType";
|
|
|
|
|
private static String EXTRA_PARAM_TIMEOUT = "Timeout";
|
|
|
|
|
|
|
|
|
|
private final static String FOREGROUND_CHANNEL_ID = "foreground_channel_id";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -63,20 +86,15 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
public static final int NOT_CONNECTED = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static String mDesc = "";
|
|
|
|
|
|
|
|
|
|
private AlarmManager mAlarmManager;
|
|
|
|
|
private NotificationManager mNotificationManager;
|
|
|
|
|
private Handler handler;
|
|
|
|
|
private int count = 0;
|
|
|
|
|
|
|
|
|
|
private int mHeartbeatDuration = 300000; // 5m: 5 * 60 * 1000
|
|
|
|
|
private long mNextHeartbeatTime = 0;
|
|
|
|
|
|
|
|
|
|
private Map<Long, PendingIntent> mTimers = new HashMap<>();
|
|
|
|
|
private static int stateService = STATE_SERVICE.NOT_CONNECTED;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MicroPhotoService() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -92,7 +110,31 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
|
|
|
|
stateService = STATE_SERVICE.NOT_CONNECTED;
|
|
|
|
|
|
|
|
|
|
alarmReceiver = new AlarmReceiver(this);
|
|
|
|
|
// 注册广播接受者
|
|
|
|
|
IntentFilter intentFilter = new IntentFilter(ACTION_HEARTBEAT);
|
|
|
|
|
intentFilter.addAction(ACTION_TAKE_PHOTO);
|
|
|
|
|
intentFilter.addAction(ACTION_TIMEOUT);
|
|
|
|
|
registerReceiver( alarmReceiver, intentFilter);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
|
AlarmManager.AlarmClockInfo aci = alarmManager.getNextAlarmClock();
|
|
|
|
|
if (aci == null) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (aci.getShowIntent().isBroadcast()) {
|
|
|
|
|
// alarmManager.cancel(aci.getShowIntent());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// alarmManager.cancel();
|
|
|
|
|
|
|
|
|
|
boolean res = false;
|
|
|
|
|
/*
|
|
|
|
|
res = DSCameraManager.getInstace().init();
|
|
|
|
|
ChannelPicParam picParam = new ChannelPicParam();
|
|
|
|
|
picParam.setColor(1);
|
|
|
|
@ -100,8 +142,13 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
picParam.setHeight(1080);
|
|
|
|
|
picParam.setCompress_radio(40);
|
|
|
|
|
DSCameraManager.getInstace().setPicParam(1, picParam);
|
|
|
|
|
*/
|
|
|
|
|
// Environment.getExternalStoragePublicDirectory(String)
|
|
|
|
|
File path = getApplicationContext().getFilesDir();
|
|
|
|
|
File path = new File(Environment.getExternalStorageDirectory(), "com.xyp.mp/");
|
|
|
|
|
if (!path.exists()) {
|
|
|
|
|
path.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
// File path = getApplicationContext().getFilesDir();
|
|
|
|
|
String appPath = path.getAbsolutePath();
|
|
|
|
|
Log.i("XYMP", "AppPath=" + appPath);
|
|
|
|
|
String ip = "180.166.218.222";
|
|
|
|
@ -109,14 +156,203 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
String cmdid = "XYDEV100230100012";
|
|
|
|
|
init(appPath, ip, port, cmdid);
|
|
|
|
|
|
|
|
|
|
alarmReceiver = new AlarmReceiver(this);
|
|
|
|
|
// registerHeartbeatTimer(getHeartbeatDuration());
|
|
|
|
|
|
|
|
|
|
// 注册广播接受者
|
|
|
|
|
IntentFilter intentFilter = new IntentFilter(ACTION_HEARTBEAT);
|
|
|
|
|
intentFilter.addAction(ACTION_TAKE_PHOTO);
|
|
|
|
|
registerReceiver( alarmReceiver, intentFilter);
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
long nowTs = date.getTime() / 1000;
|
|
|
|
|
date.setHours(0);
|
|
|
|
|
date.setMinutes(0);
|
|
|
|
|
date.setSeconds(0);
|
|
|
|
|
long startTime = date.getTime() / 1000;
|
|
|
|
|
long baseTime = nowTs - startTime;
|
|
|
|
|
|
|
|
|
|
registerCaptureSchedule(startTime, baseTime);
|
|
|
|
|
|
|
|
|
|
// registerPhotoTimer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class AlarmReceiver extends BroadcastReceiver {
|
|
|
|
|
|
|
|
|
|
private MicroPhotoService mService;
|
|
|
|
|
public AlarmReceiver(MicroPhotoService service) {
|
|
|
|
|
mService = service;
|
|
|
|
|
}
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if(TextUtils.equals(ACTION_HEARTBEAT, action)){
|
|
|
|
|
Log.i(TAG, "receiver ACTION=" + action);
|
|
|
|
|
mService.sendHeartbeat();
|
|
|
|
|
mService.registerHeartbeatTimer();
|
|
|
|
|
}
|
|
|
|
|
else if(TextUtils.equals(ACTION_TAKE_PHOTO, action)) {
|
|
|
|
|
long ts = intent.getLongExtra(EXTRA_PARAM_TIME, 0);
|
|
|
|
|
int cnt = intent.getIntExtra(EXTRA_PARAM_SCHEDULES, 0);
|
|
|
|
|
if (cnt > 0) {
|
|
|
|
|
for (int idx = 0; idx < cnt; idx++) {
|
|
|
|
|
long val = intent.getLongExtra(EXTRA_PARAM_SCHEDULE + idx, 0);
|
|
|
|
|
|
|
|
|
|
int channel = (int)((val & 0xFF0000000000L) >> 40);
|
|
|
|
|
int preset = (int)((val & 0xFF00000000L) >> 32);
|
|
|
|
|
|
|
|
|
|
mService.takePhoto(channel, preset, mService.buildPhotoDir(channel), mService.buildPhotoFileName(channel, preset, ts), true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Register Next Photo Timer
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
long nowTs = date.getTime() / 1000;
|
|
|
|
|
date.setHours(0);
|
|
|
|
|
date.setMinutes(0);
|
|
|
|
|
date.setSeconds(0);
|
|
|
|
|
long startTime = date.getTime() / 1000;
|
|
|
|
|
long baseTime = nowTs - startTime;
|
|
|
|
|
|
|
|
|
|
mService.registerCaptureSchedule(startTime, baseTime);
|
|
|
|
|
}
|
|
|
|
|
else if(TextUtils.equals(ACTION_TIMEOUT, action)) {
|
|
|
|
|
long uid = intent.getLongExtra(EXTRA_PARAM_TIMER_UID, 0);
|
|
|
|
|
Log.i(TAG, "Timeout:" + uid);
|
|
|
|
|
mService.fireTimeout(uid);
|
|
|
|
|
|
|
|
|
|
int timeout = intent.getIntExtra(EXTRA_PARAM_TIMEOUT, 0);
|
|
|
|
|
Long uidObj = Long.valueOf(uid);
|
|
|
|
|
PendingIntent pendingIntent = mService.mTimers.get(uidObj);
|
|
|
|
|
|
|
|
|
|
if (pendingIntent != null) {
|
|
|
|
|
mService.registerTimer(pendingIntent, uid, timeout);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateHeartbeatDuration(int duration) {
|
|
|
|
|
mHeartbeatDuration = duration;
|
|
|
|
|
}
|
|
|
|
|
private void registerHeartbeatTimer() {
|
|
|
|
|
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
Intent alarmIntent = new Intent();
|
|
|
|
|
alarmIntent.setAction(ACTION_HEARTBEAT);
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + mHeartbeatDuration, pendingIntent);
|
|
|
|
|
|
|
|
|
|
mNextHeartbeatTime = System.currentTimeMillis() + mHeartbeatDuration;
|
|
|
|
|
// alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + timeout, pendingIntent);
|
|
|
|
|
}
|
|
|
|
|
private void registerPhotoTimer(int channel, int preset, long ts, long timeout, List<Long> schedules) {
|
|
|
|
|
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
Intent alarmIntent = new Intent();
|
|
|
|
|
alarmIntent.setAction(ACTION_TAKE_PHOTO);
|
|
|
|
|
int cnt = schedules.size();
|
|
|
|
|
alarmIntent.putExtra(EXTRA_PARAM_SCHEDULES, cnt);
|
|
|
|
|
for (int idx = 0; idx < cnt; idx++) {
|
|
|
|
|
alarmIntent.putExtra(EXTRA_PARAM_SCHEDULE + idx, schedules.get(idx).longValue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
alarmIntent.putExtra(EXTRA_PARAM_TIME, ts);
|
|
|
|
|
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + timeout, pendingIntent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
registerHeartbeatTimer(getHeartbeatDuration());
|
|
|
|
|
// private HashMap<Long, Integer> mTimers = new HashMap<Long, Integer>();
|
|
|
|
|
|
|
|
|
|
public boolean registerTimer(long uid, int timeout) {
|
|
|
|
|
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
Intent alarmIntent = new Intent();
|
|
|
|
|
alarmIntent.setAction(ACTION_TIMEOUT);
|
|
|
|
|
alarmIntent.putExtra(EXTRA_PARAM_TIMER_UID, uid);
|
|
|
|
|
alarmIntent.putExtra(EXTRA_PARAM_TIMEOUT, timeout);
|
|
|
|
|
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
|
|
|
|
|
|
|
mTimers.put(Long.valueOf(uid), pendingIntent);
|
|
|
|
|
return registerTimer(pendingIntent, uid, timeout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean registerTimer(PendingIntent pendingIntent, long uid, int timeout) {
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + timeout, pendingIntent);
|
|
|
|
|
|
|
|
|
|
Log.i(TAG, "RegTimer:" + uid + " timeout=" + timeout);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean unregisterTimer(long uid) {
|
|
|
|
|
|
|
|
|
|
Long uidObj = Long.valueOf(uid);
|
|
|
|
|
PendingIntent pendingIntent = mTimers.get(uidObj);
|
|
|
|
|
if (pendingIntent != null) {
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
|
|
|
|
|
alarmManager.cancel(pendingIntent);
|
|
|
|
|
|
|
|
|
|
mTimers.remove(uidObj);
|
|
|
|
|
Log.i(TAG, "UnregTimer:" + uid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
private boolean registerCaptureSchedule(long startTime, long baseTime) {
|
|
|
|
|
|
|
|
|
|
long[] photoTimeData = getPhotoTimeData();
|
|
|
|
|
if (photoTimeData == null) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int cnt = photoTimeData.length;
|
|
|
|
|
int idx = 0;
|
|
|
|
|
short channel = 0;
|
|
|
|
|
short preset = 0;
|
|
|
|
|
int ts = 0;
|
|
|
|
|
long val = 0L;
|
|
|
|
|
// int maxDuration = mHeartbeatDuration * 2 / 1000;
|
|
|
|
|
int maxDuration = 35 * 60 * 1000 + 1000;
|
|
|
|
|
int currentTs = 0;
|
|
|
|
|
List<Long> schedules = new ArrayList<>();
|
|
|
|
|
while (true) {
|
|
|
|
|
val = photoTimeData[idx++];
|
|
|
|
|
ts = (int)(val & 0xFFFFFFFFL);
|
|
|
|
|
|
|
|
|
|
if (ts < baseTime) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((ts - baseTime) > maxDuration) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentTs == 0) {
|
|
|
|
|
currentTs = ts;
|
|
|
|
|
channel = (short)((val & 0xFF0000000000L) >> 40);
|
|
|
|
|
preset = (short)((val & 0xFF00000000L) >> 32);
|
|
|
|
|
|
|
|
|
|
schedules.add(Long.valueOf(val));
|
|
|
|
|
} else if (ts > currentTs) {
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
schedules.add(Long.valueOf(val));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!schedules.isEmpty()) {
|
|
|
|
|
Date date = new Date((startTime + ts) * 1000);
|
|
|
|
|
Log.d(TAG, "Register Photo Time: " + date.toString() + " BaseTime=" + baseTime + " ts=" + ts + " startTime=" + startTime);
|
|
|
|
|
|
|
|
|
|
registerPhotoTimer(channel, preset, currentTs, (currentTs - baseTime) * 1000, schedules);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -151,7 +387,6 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
|
|
|
|
|
return START_NOT_STICKY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void connect() {
|
|
|
|
|
// after 10 seconds its connected
|
|
|
|
|
new android.os.Handler().postDelayed(
|
|
|
|
@ -273,8 +508,8 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
super.onDestroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String buildPhotoDir(int channel) {
|
|
|
|
|
File path = new File(Environment.getExternalStorageDirectory(), "com.xinyingpower.com/photos/");
|
|
|
|
|
public String buildPhotoDir(int channel) {
|
|
|
|
|
File path = new File(Environment.getExternalStorageDirectory(), "com.xyp.mp/photos/");
|
|
|
|
|
|
|
|
|
|
if (!path.exists() && !path.mkdirs()) {
|
|
|
|
|
return null;
|
|
|
|
@ -286,74 +521,22 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String buildPhotoFileName(int channel, int preset) {
|
|
|
|
|
private String buildPhotoFileName(int channel, int preset, long ts) {
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyymmddhhmmss");
|
|
|
|
|
String date = dateFormat.format(new Date());
|
|
|
|
|
String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
|
|
|
|
|
String photoFile = "img_" + Integer.toString(channel) + "_" + Integer.toHexString(preset).toUpperCase() + "_" + date + ".jpg";
|
|
|
|
|
return photoFile;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class AlarmReceiver extends BroadcastReceiver {
|
|
|
|
|
|
|
|
|
|
private MicroPhotoService mService;
|
|
|
|
|
public AlarmReceiver(MicroPhotoService service) {
|
|
|
|
|
mService = service;
|
|
|
|
|
}
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if(TextUtils.equals(ACTION_HEARTBEAT, action)){
|
|
|
|
|
Log.i(TAG, "receiver ACTION=" + action);
|
|
|
|
|
mService.registerHeartbeatTimer(mService.getHeartbeatDuration());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BroadcastReceiver receiver = new BroadcastReceiver() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
// 获取广播事件
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if(TextUtils.equals(ACTION_HEARTBEAT, action)){
|
|
|
|
|
Log.i(TAG, "receiver ACTION");
|
|
|
|
|
registerHeartbeatTimer(getHeartbeatDuration());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private void registerHeartbeatTimer(long timeout){
|
|
|
|
|
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
Intent alarmIntent = new Intent();
|
|
|
|
|
alarmIntent.setAction(ACTION_HEARTBEAT);
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + timeout, pendingIntent);
|
|
|
|
|
|
|
|
|
|
// alarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + timeout, pendingIntent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void registerPhotoTimer(long ts){
|
|
|
|
|
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
Intent alarmIntent = new Intent();
|
|
|
|
|
alarmIntent.setAction(ACTION_TAKE_PHOTO);
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, ts, pendingIntent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected native boolean init(String appPath, String ip, int port, String cmdid);
|
|
|
|
|
|
|
|
|
|
protected native long getHeartbeatDuration();
|
|
|
|
|
|
|
|
|
|
protected native boolean takePhoto(int channel, int preset, String path, String fileName);
|
|
|
|
|
protected native long[] getPhotoTimeData();
|
|
|
|
|
protected native boolean takePhoto(int channel, int preset, String path, String fileName, boolean sendToCma);
|
|
|
|
|
protected native boolean sendHeartbeat();
|
|
|
|
|
protected native boolean fireTimeout(long uid);
|
|
|
|
|
protected native boolean uninit();
|
|
|
|
|
|
|
|
|
|
protected long mHandler = 0;
|
|
|
|
|
|
|
|
|
|
private AlarmReceiver alarmReceiver = null;
|
|
|
|
|