Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4276,6 +4276,9 @@ <!-- URI for in call notification sound --> <string translatable="false" name="config_inCallNotificationSound">/product/media/audio/ui/InCallNotification.ogg</string> <!-- URI for camera shutter sound --> <string translatable="false" name="config_cameraShutterSound">/product/media/audio/ui/camera_click.ogg</string> <!-- URI for default ringtone sound file to be used for silent ringer vibration --> <string translatable="false" name="config_defaultRingtoneVibrationSound"></string> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3749,6 +3749,7 @@ <java-symbol type="bool" name="config_handleVolumeAliasesUsingVolumeGroups" /> <java-symbol type="dimen" name="config_inCallNotificationVolume" /> <java-symbol type="string" name="config_inCallNotificationSound" /> <java-symbol type="string" name="config_cameraShutterSound" /> <java-symbol type="integer" name="config_autoGroupAtCount" /> <java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" /> <java-symbol type="bool" name="config_dozeAlwaysOnEnabled" /> Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +21 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import android.graphics.Bitmap; import android.graphics.Insets; import android.graphics.Rect; import android.hardware.display.DisplayManager; import android.media.MediaActionSound; import android.media.AudioAttributes; import android.media.AudioSystem; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -93,6 +95,7 @@ import com.android.systemui.screenshot.TakeScreenshotService.RequestCallback; import com.google.common.util.concurrent.ListenableFuture; import java.io.File; import java.util.List; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; Loading Loading @@ -248,7 +251,7 @@ public class ScreenshotController { private final WindowManager mWindowManager; private final WindowManager.LayoutParams mWindowLayoutParams; private final AccessibilityManager mAccessibilityManager; private final MediaActionSound mCameraSound; private final MediaPlayer mCameraSound; private final ScrollCaptureClient mScrollCaptureClient; private final PhoneWindow mWindow; private final DisplayManager mDisplayManager; Loading Loading @@ -331,8 +334,13 @@ public class ScreenshotController { reloadAssets(); // Setup the Camera shutter sound mCameraSound = new MediaActionSound(); mCameraSound.load(MediaActionSound.SHUTTER_CLICK); mCameraSound = MediaPlayer.create(mContext, Uri.fromFile(new File(mContext.getResources().getString( com.android.internal.R.string.config_cameraShutterSound))), null, new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .build(), AudioSystem.newAudioSessionId()); mCopyBroadcastReceiver = new BroadcastReceiver() { @Override Loading Loading @@ -430,7 +438,9 @@ public class ScreenshotController { void releaseContext() { mContext.unregisterReceiver(mCopyBroadcastReceiver); mContext.release(); if (mCameraSound != null) { mCameraSound.release(); } mBgExecutor.shutdownNow(); } Loading Loading @@ -806,7 +816,9 @@ public class ScreenshotController { */ private void saveScreenshotAndToast(Consumer<Uri> finisher) { // Play the shutter sound to notify that we've taken a screenshot mCameraSound.play(MediaActionSound.SHUTTER_CLICK); if (mCameraSound != null) { mCameraSound.start(); } saveScreenshotInWorkerThread( /* onComplete */ finisher, Loading Loading @@ -840,7 +852,9 @@ public class ScreenshotController { mScreenshotView.createScreenshotDropInAnimation(screenRect, showFlash); // Play the shutter sound to notify that we've taken a screenshot mCameraSound.play(MediaActionSound.SHUTTER_CLICK); if (mCameraSound != null) { mCameraSound.start(); } if (DEBUG_ANIM) { Log.d(TAG, "starting post-screenshot animation"); Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4276,6 +4276,9 @@ <!-- URI for in call notification sound --> <string translatable="false" name="config_inCallNotificationSound">/product/media/audio/ui/InCallNotification.ogg</string> <!-- URI for camera shutter sound --> <string translatable="false" name="config_cameraShutterSound">/product/media/audio/ui/camera_click.ogg</string> <!-- URI for default ringtone sound file to be used for silent ringer vibration --> <string translatable="false" name="config_defaultRingtoneVibrationSound"></string> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3749,6 +3749,7 @@ <java-symbol type="bool" name="config_handleVolumeAliasesUsingVolumeGroups" /> <java-symbol type="dimen" name="config_inCallNotificationVolume" /> <java-symbol type="string" name="config_inCallNotificationSound" /> <java-symbol type="string" name="config_cameraShutterSound" /> <java-symbol type="integer" name="config_autoGroupAtCount" /> <java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" /> <java-symbol type="bool" name="config_dozeAlwaysOnEnabled" /> Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +21 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import android.graphics.Bitmap; import android.graphics.Insets; import android.graphics.Rect; import android.hardware.display.DisplayManager; import android.media.MediaActionSound; import android.media.AudioAttributes; import android.media.AudioSystem; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -93,6 +95,7 @@ import com.android.systemui.screenshot.TakeScreenshotService.RequestCallback; import com.google.common.util.concurrent.ListenableFuture; import java.io.File; import java.util.List; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; Loading Loading @@ -248,7 +251,7 @@ public class ScreenshotController { private final WindowManager mWindowManager; private final WindowManager.LayoutParams mWindowLayoutParams; private final AccessibilityManager mAccessibilityManager; private final MediaActionSound mCameraSound; private final MediaPlayer mCameraSound; private final ScrollCaptureClient mScrollCaptureClient; private final PhoneWindow mWindow; private final DisplayManager mDisplayManager; Loading Loading @@ -331,8 +334,13 @@ public class ScreenshotController { reloadAssets(); // Setup the Camera shutter sound mCameraSound = new MediaActionSound(); mCameraSound.load(MediaActionSound.SHUTTER_CLICK); mCameraSound = MediaPlayer.create(mContext, Uri.fromFile(new File(mContext.getResources().getString( com.android.internal.R.string.config_cameraShutterSound))), null, new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .build(), AudioSystem.newAudioSessionId()); mCopyBroadcastReceiver = new BroadcastReceiver() { @Override Loading Loading @@ -430,7 +438,9 @@ public class ScreenshotController { void releaseContext() { mContext.unregisterReceiver(mCopyBroadcastReceiver); mContext.release(); if (mCameraSound != null) { mCameraSound.release(); } mBgExecutor.shutdownNow(); } Loading Loading @@ -806,7 +816,9 @@ public class ScreenshotController { */ private void saveScreenshotAndToast(Consumer<Uri> finisher) { // Play the shutter sound to notify that we've taken a screenshot mCameraSound.play(MediaActionSound.SHUTTER_CLICK); if (mCameraSound != null) { mCameraSound.start(); } saveScreenshotInWorkerThread( /* onComplete */ finisher, Loading Loading @@ -840,7 +852,9 @@ public class ScreenshotController { mScreenshotView.createScreenshotDropInAnimation(screenRect, showFlash); // Play the shutter sound to notify that we've taken a screenshot mCameraSound.play(MediaActionSound.SHUTTER_CLICK); if (mCameraSound != null) { mCameraSound.start(); } if (DEBUG_ANIM) { Log.d(TAG, "starting post-screenshot animation"); Loading