commit | 33941d8ddfd5adba63a92f7d09d0fe3e162702cd | [log] [tgz] |
---|---|---|
author | Vania Desmonda <vaniadesmonda@google.com> | Mon May 20 11:46:58 2024 +0100 |
committer | Vania Desmonda <vaniadesmonda@google.com> | Mon May 20 11:46:58 2024 +0100 |
tree | 67e65299859c95b28de4479acc1700fff48a88aa | |
parent | 79b37bdb7d8656b2902d93aeffef82d131b209df [diff] |
Use `mContext.getMainLooper()` as the parameter for creating a new Handler if it's null in `registerCallback()` Test: refactoring CL only, all tests should pass Bug: 293436997 Change-Id: I2a0d4735c3324a7c2e8ae9ef432350613562148f
diff --git a/media/java/android/media/projection/MediaProjection.java b/media/java/android/media/projection/MediaProjection.java index 223b432c..4059291 100644 --- a/media/java/android/media/projection/MediaProjection.java +++ b/media/java/android/media/projection/MediaProjection.java
@@ -109,7 +109,7 @@ try { final Callback c = Objects.requireNonNull(callback); if (handler == null) { - handler = new Handler(); + handler = new Handler(mContext.getMainLooper()); } mCallbacks.put(c, new CallbackRecord(c, handler)); } catch (NullPointerException e) {