From 3285b0da1e36ee49b85e61fc2b98711a405ebf45 Mon Sep 17 00:00:00 2001 From: cretin45 Date: Thu, 12 Mar 2015 16:07:55 -0700 Subject: InCallUI: Bring back vibrate on call waiting Change-Id: I38f1d80ce4d29195b75df85b0fd0ab03371fbb5d --- src/com/android/incallui/InCallVibrationHandler.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/android/incallui/InCallVibrationHandler.java b/src/com/android/incallui/InCallVibrationHandler.java index 42845df7..20722a8c 100644 --- a/src/com/android/incallui/InCallVibrationHandler.java +++ b/src/com/android/incallui/InCallVibrationHandler.java @@ -31,6 +31,7 @@ public class InCallVibrationHandler extends Handler implements private static final int MSG_VIBRATE_45_SEC = 1; + private static final String KEY_VIBRATE_CALL_WAITING = "incall_vibrate_call_waiting"; private static final String KEY_VIBRATE_OUTGOING = "incall_vibrate_outgoing"; private static final String KEY_VIBRATE_45SECS = "incall_vibrate_45secs"; private static final String KEY_VIBRATE_HANGUP = "incall_vibrate_hangup"; @@ -64,6 +65,10 @@ public class InCallVibrationHandler extends Handler implements handleOutgoingCallVibration(activeCall); } mActiveCall = activeCall; + } else if (activeCall != null && callList.getIncomingCall() != null + && !callList.getIncomingCall().equals(activeCall)) { + Log.d(this, "New incoming call" + callList.getIncomingCall()); + handleCallWaitingVibration(activeCall); } else if (activeCall == null && mActiveCall != null) { Log.d(this, "Transition from active call " + mActiveCall); handleCallEnd(mActiveCall); @@ -83,6 +88,13 @@ public class InCallVibrationHandler extends Handler implements } } + private void handleCallWaitingVibration(Call call) { + Log.d(this, "Start call waiting vibration"); + if (mPrefs.getBoolean(KEY_VIBRATE_CALL_WAITING, false)) { + vibrate(200, 300, 500); + } + } + private void handleCallEnd(Call call) { long durationMillis = System.currentTimeMillis() - call.getConnectTimeMillis(); DisconnectCause cause = call.getDisconnectCause(); -- cgit v1.2.3