commit | 99966647d521141be79e949b9e5961005cb47083 | [log] [tgz] |
---|---|---|
author | Yang Sun <sunytt@google.com> | Thu May 23 11:44:41 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu May 23 11:44:41 2024 +0000 |
tree | 462c92ccba2681ce4b96ee3d5f8d33ded67d2d69 | |
parent | 18d28534a0ec242314588eca3bfb1c55de6665c1 [diff] | |
parent | 312b04761c219b24bcb8a6f58c9583bd5b553c11 [diff] |
Merge "Update checkOnHandlerThread()" into main am: 19aca4ce28 am: 312b04761c Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3013716 Change-Id: Ie25e93891059d250f4fe99907b2d19767d68261f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java b/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java index 0c200fd..afd6e9a 100644 --- a/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java +++ b/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java
@@ -465,6 +465,7 @@ private void setEnabledInternal( boolean isEnabled, boolean persist, @NonNull OperationReceiverWrapper receiver) { + checkOnHandlerThread(); if (isEnabled && isThreadUserRestricted()) { receiver.onError( ERROR_FAILED_PRECONDITION, @@ -960,7 +961,11 @@ private void checkOnHandlerThread() { if (Looper.myLooper() != mHandler.getLooper()) { - Log.wtf(TAG, "Must be on the handler thread!"); + throw new IllegalStateException( + "Not running on ThreadNetworkControllerService thread (" + + mHandler.getLooper() + + ") : " + + Looper.myLooper()); } }