InputManagerService: Add Mic Mute switch support
Bug: 141192769 Test: Manual Change-Id: If90680250c38c019a2a3b3c106b6a53306e3400a Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
@@ -47,6 +47,7 @@ import android.hardware.input.InputManager;
|
||||
import android.hardware.input.InputManagerInternal;
|
||||
import android.hardware.input.KeyboardLayout;
|
||||
import android.hardware.input.TouchCalibration;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
@@ -1788,6 +1789,12 @@ public class InputManagerService extends IInputManager.Stub
|
||||
mHandler.obtainMessage(MSG_DELIVER_TABLET_MODE_CHANGED,
|
||||
args).sendToTarget();
|
||||
}
|
||||
|
||||
if ((switchMask & SW_MUTE_DEVICE_BIT) != 0) {
|
||||
final boolean micMute = ((switchValues & SW_MUTE_DEVICE_BIT) != 0);
|
||||
AudioManager audioManager = mContext.getSystemService(AudioManager.class);
|
||||
audioManager.setMicrophoneMuteFromSwitch(micMute);
|
||||
}
|
||||
}
|
||||
|
||||
// Native callback.
|
||||
|
||||
Reference in New Issue
Block a user