Merge "Prevent using invalid result uri during multi user image change" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f1125282f9
@@ -38,6 +38,7 @@ import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.ContactsContract.DisplayPhoto;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.EventLog;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -114,6 +115,14 @@ public class EditUserPhotoController {
|
||||
}
|
||||
final Uri pictureUri = data != null && data.getData() != null
|
||||
? data.getData() : mTakePictureUri;
|
||||
|
||||
// Check if the result is a content uri
|
||||
if (!ContentResolver.SCHEME_CONTENT.equals(pictureUri.getScheme())) {
|
||||
Log.e(TAG, "Invalid pictureUri scheme: " + pictureUri.getScheme());
|
||||
EventLog.writeEvent(0x534e4554, "172939189", -1, pictureUri.getPath());
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (requestCode) {
|
||||
case REQUEST_CODE_CROP_PHOTO:
|
||||
onPhotoCropped(pictureUri, true);
|
||||
|
Reference in New Issue
Block a user