startBluetoothSco()引发安全异常(BROADCAST

我有一个由ICS用户发送的堆栈跟踪。

在我的Froyo设备上一切工作正常,但用户显然获得了AudioManager.startBluetoothSco()调用时的权限拒绝...我不知道为什么会发生这种情况 - 我知道ACTION_SCO_AUDIO_STATE_CHANGED的广播是粘性的,但它不是发送它的应用程序,所以它不应该需要权限...

以下是堆栈跟踪:

java.lang.SecurityException: Permission Denial: broadcastIntent() requesting a sticky 
broadcast from pid=15341, uid=10064 requires android.permission.BROADCAST_STICKY
at android.os.Parcel.readException(Parcel.java:1327)
at android.os.Parcel.readException(Parcel.java:1281)
at android.media.IAudioService$Stub$Proxy.startBluetoothSco(IAudioService.java:1090)
at android.media.AudioManager.startBluetoothSco(AudioManager.java:975)
at de.bulling.smstalk.libs.utils.AudioUtils.startBluetoothSco(AudioUtils.java:164)
at de.bulling.smstalk.Services.TTS.speakIt(TTS.java:151)
at de.bulling.smstalk.Services.TTS.onInit(TTS.java:83)
at android.speech.tts.TextToSpeech.dispatchOnInit(TextToSpeech.java:627)
at android.speech.tts.TextToSpeech.access$1000(TextToSpeech.java:52)
at android.speech.tts.TextToSpeech$Connection.onServiceConnected(TextToSpeech.java:1279)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

/编辑:我可以重现该问题,如果我使用START_STICKY启动服务,则无关紧要。


只有解决方法是将此权限添加到您的应用程序,以使其在ICS上工作..

<uses-permission android:name="android.permission.BROADCAST_STICKY"/>

OHAP在ICS中存在此缺陷的问题

链接地址: http://www.djcxy.com/p/56911.html

上一篇: startBluetoothSco() throws Security Exception (BROADCAST

下一篇: Yii Relational record with condition from other table