从 Motorola Milestone 上的 Android 服务调用的 ACTION_CALL 意图挂起拨入活动
我的服务中的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许你应该这样调用:
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!