From 99fdf930666a56172615bb374ad39cb3d1cca86c Mon Sep 17 00:00:00 2001 From: Paul Hu Date: Wed, 12 Apr 2023 15:24:02 +0800 Subject: [PATCH] Add missed NSD event name Some events are missed their name in the EVENT_NAMES array and shows the number on dumpsys logs. Add their name to the event array to show correct info. Before: rec[0]: time=04-12 15:15:23.553 processed=DefaultState org=EnabledState dest= what=21 rec[1]: time=04-12 15:15:23.555 processed=EnabledState org=EnabledState dest= what=REGISTER_SERVICE rec[2]: time=04-12 15:15:24.375 processed=EnabledState org=EnabledState dest= what=DISCOVER_SERVICES rec[3]: time=04-12 15:15:25.338 processed=EnabledState org=EnabledState dest= what=23 rec[4]: time=04-12 15:15:25.342 processed=EnabledState org=EnabledState dest= what=RESOLVE_SERVICE rec[5]: time=04-12 15:15:25.344 processed=EnabledState org=EnabledState dest= what=23 rec[6]: time=04-12 15:15:25.358 processed=EnabledState org=EnabledState dest= what=UNREGISTER_SERVICE rec[7]: time=04-12 15:15:25.551 processed=DefaultState org=EnabledState dest= what=22 After: rec[0]: time=04-12 15:19:58.955 processed=DefaultState org=EnabledState dest= what=REGISTER_CLIENT rec[1]: time=04-12 15:19:58.958 processed=EnabledState org=EnabledState dest= what=REGISTER_SERVICE rec[2]: time=04-12 15:19:59.979 processed=EnabledState org=EnabledState dest= what=DISCOVER_SERVICES rec[3]: time=04-12 15:20:00.768 processed=EnabledState org=EnabledState dest= what=MDNS_DISCOVERY_MANAGER_EVENT rec[4]: time=04-12 15:20:00.777 processed=EnabledState org=EnabledState dest= what=RESOLVE_SERVICE rec[5]: time=04-12 15:20:00.778 processed=EnabledState org=EnabledState dest= what=MDNS_DISCOVERY_MANAGER_EVENT rec[6]: time=04-12 15:20:00.785 processed=EnabledState org=EnabledState dest= what=UNREGISTER_SERVICE rec[7]: time=04-12 15:20:00.925 processed=DefaultState org=EnabledState dest= what=UNREGISTER_CLIENT Test: adb shell dumpsys servicediscovery Bug: 275004614 Change-Id: I9c05efc2d2993af353a2a902fd8810f53ab2cd16 --- framework-t/src/android/net/nsd/NsdManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework-t/src/android/net/nsd/NsdManager.java b/framework-t/src/android/net/nsd/NsdManager.java index 96f2f8040b..d119db6f1a 100644 --- a/framework-t/src/android/net/nsd/NsdManager.java +++ b/framework-t/src/android/net/nsd/NsdManager.java @@ -281,6 +281,9 @@ public final class NsdManager { EVENT_NAMES.put(UNREGISTER_SERVICE_CALLBACK, "UNREGISTER_SERVICE_CALLBACK"); EVENT_NAMES.put(UNREGISTER_SERVICE_CALLBACK_SUCCEEDED, "UNREGISTER_SERVICE_CALLBACK_SUCCEEDED"); + EVENT_NAMES.put(MDNS_DISCOVERY_MANAGER_EVENT, "MDNS_DISCOVERY_MANAGER_EVENT"); + EVENT_NAMES.put(REGISTER_CLIENT, "REGISTER_CLIENT"); + EVENT_NAMES.put(UNREGISTER_CLIENT, "UNREGISTER_CLIENT"); } /** @hide */