packages/apps/Settings
リビジョン | f1125282f9834e5e65f0224c624aa2a446ad939e (tree) |
---|---|
日時 | 2021-03-11 18:48:07 |
作者 | András Klöczl <andraskloczl@goog...> |
コミッター | Android (Google) Code Review |
Merge "Prevent using invalid result uri during multi user image change" into pi-dev
@@ -38,6 +38,7 @@ import android.os.UserHandle; | ||
38 | 38 | import android.os.UserManager; |
39 | 39 | import android.provider.ContactsContract.DisplayPhoto; |
40 | 40 | import android.provider.MediaStore; |
41 | +import android.util.EventLog; | |
41 | 42 | import android.support.v4.content.FileProvider; |
42 | 43 | import android.util.Log; |
43 | 44 | import android.view.Gravity; |
@@ -114,6 +115,14 @@ public class EditUserPhotoController { | ||
114 | 115 | } |
115 | 116 | final Uri pictureUri = data != null && data.getData() != null |
116 | 117 | ? data.getData() : mTakePictureUri; |
118 | + | |
119 | + // Check if the result is a content uri | |
120 | + if (!ContentResolver.SCHEME_CONTENT.equals(pictureUri.getScheme())) { | |
121 | + Log.e(TAG, "Invalid pictureUri scheme: " + pictureUri.getScheme()); | |
122 | + EventLog.writeEvent(0x534e4554, "172939189", -1, pictureUri.getPath()); | |
123 | + return false; | |
124 | + } | |
125 | + | |
117 | 126 | switch (requestCode) { |
118 | 127 | case REQUEST_CODE_CROP_PHOTO: |
119 | 128 | onPhotoCropped(pictureUri, true); |