Commit aaae0ae1 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Remove calls to silence ringer; these require new permissions in N

In N, only applications with permission to manage do-not-disturb
or notification settings are allowed to silence the ringer.

Requesting that permission is not straightforward, and may not be
the right solution, so for now, disable the ringer muting for video
recording.

Bug: 29591150
Change-Id: I630812c0e4ca813bf4fa123321d60a4be6c2fbf7
parent 9353cf10
......@@ -1323,25 +1323,14 @@ public class VideoModule extends CameraModule
// Store current ringer mode so we can set it once video recording is
// finished.
mOriginalRingerMode = mAudioManager.getRingerMode();
// Make sure no system sounds and vibrations happen during video
// recording.
try {
mAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
} catch (SecurityException e) {
Log.e(TAG, "Error: " + e);
}
// TODO: Use new DND APIs to properly silence device
}
private void restoreRingerMode() {
// First check if ringer mode was changed during the recording. If not,
// re-set the mode that was set before video recording started.
if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) {
// Set the original ringer mode back.
try {
mAudioManager.setRingerMode(mOriginalRingerMode);
} catch (SecurityException e) {
Log.e(TAG, "Error: " + e);
}
// TODO: Use new DND APIs to properly restore device notification/alarm settings
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment