没有办法知道,如果设备从FASTBOOT启动? [英] Any way to know if Device booted from a fastboot?

查看:194
本文介绍了没有办法知道,如果设备从FASTBOOT启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从HTC开始使用Fastboot方法的设置,应用程序依赖于

Ever since HTC started using Fastboot settings, apps depending on

android.intent.action.BOOT_COMPLETED

奋斗启动以及关于HTC设备的设备开机。我有一个类似的应用程序,它依赖于上述意图动作。但由于HTC做它的关闭电源功能和对不同使用FASTBOOT(用其他条款 - 休眠)我的应用程序永远不会正常工作。 我尝试使用 ACTION_USER_ preSENT ACTION_SCREEN_ON ,但它似乎比修复更劈我的问题。 你们当中有没有遇到同样的问题,并找到了一个更好的方式来处理呢?请帮忙。 SKU

struggle to boot along with the device boot on HTC devices. I have a similar application which depends on the above intent action. But since HTC does its power off and power on differently by using fastboot(other term used - Hibernation) my App never get to work normally. I tried using ACTION_USER_PRESENT and ACTION_SCREEN_ON, but it seemed to be more of hack than a fix for my problem. Do any of you came across same kind of problem and found a better way to deal with it? Please help. SKU

推荐答案

我发现,HTC在Fastboot方法电源开启和关闭电源使用意图的行动。我认为它分享在这里,因为它可能是为别人谁正面临着同样的问题,因为我是有用的。

I found the intent action that HTC uses during Fastboot Power On and Power Off. I thought of sharing it here as it may be useful for someone else who is facing same problem as me.

下面是你需要在你的接收机在AndroidManifest.xml中注册的意图行动。

Here is the intent action you need to register in AndroidManifest.xml under your Receiver.

<receiver android:name="com.my.app.MyReceiver">
     <intent-filter>
         <action android:name="android.intent.action.BOOT_COMPLETED"/>
         <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
     </intent-filter>
</receiver>

希望这是有帮助的。

Hope it was helpful

这篇关于没有办法知道,如果设备从FASTBOOT启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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