Matthew 2 months ago
commit a9fd536a8a

@ -70,9 +70,9 @@
android:name="android.permission.TETHER_PRIVILEGED"
tools:ignore="ProtectedPermissions" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="com.mediatek.camera.feature.mfnr" />
<uses-permission android:name="android.hardware.usb.accessory" />
<queries>
@ -206,7 +206,10 @@
<data android:scheme="package" />
</intent-filter>
</receiver>
<receiver
android:name=".HeartBeatResponseReceiver"
android:enabled="true"
android:exported="true"></receiver>
<activity
android:name=".MainActivity"
android:exported="true"

@ -0,0 +1,16 @@
package com.xypower.mpapp;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class HeartBeatResponseReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if ("heartbeat".equals(action)) {
MicroPhotoService.infoLog("收到heartbeat广播");
}
}
}

@ -500,6 +500,12 @@ public class MicroPhotoService extends Service {
} catch (Exception ex) {
ex.printStackTrace();
}
Intent responseIntent = new Intent("com.systemui.ACTION_HEARTBEAT_RESPONSE");
responseIntent.putExtra("timestamp",System.currentTimeMillis());
context.sendBroadcast(responseIntent);
} else if (TextUtils.equals(ACTION_TAKE_PHOTO, action)) {
long ts = intent.getLongExtra(EXTRA_PARAM_TIME, 0);
int cnt = intent.getIntExtra(EXTRA_PARAM_SCHEDULES, 0);

Loading…
Cancel
Save