Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed8ee277 authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
Browse files

Merge "[SettingsProvider] clear binder identity when updating the ringtone cache" into udc-qpr-dev

parents 0062109f 7773a42b
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2034,12 +2034,14 @@ public class SettingsProvider extends ContentProvider {
            final Uri ringtoneUri = Uri.parse(value);
            // Stream selected ringtone into cache, so it's available for playback
            // when CE storage is still locked
            Binder.withCleanCallingIdentity(() -> {
                try (InputStream in = openRingtone(getContext(), ringtoneUri);
                         OutputStream out = new FileOutputStream(cacheFile)) {
                    FileUtils.copy(in, out);
                } catch (IOException e) {
                    Slog.w(LOG_TAG, "Failed to cache ringtone: " + e);
                }
            });
        }
        return true;
    }