我可以在Android上阻止来电而不禁用蓝牙 - 即DND(请勿打扰)模式

Whi*_*eve 5 android

我试着在Android开发者列表上发布这个并没有听到任何声音 - 也许你们中的一些人对此有所了解!

I'm working on an app that should have the ability to disable incoming calls for a user-specified period of time. It should work much the way a "DND" (do not disturb) button works on an office phone.

I've looked over the SDK, and I can't find any way to send phone calls to voicemail or disable the big incoming call screen without putting the phone in airplane mode. That would be OK if I could keep Bluetooth enabled. (I'd like the user to be able to listen to music via a Bluetooth headset while phone calls are blocked.)

In summary, any of the following would work if I could do them from my app:

  1. Programmatically send all calls to voicemail (like a "DND" button) this would be ideal since it would still be in the call log at the end of the "do not disturb" time.
  2. Intercept the incoming call in my app and bounce it.
  3. Disable all radios but Bluetooth and Wi-Fi - This has the disadvantage of losing the call log.
  4. Prevent the built-in phone call app from displaying its incoming call screen (I can disable the ringer and vibration) even though the call is received

Is any of these possible? Or maybe another approach I haven't thought of?

Just a side note: For Android phones to be the best possible productivity tool, it should be possible to use a device for email/Internet/apps without receiving constant interruptions from calls. Humans have a significant context-switch time.

WeN*_*igh 0

作为安全措施,SDK 不提供处理来电的 API。除了切断网络无线电并进入半飞行模式(选项 3)之外,恕我直言,我不知道这怎么可能。