From 60424bf658cc233d96151ed33a41d0fab47602c9 Mon Sep 17 00:00:00 2001 From: liyufan Date: Tue, 13 Sep 2022 18:33:53 +0800 Subject: [PATCH] add sync interface Signed-off-by: liyufan --- api/@ohos.net.connection.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index ad31470548..8fdc697962 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -47,6 +47,18 @@ declare namespace connection { function getDefaultNet(callback: AsyncCallback): void; function getDefaultNet(): Promise; + /** + * Obtains the data network that is activated by default. + * + *

To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. + * + * @return Returns the {@link NetHandle} object; + * returns {@code null} if the default network is not activated. + * @permission ohos.permission.GET_NETWORK_INFO + * @since 9 + */ + function getDefaultNetSync(): NetHandle; + /** * Obtains the list of data networks that are activated. * -- Gitee