GO短信首要android.provider.Telephony.SMS_RECEIVED [英] Go SMS Pro overriding android.provider.Telephony.SMS_RECEIVED

查看:428
本文介绍了GO短信首要android.provider.Telephony.SMS_RECEIVED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,允许用户,因为他们收到转发的短信。早在一天,我有安卓优先在我的意图过滤器安卓.provider.Telephony.SMS_RECEIVED 设置为仅高于Android的默认消息应用程序。我这样做,这样用户可以转发信息,而无需清除它们在消息应用程序。然而,几个月后,GO短信发布他们的应用程序的更新与安卓优先价值极高,所以用户在安装该应用程序开始有问题。我更新了我的应用程序,让自己的优先级比GO短信的略高,一切都很好。现在,GO短信再次做到了,他们的安卓优先已采取到最高值,您可以分配。 2147483647上一个又一个的广播接收器和2147483640(是的,GO短信有两个广播接收器了)。

要解决这个问题,我想改变我的优先级最高,就像他们的,但不知何故,他们的应用程序不断美酒短信战斗,即使我们的重点是相同的。我读的地方,机器人具有相同优先级的两个应用程序之间做出选择时,它选择一个安装了最早的。我尝试安装GO短信我的应用程序后,却仍然一无所获。

什么是正确的方法来解决这个问题? ?优先值

:什么是他们在自己的应用程序,使他们获得短信广播在其他人之前,即使有相同的机器人做
解决方案
  

什么是正确的方法来解决这个问题?

修改您的应用程序的生存之后GO短信或任何其他应用程序正在运行。您可能还提醒用户,如果您发现应用程序具有相同或 - 更高的优先级(使用 PackageManager 此)监测相同的广播,让他们知道相应地配置这些应用程序。

想有更高的优先级比其他人是军备竞赛,在哪一个你最终会风,充其量,捆绑带相同的优先级。有序广播与捆绑优先级的行为是无证的,因此也没有保证行为。机器人 - 机器人或定制版本 - 欢迎修改决胜局算法。这种算法可能是从什么:

  • 按字母顺序排列的包名称

  • 命令,在散列集,其中所述散列密钥可以基于任何实测值(例如,对象ID)

  • 随机数发生器

由于无法可靠地赢,修改你的应用程序要尽可能的成功,当你确实丢失。

I have an app that allows users to forward SMS messages as they are received. Back in the day, I had the android:priority in my intent-filter for android.provider.Telephony.SMS_RECEIVED set to barely above Android's default messaging app. I did so, so that the user can forward the messages without having to clear them in the messaging app. However, a few months later, Go SMS Pro released an update of their app with a android:priority value extremely high, so users with that app installed started having issues. I updated my app so that my priority was slightly higher than Go SMS Pro's and everything went fine. Now Go SMS Pro did it again, their android:priority has been taken up to the max value you can assign. 2147483647 on one of their broadcast receivers and 2147483640 on another (yes, Go SMS Pro has two broadcast receivers now).

To fix this, I tried changing my priority to max just like theirs, but somehow their app keeps wining the SMS fight even though our priorities are the same. I read somewhere that Android when having to decide between two apps with the same priority, it chooses the one installed the earliest. I tried installing Go SMS Pro AFTER my app, but still nothing.

What's the proper way to fix this? What are they doing in their app that makes them get the SMS broadcast before anyone else, even with same android:priority values?

解决方案

What's the proper way to fix this?

Modify your app to survive being run after Go SMS Pro or any other app. You might also advise users if you detect apps monitoring the same broadcast with equal-or-higher priorities (use PackageManager for this), so they know to configure those apps accordingly.

Trying to have a higher priority than everyone else is an arms race, one in which you will eventually wind up, at best, tied with the same priority. The behavior of ordered broadcasts with tied priorities is undocumented, and therefore there is no guaranteed behavior. Android -- or customized versions of Android -- are welcome to modify the tie-breaker algorithm. That algorithm could be anything from:

  • alphabetical order by package name

  • order as found in a hashed collection, where the hash key could be based on anything (e.g., object ID)

  • random number generator

Since you cannot reliably "win", modify your app to be as successful as possible when you do indeed "lose".

这篇关于GO短信首要android.provider.Telephony.SMS_RECEIVED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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