Skip to content

Commit

Permalink
Integrated the Audio Library Request Code in the necessary activities.
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-alexander committed Jan 7, 2021
1 parent a8a1e82 commit 408cf6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
case RequestCodes.PICTURE_LIBRARY:
case RequestCodes.VIDEO_LIBRARY:
case RequestCodes.FILE_LIBRARY:
case RequestCodes.AUDIO_LIBRARY:
if (resultCode == Activity.RESULT_OK && data != null) {
if (mConsolidatedMediaPickerFeatureConfig.isEnabled()) {
if (data.hasExtra(MediaPickerConstants.EXTRA_MEDIA_URIS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,7 @@ postId, getSite(), mediaUri,
}
break;
case RequestCodes.FILE_LIBRARY:
case RequestCodes.AUDIO_LIBRARY:
if (mConsolidatedMediaPickerFeatureConfig.isEnabled()) {
if (data.hasExtra(MediaPickerConstants.EXTRA_MEDIA_URIS)) {
List<Uri> uriResults = convertStringArrayIntoUrisList(
Expand All @@ -2761,7 +2762,16 @@ postId, getSite(), mediaUri,
}
} else {
uris = WPMediaUtils.retrieveMediaUris(data);
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_FILE_VIA_LIBRARY);

switch (requestCode) {
case RequestCodes.FILE_LIBRARY:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_FILE_VIA_LIBRARY);
break;
case RequestCodes.AUDIO_LIBRARY:
mAnalyticsTrackerWrapper.track(Stat.EDITOR_ADDED_AUDIO_FILE_VIA_LIBRARY);
break;
}

for (Uri item : uris) {
mEditorMedia.addNewMediaToEditorAsync(item, false);
}
Expand Down

0 comments on commit 408cf6d

Please sign in to comment.