Android 8.1 屏蔽相机拍照快门声

Android 8.1 屏蔽相机拍照快门声

近来收到项目反馈,想要屏蔽掉相机拍照时的快门声音,具体修改参照如下:

/frameworks/av/services/camera/libcameraservice/CameraService.cpp

void CameraService::loadSoundImp() {
    LOG1("[CameraService::loadSoundImp] E");
-    mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
    mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
    mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg");
    LOG1("[CameraService::loadSoundImp] X");
}

重新编译验证,修改生效,相机拍照快门声已屏蔽

你可能感兴趣的:(framework,Android,Camera2,android)