Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c60b209 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Ensure only valid events are reported." into udc-dev am: ab109af8 am:...

Merge "Ensure only valid events are reported." into udc-dev am: ab109af8 am: 25fe9840 am: 56449c78

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23067922



Change-Id: I2a211d8cf3404eb8cb02822d0a02ba2b2bcfa928
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7f1e476c 56449c78
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2539,10 +2539,14 @@ public class UsageStatsService extends SystemService implements
        }

        @Override
        public void reportChooserSelection(String packageName, int userId, String contentType,
                                           String[] annotations, String action) {
        public void reportChooserSelection(@NonNull String packageName, int userId,
                String contentType, String[] annotations, String action) {
            if (packageName == null) {
                Slog.w(TAG, "Event report user selecting a null package");
                throw new IllegalArgumentException("Package selection must not be null.");
            }
            // Verify if this package exists before reporting an event for it.
            if (mPackageManagerInternal.getPackageUid(packageName, 0, userId) < 0) {
                Slog.w(TAG, "Event report user selecting an invalid package");
                return;
            }