diff --git a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbDialogAbility.ts b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbDialogAbility.ts index 8a6a8fd..de30e84 100644 --- a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbDialogAbility.ts +++ b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbDialogAbility.ts @@ -24,7 +24,7 @@ class UsbDialogStub extends rpc.RemoteObject { constructor(des) { super(des); } - onRemoteRequest(code, data, reply, option): boolean { + onRemoteRequest(code, data, reply, option): boolean { return true; } } @@ -99,9 +99,6 @@ export default class UsbDialogAbility extends extension { const usbWin = await window.createWindow(config); console.log('createWindow execute'); globalThis.window = usbWin; - //let token: UsbDialogStub = new UsbDialogStub('UsbRightDialog'); - //await usbWin.bindDialogTarget(token); - //console.log('createWindow bindDialogTarget'); await usbWin.moveTo(rect.left, rect.top); await usbWin.resetSize(rect.width, rect.height); diff --git a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbFunctionSwitchWindowAbility.ts b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbFunctionSwitchWindowAbility.ts index 583f550..7676ae4 100755 --- a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbFunctionSwitchWindowAbility.ts +++ b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/ServiceExtAbility/UsbFunctionSwitchWindowAbility.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import UIExtensionAbility from '@ohos.app.ability.UIExtensionAbility' -import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession' +import UIExtensionAbility from '@ohos.app.ability.UIExtensionAbility'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import rpc from '@ohos.rpc'; let TAG: string = 'UsbService'; @@ -32,7 +32,7 @@ export default class UsbFunctionSwitchAbility extends UIExtensionAbility { console.error('check permission fail'); return; } - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('session', session); (session as UIExtensionContentSession)?.loadContent('pages/Index'); try { (session as UIExtensionContentSession)?.setWindowBackgroundColor(BG_COLOR); diff --git a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/util/UsbServiceSwitch.ts b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/util/UsbServiceSwitch.ts index 6b25c7c..e62e28f 100755 --- a/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/util/UsbServiceSwitch.ts +++ b/frameworks/dialog/dialog_ui/usb_right_dialog/src/main/ets/util/UsbServiceSwitch.ts @@ -49,7 +49,7 @@ class UsbServiceSwitch { } console.log(TAG + 'setFunctions: current ' + JSON.stringify(this.curFunc) + 'target: ' + JSON.stringify(this.tarFunc)); - if (this.tarFunc != this.curFunc) { + if (this.tarFunc !== this.curFunc) { usbManagerService.setCurrentFunctions(this.tarFunc).then((data) => { console.log(TAG + 'setCurrentFunctions success: ' + JSON.stringify(data)); }).catch((err) => {