Android Camera ShutterSound customization

You can turn off your camera shutter sound according the steps if you can modify the code.If you have any good ideas ,please contact me.Thanks.

 

Platform version:4.0

Modify the CameraService.cpp via frameworks/base/services/camera/libcameraservice/ path.

You should find the function these:

       

1.mCameraService->playSound(SOUND_RECORDING)

2.mCameraService->playSound(SOUND_SHUTTER)

3.playRecordingSound()

 If your SDMID is Shutter_sound_enable, which is from your customization configuration file,you can get the property value of Shutter_sound_enable,like this:

        

         char value[PROPERTY_VALUE_MAX];

         property_get("Shutter_sound_enable",value,"0");

         if (strcmp(value,"true")==0){  //if the parameter have two values:true and false

                      //enable the shutter sound

         }

You should replace all of the 3 functions in the CameraService.cpp.

Then compile the module ,you will get the libcamearaservice.so file,and then push into the phone.

Restart your phone.

 

You can use the command:

adb shell setprop Shutter_sound_enable false  //set the property value

adb shell getprop Shutter_sound_enable           //get the property value


I have done the work.

Good luck.

你可能感兴趣的:(android,Camera,Camera,TURN,off,ShutterSound)