History log of /frameworks/base/core/java/android/net/nsd/NsdManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d86b8fea43ebb6e5c31691b44d8ceb0d8d3c9072 03-Jun-2017 Jeff Sharkey <jsharkey@android.com> Annotate @SystemApi with required permissions.

Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
/frameworks/base/core/java/android/net/nsd/NsdManager.java
fb320cbdbbd10554cf6c926ee29f22f4a96010cb 05-Apr-2017 Hugo Benichi <hugobenichi@google.com> Nsdmanager/NsdService: add logging

This patch adds basic logging to NsdManager and NsdService, and improves
the facilities for pretty printing the event ids defined in NsdManager.

It also includes a few minor cleanups:
- adding 'final' on effectively final instance variables of NsdManager
and NsdService.
- similarly, adding 'static' on effectively static class fields.
- regrouping instance variables together.

Test: no functional changes
Bug: 33074219

(cherry picked from commit 2183ba9b5f8eb54c74cd198a7506b21319794e99)

Merged-In: I360d539e73cc8e4b45d4e0d20b2e345455fdb10c
Change-Id: Id917f3a2085d17f277850af36a2cf859e3614a0f
/frameworks/base/core/java/android/net/nsd/NsdManager.java
7d5da4b044183826ac8388c8bdb94ac979a81797 19-Apr-2016 Philip P. Moltmann <moltmann@google.com> Indicate the NsdServiceInfo attributes are only filled in for a resolved service.

Fixes: 28530428
Change-Id: Ic90bcf4eec10c7db0fd4a4acc8436dda6bab4ba8
/frameworks/base/core/java/android/net/nsd/NsdManager.java
c53962d4ede82a03b62f0c8bb86bd0da090a15eb 02-Mar-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps more.

Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
/frameworks/base/core/java/android/net/nsd/NsdManager.java
e7369bd4dfa4fb3fdced5b52160a5d0209132292 28-Mar-2014 Dave Platt <dplatt@google.com> Document and enforce "one request per Listener" rule

The API and implementation of NsdManager imply that a separate
Listener is to be used for each active registration or discovery
request. This isn't formally documented or properly enforced, and
weird and unpredictable things happen if an application uses a
Listener for more than one request at a time.

Update documentation to make this an explicit requirement.

Enforce the restriction when a new request is submitted for
processing; if the Listener is already being used to track an active
request, throw an exception.

Document the fact that apps should unregister services and cancel
service discoveries when the app is stopped (in KitKat and prior
releases, they'll leak if this isn't done.)

Re-order "release the Listener" operation to occur before the Listener
callback, so that the Listener can be reused by the application once
the callback has been entered - this eliminates a race condition.
Document this.

Pass 2: typos, added documentation about API level, changed to using
an explicitly defined return value for "busy listener".

Bug: 13512512
Change-Id: Ic164110759204b27d8a14376777b593ebe1865fa
/frameworks/base/core/java/android/net/nsd/NsdManager.java
63761a2d79d1ba751bf35a0a78d68337a64cac9c 05-Mar-2014 Dave Platt <dplatt@google.com> am bf588bda: am f08cd8c6: am 7d8262cb: am 22f66b76: Merge "Harden NsdManager against null-dereference crashes"

* commit 'bf588bda2c4dc98919439946e905e98ad4d352dd':
Harden NsdManager against null-dereference crashes
3fc376b7336cfbddbb10ce3f93a853a927f6513a 28-Feb-2014 Dave Platt <dplatt@google.com> Harden NsdManager against null-dereference crashes

Due to race conditions or programming errors, the NsdManager
can attempt to process an asynchronous status message (and issue
a callback to the listener) after the listener has already been
removed from the NsdManager state. This causes dereferencing of
null objects, and a crash.

Split out the three async-queue message cases: these are ones
in which message.arg2 does not hold an NsdManager array index
and the code should not interpret this field as if it were.

Add an explicit check for "null listener" (the array index in the
message has already been released), log a warning, and exit early.

Safeguard accesses to the "NSD service type" string from a (possibly
null) NsdServiceInfo object... return a constant "?" string rather
than crashing.

Bug: 9016259

Change-Id: I40aabdfc65d86fdd0eaac7a1e7e56e6ff69796cf
/frameworks/base/core/java/android/net/nsd/NsdManager.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/core/java/android/net/nsd/NsdManager.java
af2eefb70146a94dc4ae1d85ffe2b0e5e8f35a69 03-May-2013 Robert Greenwalt <rgreenwalt@google.com> Fix sync problem in NsdManager

The NsdManager init was thinking it was done before the AsyncChannel
was fully setup and if the setup were slow and the app fast, the app
could make calls to the NsdManager that it wasn't ready for.

bug:8545006
Change-Id: I2cb2a7c0a1c7f3d2b81ac0f66d37346e6d2d720d
/frameworks/base/core/java/android/net/nsd/NsdManager.java
22af38c5261d2c03796b496e6edb125327cace16 04-May-2012 Irfan Sheriff <isheriff@google.com> API review fixes

- Remove the notion of channel from an application perspective
- Remove the use of DnsSd as part of API and add a protocol type to allow
future extensions
- Use the listener object as a handler for stop and unregister operations. Also,
we now allow multiple active discovery operations.
- Remove init/deinit operations in favour of setting up construction

Bug:6434844
Change-Id: Id15521d571aac9c4053d81184ad66dfc54f636de
/frameworks/base/core/java/android/net/nsd/NsdManager.java
54ac7a510245e5f00c16ff5595b6ae8d002c1c3b 19-Apr-2012 Irfan Sheriff <isheriff@google.com> Fix build

Change-Id: I1968e0d7d25f613fa6cf72f82d79f17224e3d5ab
/frameworks/base/core/java/android/net/nsd/NsdManager.java
6c07ba8183edc593527335238a2c6083392df7bc 18-Apr-2012 Irfan Sheriff <isheriff@google.com> Add network service discovery broadcast

Allows apps to know if user has the feature turned off

Change-Id: I2d2fecb148eb4e48eb4aea51d1d7643a82df5c52
/frameworks/base/core/java/android/net/nsd/NsdManager.java
3ef889bf561e59561ff2c6c4b2ffb586b9c5af5c 18-Apr-2012 Irfan Sheriff <isheriff@google.com> Add user control to turn on/off nsd

Change-Id: Ide3cc20adb21ac6dffaf6b9b9136d77a129afa3b
/frameworks/base/core/java/android/net/nsd/NsdManager.java
92784670c48759c0db604ddb95c05a7b9bdebed8 13-Apr-2012 Irfan Sheriff <isheriff@google.com> Open network service discovery API

Add support for DNS based network service discovery API. This
allows applications to discover and resolve applications on a
local network such as Wi-Fi

Change-Id: Ie89895edd35d12b7f7a23fb5fed36cb2b2079f7a
/frameworks/base/core/java/android/net/nsd/NsdManager.java
817388e056a5d1d0e7cd7de2c6b0c9c80617bc5f 11-Apr-2012 Irfan Sheriff <isheriff@google.com> Bonjour fixes

Change-Id: I1df1dc470bb42c84abc7e1a46bedf9f206910b65
/frameworks/base/core/java/android/net/nsd/NsdManager.java
7d024d372431effc87168afdc7cbe387680c4935 23-Mar-2012 Irfan Sheriff <isheriff@google.com> Add initial framework for DNS service discovery

Change-Id: I53c0b7ebfd75e520ebb7553612f1aa8413b6b79b
/frameworks/base/core/java/android/net/nsd/NsdManager.java