* PhoneWindow will implement this part. */ public static final int PLAY_SOUND_DELAY = 300; /** * Constant to identify a focus stack entry that is used to hold the focus while the phone * is ringing or during a call. Used by com.android.internal.telephony.CallManager when * entering and exiting calls. */ public final static String IN_VOICE_COMM_FOCUS_ID = "AudioFocus_For_Phone_Ring_And_Calls"; /** * @see AudioManager#setVibrateSetting(int, int) */ public static int getValueForVibrateSetting(int existingValue, int vibrateType, int vibrateSetting) { // First clear the existing setting. Each vibrate type has two bits in // the value. Note '3' is '11' in binary. existingValue &= ~(3 << (vibrateType * 2)); // Set into the old value existingValue |= (vibrateSetting & 3) << (vibrateType * 2); return existingValue; } public static int getDefaultStreamVolume(int streamType) { return DEFAULT_STREAM_VOLUME[streamType]; } public static int[] DEFAULT_STREAM_VOLUME = new int[] { 4, // STREAM_VOICE_CALL 7, // STREAM_SYSTEM 5, // STREAM_RING 11, // STREAM_MUSIC 6, // STREAM_ALARM 5, // STREAM_NOTIFICATION 7, // STREAM_BLUETOOTH_SCO 7, // STREAM_SYSTEM_ENFORCED 11, // STREAM_DTMF 11 // STREAM_TTS }; public static String streamToString(int stream) { if (stream >= 0 && stream < STREAM_NAMES.length) return STREAM_NAMES[stream]; if (stream == AudioManager.USE_DEFAULT_STREAM_TYPE) return "USE_DEFAULT_STREAM_TYPE"; return "UNKNOWN_STREAM_" + stream; } /** The platform has no specific capabilities */ public static final int PLATFORM_DEFAULT = 0; /** The platform is voice call capable (a phone) */ public static final int PLATFORM_VOICE = 1; /** The platform is a television or a set-top box */ public static final int PLATFORM_TELEVISION = 2; /** * Return the platform type that this is running on. One of: *