Mobilock应用程序在BOOT_COMPLETED广播之前启动...怎么可能? [英] Mobilock app starts before BOOT_COMPLETED broadcast... How is it possible?

查看:124
本文介绍了Mobilock应用程序在BOOT_COMPLETED广播之前启动...怎么可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个名为Mobilock的信息亭应用。此应用程序的启动方式比我自己的以BOOT_COMPLETED广播开始的应用程序启动快(将近5秒)。

There is a kiosk app called Mobilock. This app starts way faster (Almost 5 seconds before) than my own app which starts with BOOT_COMPLETED broadcast.

我自己的应用程序具有最高优先级,即整数的最大值。因此,这与优先级无关。

My own app has the highest priority which is max value of integer. So this is not about the priority.

这些家伙找到了一种比BOOT_COMPLETED广播快5秒钟启动应用程序的方法。

These guys have found a way to start their application 5 second sooner than BOOT_COMPLETED broadcast.

有没有人得到

推荐答案

噢,天哪!我很幸运地找到了它。 :)

Oh my god! I've luckily found it. :)

此页面说:应用程序必须在系统上注册其组件,然后才能在直接启动模式下运行或访问设备加密的存储。应用程序通过将组件标记为支持加密来向系统注册。要将您的组件标记为加密感知,请在清单中将android:directBootAware属性设置为true。

This Page Says : Apps must register their components with the system before they can run during Direct Boot mode or access device encrypted storage. Apps register with the system by marking components as encryption aware. To mark your component as encryption aware, set the android:directBootAware attribute to true in your manifest.

加密感知组件可以注册以在以下情况下从系统接收ACTION_LOCKED_BOOT_COMPLETED广播消息:设备已重新启动。此时,设备已加密的存储可用,并且您的组件可以执行需要在直接启动模式下运行的任务,例如触发计划的警报。

Encryption aware components can register to receive a ACTION_LOCKED_BOOT_COMPLETED broadcast message from the system when the device has been restarted. At this point device encrypted storage is available, and your component can execute tasks that need to be run during Direct Boot mode, such as triggering a scheduled alarm.

您只需要放入


android:directBootAware = true

android:directBootAware="true"

因此清单中的代码是;

So the code in manifest is;

<receiver
  android:directBootAware="true" >
  ...
 <intent-filter>
  <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
 </intent-filter>
</receiver>

这篇关于Mobilock应用程序在BOOT_COMPLETED广播之前启动...怎么可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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