diff options
author | cretin45 <cretin45@gmail.com> | 2015-03-12 16:07:55 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-03-21 16:29:25 -0700 |
commit | 3285b0da1e36ee49b85e61fc2b98711a405ebf45 (patch) | |
tree | 68b1eb0e056bf991aff7aa2c64a7bde165c32dee | |
parent | 71e3f1f605476f6c074dd66ff9fcf807a14255ee (diff) | |
download | packages_apps_InCallUI-3285b0da1e36ee49b85e61fc2b98711a405ebf45.tar.gz packages_apps_InCallUI-3285b0da1e36ee49b85e61fc2b98711a405ebf45.tar.bz2 packages_apps_InCallUI-3285b0da1e36ee49b85e61fc2b98711a405ebf45.zip |
InCallUI: Bring back vibrate on call waiting
Change-Id: I38f1d80ce4d29195b75df85b0fd0ab03371fbb5d
-rw-r--r-- | src/com/android/incallui/InCallVibrationHandler.java | 12 |
1 files changed, 12 insertions, 0 deletions
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(); |