几分钟后 AltBeacon 应用程序重新启动 [英] AltBeacon App restarts after some minutes

查看:123
本文介绍了几分钟后 AltBeacon 应用程序重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用存在一些问题.在我禁用 regionBootstrap 并通过 System.exit(0) 关闭应用程序后,我的应用程序在几分钟(通常是 3-4 分钟)后重新启动.

I have some problems in my app. I have that after I disable the regionBootstrap and close the app through System.exit(0), my app after some minutes (usually 3-4 minutes) restarts itself.

这是我每次应用重新启动时发现的 Logcat 行:

This are the Logcat lines that I found everytime my app restarts:

2018-11-24 14:54:34.883 897-1339/? V/AlarmManager: Triggering alarm #1: 2 when =969099760 package =walkenrollment.com.acc operation =*walarm*:walkenrollment.com.acc/org.altbeacon.beacon.startup.StartupBroadcastReceiver flags =0x0
2018-11-24 14:54:34.941 897-1136/? I/ActivityManager: Start proc 11637:walkenrollment.com.acc/u0a181 for broadcast walkenrollment.com.acc/org.altbeacon.beacon.startup.StartupBroadcastReceiver
2018-11-24 14:54:35.037 897-11631/? D/OnePlusSmartBoostManager: writeHotCount walkenrollment.com.acc, pid=11637
2018-11-24 14:54:35.107 11637-11637/walkenrollment.com.acc I/ollment.com.ac: The ClassLoaderContext is a special shared library.
2018-11-24 14:54:35.210 11637-11637/walkenrollment.com.acc W/ollment.com.ac: JIT profile information will not be recorded: profile file does not exits.
2018-11-24 14:54:35.211 11637-11637/walkenrollment.com.acc I/chatty: uid=10181(walkenrollment.com.acc) identical 10 lines
2018-11-24 14:54:35.212 11637-11637/walkenrollment.com.acc W/ollment.com.ac: JIT profile information will not be recorded: profile file does not exits.
2018-11-24 14:54:35.219 11637-11637/walkenrollment.com.acc I/Perf: Connecting to perf service.
2018-11-24 14:54:35.207 11637-11637/walkenrollment.com.acc W/ollment.com.acc: type=1400 audit(0.0:2234740): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=17676 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2018-11-24 14:54:35.207 11637-11637/walkenrollment.com.acc W/ollment.com.acc: type=1400 audit(0.0:2234741): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=17676 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2018-11-24 14:54:35.222 11637-11637/walkenrollment.com.acc E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2018-11-24 14:54:35.222 11637-11637/walkenrollment.com.acc E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2018-11-24 14:54:35.233 11637-11637/walkenrollment.com.acc I/InstantRun: starting instant run server: is main process
2018-11-24 14:54:35.235 11637-11637/walkenrollment.com.acc V/Font: Change font:2
2018-11-24 14:54:35.242 11637-11637/walkenrollment.com.acc I/BeaconManager: BeaconManager started up on pid 11637 named 'walkenrollment.com.acc' for application package 'walkenrollment.com.acc'.  isMainProcess=true
2018-11-24 14:54:35.245 11637-11637/walkenrollment.com.acc D/BeaconParser:          Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2018-11-24 14:54:35.246 11637-11637/walkenrollment.com.acc D/BeaconParser: Parsing beacon layout: m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24
2018-11-24 14:54:35.247 11637-11637/walkenrollment.com.acc D/BeaconParser: Parsing beacon layout: x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15

可能是什么原因?OnePlusSmartBoostManager 是问题的根源吗?如何避免我的应用以这种方式重新启动?

What could be the cause? Is the OnePlusSmartBoostManager the root of the problem? How can I avoid that my app restarts in this way?

这些是重启前几分钟 logcat 中的其他行:

These are other lines from logcat few minutes before the restart:

2018-11-24 14:48:40.989 897-2922/? I/ActivityManager: Process walkenrollment.com.acc (pid 11211) has died: fore RCVR
2018-11-24 14:48:40.991 897-912/? I/WindowManager: WIN DEATH: Window{b786f1c u0 walkenrollment.com.acc/walkenrollment.com.acc.MainActivity}
2018-11-24 14:48:40.991 897-912/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'b786f1c walkenrollment.com.acc/walkenrollment.com.acc.MainActivity (server)'
2018-11-24 14:51:30.213 897-1132/? D/RestartProcessManager: updateSelf :  walkenrollment.com.acc, size : 30
2018-11-24 14:51:30.214 897-1132/? D/RestartProcessManager: walkenrollment.com.acc got score 0.45182973997082543 in DayDuration for duration : 16565
2018-11-24 14:51:30.214 897-1132/? D/RestartProcessManager: walkenrollment.com.acc got score 100.0 in DayLRU for LRU diff : 49716982
2018-11-24 14:51:30.214 897-1132/? D/RestartProcessManager: walkenrollment.com.acc got score 33.33333333333333 in DayLaunchTimes for launch times : 5
2018-11-24 14:51:30.215 897-1132/? D/RestartProcessManager: walkenrollment.com.acc : X : 11871.538678708397, Y : 3274.222404673991, Z : 23827.1189741647

推荐答案

我通过在禁用监控功能中添加以下内容解决了这个问题.

I solved this issue by adding the following to my disable monitoring function.

// Disables alarm manager
mBeaconManager.setBackgroundMode(false);

if (mRegionBootstrap != null) {
    mRegionBootstrap.disable();
    mRegionBootstrap = null;
}

当我启用监控时,我将其重新设置为 true.

And when I enable the monitoring I set it back to true.

mBeaconManager.setBackgroundMode(true);

所以我的退出函数如下:

So my exit function is the following:

// Disables monitoring
mBeaconScannerServiceManager.disableMonitoring();

// Closes UI
finishAffinity();

// Destroys app completely after it had time to turn off services correctly
mContainerView.postDelayed(() -> System.exit(0), 2000);

这篇关于几分钟后 AltBeacon 应用程序重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆