fix: master code equally

Signed-off-by: pingliao <liaoping9@h-partners.com>
This commit is contained in:
pingliao 2024-07-10 11:33:17 +08:00
parent a93da8b675
commit d5f2f2088d
3 changed files with 5 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) => {