Merge cherrypicks of [13924074, 13924075, 13924587, 13923962, 13924417, 13924418, 13924419, 13923941, 13924588, 13923901, 13923902, 13924076, 13924077, 13924420, 13924421, 13924422, 13924423, 13924424, 13924645, 13924589, 13922107, 13924332, 13924333, 13924334, 13924335, 13924336, 13924665, 13923963, 13924646, 13924590, 13924666, 13923971, 13923942] into rvc-qpr2-release

Change-Id: I4c0d13ddb22de428f73f0f59bba41095a3e4b188
This commit is contained in:
android-build-team Robot
2021-03-19 00:02:15 +00:00

View File

@@ -36,6 +36,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.provider.ContactsContract.DisplayPhoto;
import android.provider.MediaStore;
import android.util.EventLog;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
@@ -116,6 +117,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);