Merge "Uncanonicalize URIs before comparing them." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
467a831aa6
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user