Merge "Uncanonicalize URIs before comparing them." into pi-dev

This commit is contained in:
Michael Wright
2018-05-23 12:39:34 +00:00
committed by Android (Google) Code Review

View File

@@ -17,6 +17,7 @@
package android.os;
import android.annotation.Nullable;
import android.content.ContentResolver;
import android.content.Context;
import android.hardware.vibrator.V1_0.EffectStrength;
import android.hardware.vibrator.V1_2.Effect;
@@ -275,7 +276,12 @@ public abstract class VibrationEffect implements Parcelable {
if (uris[i] == null) {
continue;
}
if (Uri.parse(uris[i]).equals(uri)) {
ContentResolver cr = context.getContentResolver();
Uri mappedUri = cr.uncanonicalize(Uri.parse(uris[i]));
if (mappedUri == null) {
continue;
}
if (mappedUri.equals(uri)) {
return get(RINGTONES[i]);
}
}