diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts old mode 100755 new mode 100644 index d1c0fe0b187625e47654b52e43e97561fd44b2b1..6e4fbce5de6c0999198b4f3c0b5fbaf1d5ab7777 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {Callback} from "./basic"; import radio from "./@ohos.telephony.radio"; import call from "./@ohos.telephony.call"; @@ -38,14 +38,12 @@ declare namespace observer { * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an instance of the {@code NetworkState} class. + * @permission ohos.permission.GET_NETWORK_INFO */ - function on(type: 'networkStateChange', callback: AsyncCallback): void; - function on(type: 'networkStateChange', options: { slotId: number }, callback: AsyncCallback): void; + function on(type: 'networkStateChange', callback: Callback): void; + function on(type: 'networkStateChange', options: { slotId: number }, callback: Callback): void; - function once(type: 'networkStateChange', callback: AsyncCallback): void; - function once(type: 'networkStateChange', options: { slotId: number }, callback: AsyncCallback): void; - - function off(type: 'networkStateChange', callback?: AsyncCallback): void; + function off(type: 'networkStateChange', callback?: Callback): void; /** * Called when the signal strength corresponding to a monitored {@code slotId} updates. @@ -55,15 +53,11 @@ declare namespace observer { * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an array of instances of the classes derived from {@link SignalInformation}. */ - function on(type: 'signalInfoChange', callback: AsyncCallback>): void; + function on(type: 'signalInfoChange', callback: Callback>): void; function on(type: 'signalInfoChange', options: { slotId: number }, - callback: AsyncCallback>): void; - - function once(type: 'signalInfoChange', callback: AsyncCallback>): void; - function once(type: 'signalInfoChange', options: { slotId: number }, - callback: AsyncCallback>): void; + callback: Callback>): void; - function off(type: 'signalInfoChange', callback?: AsyncCallback>): void; + function off(type: 'signalInfoChange', callback?: Callback>): void; /** * Receives a call state change. This callback is invoked when the call state of a specified card updates @@ -76,15 +70,11 @@ declare namespace observer { * The value of number is an empty string if the application does not have * the {@code ohos.permission#READ_CALL_LOG READ_CALL_LOG} permission. */ - function on(type: 'callStateChange', callback: AsyncCallback<{ state: CallState, number: String }>): void; + function on(type: 'callStateChange', callback: Callback<{ state: CallState, number: string }>): void; function on(type: 'callStateChange', options: { slotId: number }, - callback: AsyncCallback<{ state: CallState, number: String }>): void; - - function once(type: 'callStateChange', callback: AsyncCallback<{ state: CallState, number: String }>): void; - function once(type: 'callStateChange', options: { slotId: number }, - callback: AsyncCallback<{ state: CallState, number: String }>): void; + callback: Callback<{ state: CallState, number: string }>): void; - function off(type: 'callStateChange', callback?: AsyncCallback<{ state: CallState, number: String }>): void; + function off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void; } export default observer; \ No newline at end of file