return null;
}
- int end = authority.indexOf('@');
+ int end = authority.lastIndexOf('@');
return end == NOT_FOUND ? null : authority.substring(0, end);
}
}
// Parse out user info and then port.
- int userInfoSeparator = authority.indexOf('@');
+ int userInfoSeparator = authority.lastIndexOf('@');
int portSeparator = authority.indexOf(':', userInfoSeparator);
String encodedHost = portSeparator == NOT_FOUND
// Make sure we look for the port separtor *after* the user info
// separator. We have URLs with a ':' in the user info.
- int userInfoSeparator = authority.indexOf('@');
+ int userInfoSeparator = authority.lastIndexOf('@');
int portSeparator = authority.indexOf(':', userInfoSeparator);
if (portSeparator == NOT_FOUND) {
* begin with and a scheme component cannot be found.
*
* @return normalized Uri (never null)
- * @see {@link android.content.Intent#setData}
- * @see {@link android.content.Intent#setDataAndNormalize}
+ * @see android.content.Intent#setData
+ * @see android.content.Intent#setDataAndNormalize
*/
public Uri normalizeScheme() {
String scheme = getScheme();
* @hide
*/
public void checkFileUriExposed(String location) {
- if ("file".equals(getScheme())) {
- StrictMode.onFileUriExposed(location);
+ if ("file".equals(getScheme()) && !getPath().startsWith("/system/")) {
+ StrictMode.onFileUriExposed(this, location);
}
}