Merge "RingtoneManager#setActualDefaultRingtone() open OutputStream of cacheUri with "wt" mode" am: f922e9fa40 am: a44c29cd16 am: 5854401fcf am: 6bdaf8fc6f

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2447583

Change-Id: Iac2eb9e30c77b2ef331210cdff83afc0f20588e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ian Baker
2023-02-23 18:51:56 +00:00
committed by Automerger Merge Worker

View File

@@ -849,7 +849,7 @@ public class RingtoneManager {
if (ringtoneUri != null) {
final Uri cacheUri = getCacheForType(type, context.getUserId());
try (InputStream in = openRingtone(context, ringtoneUri);
OutputStream out = resolver.openOutputStream(cacheUri)) {
OutputStream out = resolver.openOutputStream(cacheUri, "wt")) {
FileUtils.copy(in, out);
} catch (IOException e) {
Log.w(TAG, "Failed to cache ringtone: " + e);