Android - In call volume root modify

This approach achieves desired functionality by communicating with Android APIs at AIDL level making use of ADB


Run the command:

adb shell service call audio 7 i32 3 i32 0 i32 1

Here, the service call refers to IAudioService. Click here for more info.

  • 7 is the function named setStreamVolume. It is the 7th in the list of functions in the interface IAudioService. Verify it here. (setStreamVolume takes 3 parameters streamType, index, flag)
  • i32 is to write the integer INT into the send parcel. (Alternatively we can make use of s16 for UTF-16 string)
  • 3 is streamTypevalue. (Value 1 → phone, 3 → speaker, 4 → alarm, 6 → bluetooth)
  • 0 is index value and 1 is flag value

See the source here.