2010-11-25 71 views
4

有沒有其他人在三星Galaxy S上體驗過這一點?Galaxy S上的揚聲器故障

當我使用如下因素來開啓揚聲器就可以正常工作:

audioManager.setSpeakerphoneOn(true); 

但是當我嘗試相反將其關閉:

audioManager.setSpeakerphoneOn(false); 

揚聲器停留在和音頻通過它而不是設備上的耳機播放。

上面的作品在Nexus One和HTC Hero上,剛拿到三星Galaxy並沒有工作,有人遇到過這個問題,也許知道它爲什麼會發生,如果有工作?

+0

是的,我也看到了,並沒有找到解決方案。 – dhaag23 2010-12-27 20:46:08

回答

4

這是我必須做的就是它的工作:

if (isGalaxyS()) { 
    audioManager.setMode(AudioManager.MODE_IN_CALL); 
    audioManager.setMode(AudioManager.MODE_NORMAL); 
    audioManager.setSpeakerphoneOn(flag); 
} 

看來,這來回不知何故復位音頻通道。爲了完整性,這裏是isGalaxyS()(注意,我只在Epic上測試了這個):

public static boolean isGalaxyS() { 
    String model = Build.MODEL; 
    return model.equalsIgnoreCase("GT-I9000") ||  // base model 
      model.equalsIgnoreCase("SPH-D700") ||  // Epic   (Sprint) 
      model.equalsIgnoreCase("SGH-I897") ||  // Captivate (AT&T) 
      model.equalsIgnoreCase("SGH-T959") ||  // Vibrant  (T-Mobile) 
      model.equalsIgnoreCase("SCH-I500") ||  // Fascinate (Verizon) 
      model.equalsIgnoreCase("SCH-I400");   // Continuum (T-Mobile) 
}