Merge "RingtoneManager#setActualDefaultRingtone() open OutputStream of cacheUri with "wt" mode" am: f922e9fa40 am: a44c29cd16
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2447583 Change-Id: I1882b35bc054fa672f031c6cf46582de6fb9d4ab Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -841,7 +841,7 @@ public class RingtoneManager {
|
|||||||
if (ringtoneUri != null) {
|
if (ringtoneUri != null) {
|
||||||
final Uri cacheUri = getCacheForType(type, context.getUserId());
|
final Uri cacheUri = getCacheForType(type, context.getUserId());
|
||||||
try (InputStream in = openRingtone(context, ringtoneUri);
|
try (InputStream in = openRingtone(context, ringtoneUri);
|
||||||
OutputStream out = resolver.openOutputStream(cacheUri)) {
|
OutputStream out = resolver.openOutputStream(cacheUri, "wt")) {
|
||||||
FileUtils.copy(in, out);
|
FileUtils.copy(in, out);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, "Failed to cache ringtone: " + e);
|
Log.w(TAG, "Failed to cache ringtone: " + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user