From 96aa4824b9057919c8c7798ac1378b6c39920978 Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Fri, 5 Jan 2024 11:57:14 +0000 Subject: [PATCH] Document more errno(s) on ADnsHelper_ API Address comments from android-api-council review. Bug: 310992535 Change-Id: I722725bd3d3a3df1687721175e9434efae9da37a Test: presubmit --- DnsResolver/include/DnsHelperPublic.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DnsResolver/include/DnsHelperPublic.h b/DnsResolver/include/DnsHelperPublic.h index 7c9fc9e58e..44b00128d9 100644 --- a/DnsResolver/include/DnsHelperPublic.h +++ b/DnsResolver/include/DnsHelperPublic.h @@ -25,7 +25,8 @@ __BEGIN_DECLS * Perform any required initialization - including opening any required BPF maps. This function * needs to be called before using other functions of this library. * - * Returns 0 on success, a negative POSIX error code (see errno.h) on other failures. + * Returns 0 on success, -EOPNOTSUPP when the function is called on the Android version before + * T. Returns a negative POSIX error code (see errno.h) on other failures. */ int ADnsHelper_init(); @@ -36,7 +37,9 @@ int ADnsHelper_init(); * |uid| is a Linux/Android UID to be queried. It is a combination of UserID and AppID. * |metered| indicates whether the uid is currently using a billing network. * - * Returns 0(false)/1(true) on success, a negative POSIX error code (see errno.h) on other failures. + * Returns 0(false)/1(true) on success, -EUNATCH when the ADnsHelper_init is not called before + * calling this function. Returns a negative POSIX error code (see errno.h) on other failures + * that return from bpf syscall. */ int ADnsHelper_isUidNetworkingBlocked(uid_t uid, bool metered);