android 電話呼入時 按音量鍵

來源:互聯網
上載者:User

平台:S5PC110 S5PV210

系統:android2.3   android2.3.4 android電話呼入時,電話鈴音提示,按音量加/減鍵、power鍵時,鈴音沒了。bug list 上又多了這一個BUG。(首先說明這個問題不用解,android就這樣做的) 1,核心程式分析,在音頻解碼晶片裡列印出的資訊是,音頻關掉了。[  431.795859] rt5625:enterrt5625_hifi_pcm_shutdown

2,再看一下 logcat發現有點不對。貌似就正常關閉呀。I/WindowManager(   90): interceptKeyBeforeQueueing: VOLUME key-down while ringing:
Silence ringer!
I/WindowManager(   90): interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!
I/WindowManager(   90): interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!
[  306.485911] rt5625:enter rt5625_hifi_pcm_shutdown
D/AudioHardware(   67): AudioHardware pcm playback is going to standby.
V/AudioHardware(   67): closeMixer_l() mMixerOpenCnt: 1
D/AudioHardware(   67): closePcmOut_l() mPcmOpenCnt: 1
I/WindowManager(   90): interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!
I/WindowManager(   90): interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!

3,看下關於 呼入電話 鈴音 與  按鍵的關係吧。在android2.3.4_GB_T34H\frameworks\base\policy\src\com\android\internal\policy\impl\PhoneWindowManager.java中
// Handle special keys. switch (keyCode) {   case KeyEvent.KEYCODE_VOLUME_DOWN:   case KeyEvent.KEYCODE_VOLUME_UP: {   if (down) {       ITelephony telephonyService = getTelephonyService();       if (telephonyService != null) {       try {         if (telephonyService.isRinging()) {         // If an incoming call is ringing, either VOLUME key means         // "silence ringer".  We handle these keys here, rather than         // in the InCallScreen, to make sure we'll respond to them         // even if the InCallScreen hasn't come to the foreground yet.         // Look for the DOWN event here, to agree with the "fallback"         // behavior in the InCallScreen.         Log.i(TAG, "interceptKeyBeforeQueueing:"                + " VOLUME key-down while ringing: Silence ringer!");         // Silence the ringer.  (It's safe to call this         // even if the ringer has already been silenced.)               telephonyService.silenceRinger();//這裡就是鈴音沒有的原因了         // And *don't* pass this key thru to the current activity         // (which is probably the InCallScreen.)                result &= ~ACTION_PASS_TO_USER;                break;               }          if (telephonyService.isOffhook()                  && (result & ACTION_PASS_TO_USER) == 0) {           // If we are in call but we decided not to pass the key to           // the application, handle the volume change here.                 handleVolumeKey(AudioManager.STREAM_VOICE_CALL, keyCode);                      break;             }          } catch (RemoteException ex) {             Log.w(TAG, "ITelephony threw RemoteException", ex);                  }                }                    if (isMusicActive() && (result & ACTION_PASS_TO_USER) == 0) {                        // If music is playing but we decided not to pass the key to the                        // application, handle the volume change here.                        handleVolumeKey(AudioManager.STREAM_MUSIC, keyCode);         break;         }        }   break; }
4,找幾台機器驗證一下吧在同事那裡找了幾部手機,三星、LG、HTC、P1000,試了一下,都是這樣。那就是正常現象了,白折騰了一段時間,看了半天代碼。
當你的BUG List上有這個問題讓你去解的時候,跟別人說這是正常的,android系統本來就這樣做的。如果不是做什麼特別的“ 客制化”,這就是正常的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.