From 408cf6de238e706523c2de6d00bbcd53cca7fe37 Mon Sep 17 00:00:00 2001 From: Joel Dean Date: Wed, 6 Jan 2021 22:33:13 -0500 Subject: [PATCH] Integrated the Audio Library Request Code in the necessary activities. --- .../android/ui/media/MediaBrowserActivity.java | 1 + .../wordpress/android/ui/posts/EditPostActivity.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java index 4f7f336e61f2..a6b48ac52587 100755 --- a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java @@ -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)) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java index 838f0b014c07..52feec24d8bd 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java @@ -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 uriResults = convertStringArrayIntoUrisList( @@ -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); }