| | |
| | | private Speaker speaker = null; |
| | | private boolean ttsInitSucc = false; |
| | | private int ringIndex = -1; |
| | | private Uri ringUri; |
| | | private Uri ringUri = null; |
| | | |
| | | private Upgrade upgrade = null; |
| | | |
| | |
| | | upgrade = Upgrade.getInstance(getApplicationContext()); |
| | | upgrade.CheckUpgrade(); |
| | | |
| | | ringUri = GetRingIndex(this, "Mira"); |
| | | PlayRing(this, ringUri); |
| | | ringUri = GetRingIndex(this, "Antimony"); |
| | | // PlayRing(this, ringUri); |
| | | LimitMaxMinVolume(); |
| | | |
| | | Log.d(TAG, "基带版本 " + getBaseband_Ver()); |
| | | |
| | | String ver = getBaseband_Ver(); |
| | | } |
| | | |
| | | private void LimitMaxMinVolume() { |
| | | AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); |
| | | if (audioManager != null) { |
| | | int currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_RING); |
| | | int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_RING); |
| | | Log.d(TAG, String.format("Ring音量 = %d Max = %d", currentVolume, maxVolume)); |
| | | |
| | | if (currentVolume < maxVolume - 1) { |
| | | Log.d(TAG, "调至默认Ring音量"); |
| | | audioManager.setStreamVolume(AudioManager.STREAM_RING, maxVolume - 1, 0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public String getBaseband_Ver(){ |
| | |
| | | return null; |
| | | } |
| | | |
| | | public void PlayBreakRing() { |
| | | if (ringUri != null) { |
| | | PlayRing(this, ringUri); |
| | | } |
| | | } |
| | | |
| | | public void TextSpeak(String text, int id) { |
| | | if (speaker != null && ttsInitSucc) { |
| | | speaker.speak(text, Integer.toString(id)); |