fix: 增加添加到白名单功能
This commit is contained in:
parent
7a83b510e9
commit
89b6c8e01d
@ -230,4 +230,6 @@ dependencies {
|
||||
implementation 'com.tencent.jg:jg:1.1'
|
||||
//推送保活库
|
||||
implementation 'com.github.xuexiangjys.XPush:keeplive:1.0.0'
|
||||
// Android应用白名单添加 https://github.com/WaseemSabir/BatteryPermissionHelper
|
||||
implementation 'com.waseemsabir:betterypermissionhelper:1.0.3'
|
||||
}
|
@ -52,6 +52,7 @@ import com.teprinciple.mailsender.Mail;
|
||||
import com.teprinciple.mailsender.MailSender;
|
||||
import com.umeng.message.UmengNotificationClickHandler;
|
||||
import com.umeng.message.entity.UMessage;
|
||||
import com.waseemsabir.betterypermissionhelper.BatteryPermissionHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -114,6 +115,11 @@ public class HomeActivity extends BaseActivity {
|
||||
getLifecycle().addObserver(LocationLifeCycle.getInstance());
|
||||
// 初始化图像识别组件
|
||||
OCRManager.Companion.getInstance().init(HomeActivity.this);
|
||||
// 开始申请后台运行的权限
|
||||
boolean isOpenBatteryPermission = BatteryPermissionHelper.Companion.getInstance().isBatterySaverPermissionAvailable(HomeActivity.this, true);
|
||||
if (!isOpenBatteryPermission) {
|
||||
BatteryPermissionHelper.Companion.getInstance().getPermission(HomeActivity.this, true, true);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class KeepLiveUtils {
|
||||
@Override
|
||||
public void onNotificationClick(Context context, Intent intent) {
|
||||
//可以做一些唤醒程序的操作,这里只是简单地启动了应用
|
||||
AppUtils.launchApp(application.getPackageName());
|
||||
// AppUtils.launchApp(application.getPackageName());
|
||||
}
|
||||
})
|
||||
//要想不显示通知,可以设置为false,默认是false
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
ext.anko_version = '0.10.1'//扩展库版本
|
||||
ext.kotlin_version = '1.5.10'
|
||||
ext.kotlin_version = '1.7.10'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
//友盟 检测bug
|
||||
|
Loading…
x
Reference in New Issue
Block a user