完成摘要事件监控小部件
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Feb 15 04:45:53 GMT 2025
|
||||
#Sat Feb 15 11:51:34 GMT 2025
|
||||
stageCount=2
|
||||
libraryProject=libappbase
|
||||
baseVersion=1.5
|
||||
publishVersion=1.5.1
|
||||
buildCount=97
|
||||
buildCount=123
|
||||
baseBetaVersion=1.5.2
|
||||
|
@@ -7,7 +7,6 @@ package cc.winboll.studio.libappbase;
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
public class SOS {
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package cc.winboll.studio.libappbase.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
@@ -12,19 +13,38 @@ import cc.winboll.studio.libappbase.WinBoll;
|
||||
* @Describe WinBollReceiver
|
||||
*/
|
||||
public class WinBollReceiver extends BroadcastReceiver {
|
||||
|
||||
|
||||
public static final String TAG = "WinBollReceiver";
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if(action.equals(WinBoll.ACTION_SOS)) {
|
||||
if (action.equals(WinBoll.ACTION_SOS)) {
|
||||
LogUtils.d(TAG, String.format("context.getPackageName() %s", context.getPackageName()));
|
||||
LogUtils.d(TAG, String.format("action %s", action));
|
||||
String sos = intent.getStringExtra("sos");
|
||||
LogUtils.d(TAG, String.format("sos %s", sos));
|
||||
if (sos != null && sos.equals("SOS")) {
|
||||
String sosCalssType = intent.getStringExtra("sosCalssType");
|
||||
LogUtils.d(TAG, String.format("sosCalssType %s", sosCalssType));
|
||||
if (sosCalssType != null && sosCalssType.equals("Service")) {
|
||||
String sosPackage = intent.getStringExtra("sosPackage");
|
||||
LogUtils.d(TAG, String.format("sosPackage %s", sosPackage));
|
||||
|
||||
String sosClassName = intent.getStringExtra("sosClassName");
|
||||
LogUtils.d(TAG, String.format("sosClassName %s", sosClassName));
|
||||
|
||||
Intent intentService = new Intent();
|
||||
intentService.setComponent(new ComponentName(sosPackage, sosClassName));
|
||||
context.startService(intentService);
|
||||
LogUtils.d(TAG, String.format("context.startService(intentService);"));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
LogUtils.d(TAG, String.format("action %s", action));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user