Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ public void onShown(IBinder windowToken) {
// (See Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR.)
int mIncallPowerBehavior;

// The volume key answer INT
int mAnswerVolumeBehavior;
// The volume key answer
int mVolumeAnswer;

// Behavior of HOME button during incomming call ring.
// (See Settings.Secure.RING_HOME_BUTTON_BEHAVIOR.)
Expand Down Expand Up @@ -791,6 +791,8 @@ void observe() {
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.NAVBAR_LEFT_IN_LANDSCAPE), false, this,
UserHandle.USER_ALL);
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.ANSWER_VOLUME_BUTTON_BEHAVIOR_ANSWER), false, this);
updateSettings();
}

Expand Down Expand Up @@ -1661,10 +1663,6 @@ public void updateSettings() {
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT,
UserHandle.USER_CURRENT);
mAnswerVolumeBehavior = Settings.Secure.getIntForUser(resolver,
Settings.Secure.ANSWER_VOLUME_BUTTON_BEHAVIOR,
Settings.Secure.ANSWER_VOLUME_BUTTON_BEHAVIOR_DEFAULT,
UserHandle.USER_CURRENT);
mRingHomeBehavior = Settings.Secure.getIntForUser(resolver,
Settings.Secure.RING_HOME_BUTTON_BEHAVIOR,
Settings.Secure.RING_HOME_BUTTON_BEHAVIOR_DEFAULT,
Expand All @@ -1689,6 +1687,8 @@ public void updateSettings() {
((mDeviceHardwareWakeKeys & KEY_MASK_VOLUME) != 0);
mVolBtnMusicControls = (Settings.System.getIntForUser(resolver,
Settings.System.VOLBTN_MUSIC_CONTROLS, 1, UserHandle.USER_CURRENT) == 1);
mVolumeAnswer = Settings.System.getIntForUser(resolver,
Settings.System.ANSWER_VOLUME_BUTTON_BEHAVIOR_ANSWER, 0, UserHandle.USER_CURRENT) == 1;

// Height of navigation bar buttons
int mNavButtonsHeight = Settings.System.getIntForUser(resolver,
Expand Down Expand Up @@ -5064,8 +5064,7 @@ public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) {
if (telecomManager != null) {
if (telecomManager.isRinging()) {
// The volume key answer
if ((mAnswerVolumeBehavior
& Settings.Secure.ANSWER_VOLUME_BUTTON_BEHAVIOR_ANSWER) != 0) {
if (mVolumeAnswer != 0) {
telecomManager.acceptRingingCall();
}
// If an incoming call is ringing, either VOLUME key means
Expand Down