Skip to content

Commit 9eff3a1

Browse files
committed
fix(Connectivity): androidApp is not defined on SDK <28
fixes #10323
1 parent ed0989d commit 9eff3a1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/core/connectivity/index.android.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ function startMonitoringLegacy(connectionTypeChangedCallback) {
109109
connectionTypeChangedCallback(newConnectionType);
110110
};
111111
const zoneCallback = zonedCallback(onReceiveCallback);
112-
// @ts-ignore
113-
androidApp.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
112+
Application.android.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
114113
}
115114

116115
let callback;

packages/core/global-types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ declare module globalThis {
103103
function _isModuleLoadedForUI(moduleName: string): boolean;
104104

105105
var onGlobalLayoutListener: any;
106-
function zonedCallback(callback: Function): Function;
106+
function zonedCallback<T = Function>(callback: T): T;
107107
var Reflect: any;
108108
function Deprecated(target: Object, key?: string | symbol, descriptor?: any): any;
109109
function Experimental(target: Object, key?: string | symbol, descriptor?: any): any;
@@ -358,7 +358,7 @@ declare function fail(data: any): void;
358358
*/
359359
// declare function clearInterval(id: number): void;
360360

361-
declare function zonedCallback(callback: Function): Function;
361+
declare function zonedCallback<T = Function>(callback: T): T;
362362

363363
/**
364364
* Create a Java long from a number

0 commit comments

Comments
 (0)