从 Motorola Milestone 上的 Android 服务调用的 ACTION_CALL 意图挂起拨入活动

发布于 2024-09-08 16:28:17 字数 2428 浏览 2 评论 0原文

我的服务中的 ACTION_CALL 意图有问题 摩托罗拉 Milestone 升级至 2.1 - update1 固件版本后。 我有一个非常简单的(之前工作过的)代码。

Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel://" 
+ dialOutNumber)); 
dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
startActivity(dialIntent); 

现在看起来 InCallScreen 在设置音频模式后“挂断”或 ActivityManager“阻止”InCallScreen 活动 电话确实打来了,但屏幕是黑的并且被锁定。 如果我从活动中调用 ACTION_CALL 意图,它就可以正常工作。 这是日志:

<p>07-01 00:42:39.617: INFO/ActivityManager(1282): Starting activity: 
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10000000 
cmp=com.android.phone/.OutgoingCallBroadcaster } 
07-01 00:42:39.664: DEBUG/PhoneUtils(6381): 
checkAndCopyPhoneProviderExtras: some or all extras are missing. 
... 
07-01 00:42:40.679: DEBUG/InCallScreen(6381): placeCall()...  intent = 
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10800000 
cmp=com.android.phone/.InCallScreen (has extras) } 
07-01 00:42:40.679: DEBUG/InCallScreen(6381): 
checkIfOkToInitiateOutgoingCall: ServiceState = 0 
07-01 00:42:40.679: DEBUG/PhoneUtils(6381): placeCall: '5247519'... 
... 
07-01 00:42:40.710: DEBUG/PhoneUtils(6381): ===> phone.dial() 
returned:  incoming: false state: DIALING post dial state: NOT_STARTED 
07-01 00:42:40.710: DEBUG/PhoneUtils(6381): 
setAudioMode(MODE_IN_CALL)... 
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): 
AudioMgr:setMode(IN_CALL) 
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): AudioMgr:setMode 
MODE_IN_CALL 
07-01 00:42:40.710: INFO/MYPhoneService(6437): Telephony OFFHOOK 
... 
Here the screen is black and locked ~ 3 min. Only status panel 
available. Call ends. After some timeout see InCallScreen... If start 
from the Activity - the InCallScreen apears right after call start. 
... 
07-01 00:45:14.031: DEBUG/InCallScreen(6381): placeCall: 
PhoneUtils.placeCall() succeeded for regular call '5247519'. 
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): closeDialer()... 
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): clearDigits()... 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: 
state = OFFHOOK 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: 
lock already released. 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): isInDockMode bInDockMode 
is : false 
07-01 00:45:14.039: DEBUG/StatusBar(1282): DISABLE_EXPAND: yes </p>

我可以发送完整的日志,但它真的很大。 提前致谢。

I have a problem with ACTION_CALL intent from my service on
Motorola Milestone after upgrade to 2.1 - update1 firmware version.
I have a very simple (worked before) code.

Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel://" 
+ dialOutNumber)); 
dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
startActivity(dialIntent); 

Now it looks like InCallScreen "hangs up" after set audio mode or
ActivityManager "blocks" InCallScreen activity
The phone does call, but the screen is black and locked.
If I call ACTION_CALL intent from an activity it works all right.
Here is the log:

<p>07-01 00:42:39.617: INFO/ActivityManager(1282): Starting activity: 
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10000000 
cmp=com.android.phone/.OutgoingCallBroadcaster } 
07-01 00:42:39.664: DEBUG/PhoneUtils(6381): 
checkAndCopyPhoneProviderExtras: some or all extras are missing. 
... 
07-01 00:42:40.679: DEBUG/InCallScreen(6381): placeCall()...  intent = 
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x10800000 
cmp=com.android.phone/.InCallScreen (has extras) } 
07-01 00:42:40.679: DEBUG/InCallScreen(6381): 
checkIfOkToInitiateOutgoingCall: ServiceState = 0 
07-01 00:42:40.679: DEBUG/PhoneUtils(6381): placeCall: '5247519'... 
... 
07-01 00:42:40.710: DEBUG/PhoneUtils(6381): ===> phone.dial() 
returned:  incoming: false state: DIALING post dial state: NOT_STARTED 
07-01 00:42:40.710: DEBUG/PhoneUtils(6381): 
setAudioMode(MODE_IN_CALL)... 
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): 
AudioMgr:setMode(IN_CALL) 
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): AudioMgr:setMode 
MODE_IN_CALL 
07-01 00:42:40.710: INFO/MYPhoneService(6437): Telephony OFFHOOK 
... 
Here the screen is black and locked ~ 3 min. Only status panel 
available. Call ends. After some timeout see InCallScreen... If start 
from the Activity - the InCallScreen apears right after call start. 
... 
07-01 00:45:14.031: DEBUG/InCallScreen(6381): placeCall: 
PhoneUtils.placeCall() succeeded for regular call '5247519'. 
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): closeDialer()... 
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): clearDigits()... 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: 
state = OFFHOOK 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode: 
lock already released. 
07-01 00:45:14.031: DEBUG/PhoneApp(6381): isInDockMode bInDockMode 
is : false 
07-01 00:45:14.039: DEBUG/StatusBar(1282): DISABLE_EXPAND: yes </p>

I can send full log, but it is really big.
Thanks, in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的笑 2024-09-15 16:28:17

也许你应该这样调用:
Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + dialOutNumber));

删除“//”。

看看你的日志,
DEBUG/PhoneUtils(6381): checkAndCopyPhoneProviderExtras: 缺少部分或全部额外内容,也就是说 PhoneUtils 在解析 URI 时遇到错误。我检查了 URI,发现 URI 只解析四种方案,即 'tel:' 和 'voicemail:' 和 'contact:' 和 'spi' 。

问候!

Maybe you should call like this:
Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + dialOutNumber));

delete the "//".

Look at your log,
DEBUG/PhoneUtils(6381): checkAndCopyPhoneProviderExtras: some or all extras are missing,that's to say PhoneUtils run into error when parse the URI. I check the URI,and find out the URI only parse four scheme,it's 'tel:' and 'voicemail:' and 'contact:' and 'spi' .

Regards!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文