1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the 'License'); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an 'AS IS' BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import inputmethodengine from '@ohos.inputMethodEngine'; 16import display from '@ohos.display'; 17import windowManager from '@ohos.window'; 18import commoneventmanager from '@ohos.commonEventManager'; 19import prompt from '@ohos.prompt'; 20import inputMethodEngine from '@ohos.inputMethodEngine'; 21import { util } from '@kit.ArkTS'; 22 23let inputMethodAbility = inputmethodengine.getInputMethodAbility(); 24const TAG = 'keyboardController'; 25const SOFT_KEYBOARD = 0; 26const STATUS_BAR = 1; 27const FLG_FIXED = 0; 28const FLG_FLOATING = 1; 29 30let panelInfo = { 31 type: SOFT_KEYBOARD, 32 flag: FLG_FLOATING 33}; 34 35export class KeyboardController { 36 mContext; 37 storage: LocalStorage; 38 WINDOW_TYPE_INPUT_METHOD_FLOAT = 2105; 39 windowName = 'inputApp'; 40 41 private softKeyboardPanel: any = null; 42 private windowHeight: number = 0; 43 private windowWidth: number = 0; 44 private nonBarPosition: number = 0; 45 private keyboardController: inputMethodEngine.KeyboardController; 46 private InputClient: inputMethodEngine.InputClient; 47 private display_info = display.getDefaultDisplaySync(); 48 private immersive: number = 0; 49 50 constructor(context) { 51 this.storage = new LocalStorage(); 52 this.storage.setOrCreate('storageSimplePorp', 121); 53 this.mContext = context; 54 this.windowWidth = this.display_info.width; 55 this.windowHeight = this.display_info.height * 0.45; 56 } 57 58 public onCreate(): void { 59 let that = this; 60 let subscriber; 61 62 inputMethodAbility.createPanel(this.mContext, panelInfo, (err, panel) => { 63 if (err !== undefined) { 64 console.info(TAG + '====>Failed to create panel, err: ' + JSON.stringify(err)); 65 return; 66 } 67 this.softKeyboardPanel = panel; 68 this.softKeyboardPanel.setUiContent('testability/pages/Second', async (err, data) => { 69 console.info(TAG + '====>Succeed in creating panel.' + JSON.stringify(panel)); 70 }); 71 try{ 72 let commonEventSubscribeInfo = { 73 events: ['InputMethodWindManageTest'] 74 }; 75 76 commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { 77 subscriber = data; 78 commoneventmanager.subscribe(subscriber, subscriberCallback) 79 console.info(TAG + '====>scene subscribe finish===='); 80 }) 81 }catch(err){ 82 console.info(TAG + '====>createSubscriber err:' + JSON.stringify(err.message)); 83 } 84 }); 85 86 inputMethodAbility.on('inputStop', async() => { 87 console.info(TAG + '====>on_inputStop callback') 88 inputMethodAbility.off('inputStart'); 89 inputMethodAbility.off('inputStop',()=>{}); 90 inputMethodAbility.destroyPanel(this.softKeyboardPanel); 91 await that.mContext.destroy(); 92 await commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); 93 }); 94 95 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 96 this.keyboardController = keyboardController; 97 this.InputClient = InputClient 98 console.info(TAG + '====>inputMethodAbility inputStart into'); 99 }) 100 101 inputmethodengine.getKeyboardDelegate().on('editorAttributeChanged',(attr:inputMethodEngine.EditorAttribute)=>{ 102 console.info(TAG + `====>on_EditorAttribute_callback = ${JSON.stringify(attr)} immersiveMode = ${attr.immersiveMode}`); 103 this.set_IMMERSIVE(attr.immersiveMode) 104 }) 105 106 let subscriberCallback = (err, data) => { 107 console.debug(TAG + '====>receive event err: ' + JSON.stringify(err)); 108 console.debug(TAG + '====>receive event data ' + JSON.stringify(data)); 109 switch (data.code) { 110 case 10: 111 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 event:' + data.event); 112 that.Sub_Misc_inputMethod_Panel_createPanelCallback_0010(); 113 break; 114 case 20: 115 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 event:' + data.event); 116 that.Sub_Misc_inputMethod_Panel_createPanelPromise_0020(); 117 break; 118 case 30: 119 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 event:' + data.event); 120 that.Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030(); 121 break; 122 case 40: 123 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 event:' + data.event); 124 that.Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040(); 125 break; 126 case 50: 127 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 event:' + data.event); 128 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0050(); 129 break; 130 case 60: 131 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 event:' + data.event); 132 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0060(); 133 break; 134 case 70: 135 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 event:' + data.event); 136 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0070(); 137 break; 138 case 80: 139 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 event:' + data.event); 140 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0080(); 141 break; 142 case 90: 143 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 event:' + data.event); 144 that.Sub_Misc_inputMethod_Panel_resizeCallback_0090(); 145 break; 146 case 100: 147 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0100 event:' + data.event); 148 that.Sub_Misc_inputMethod_Panel_resizePromise_0100(); 149 break; 150 case 110: 151 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 event:' + data.event); 152 that.Sub_Misc_inputMethod_Panel_moveToCallback_0110(); 153 break; 154 case 120: 155 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 event:' + data.event); 156 that.Sub_Misc_inputMethod_Panel_moveToPromise_0120(); 157 break; 158 case 130: 159 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_showCallback_0130 event:' + data.event); 160 that.Sub_Misc_inputMethod_Panel_showCallback_0130(); 161 break; 162 case 140: 163 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_showPromise_0140 event:' + data.event); 164 that.Sub_Misc_inputMethod_Panel_showPromise_0140(); 165 break; 166 case 150: 167 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_hideCallback_0150 event:' + data.event); 168 that.Sub_Misc_inputMethod_Panel_hideCallback_0150(); 169 break; 170 case 160: 171 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_hidePromise_0160 event:' + data.event); 172 that.Sub_Misc_inputMethod_Panel_hidePromise_0160(); 173 break; 174 case 170: 175 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onShow_0170 event:' + data.event); 176 that.Sub_Misc_inputMethod_Panel_onShow_0170(); 177 break; 178 case 180: 179 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onHide_0180 event:' + data.event); 180 that.Sub_Misc_inputMethod_Panel_onHide_0180(); 181 break; 182 case 190: 183 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_offShow_0190 event:' + data.event); 184 that.Sub_Misc_inputMethod_Panel_offShow_0190(); 185 break; 186 case 200: 187 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_offHide_0200 event:' + data.event); 188 that.Sub_Misc_inputMethod_Panel_offHide_0200(); 189 break; 190 case 210: 191 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0210 event:' + data.event); 192 that.Sub_Misc_inputMethod_Panel_changeFlag_0210(); 193 break; 194 case 211: 195 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 event:' + data.event); 196 that.Sub_Misc_inputMethod_Panel_changeFlag_0211(); 197 break; 198 case 212: 199 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 event:' + data.event); 200 that.Sub_InputMethod_IMF_SecurityKeyboard_0600(); 201 break; 202 case 213: 203 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 event:' + data.event); 204 that.Sub_InputMethod_IMF_SecurityKeyboard_0700(); 205 break; 206 case 214: 207 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 event:' + data.event); 208 that.Sub_InputMethod_IMF_SecurityKeyboard_0800(); 209 break; 210 case 215: 211 console.debug(TAG + '====>Sub_InputMethod_IMF_getSecurityMode_0100 event:' + data.event); 212 that.Sub_InputMethod_IMF_getSecurityMode_0100(); 213 break; 214 case 216: 215 console.debug(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 event:' + data.event); 216 that.SUB_InputMethod_IME_SplitScreen_0100(); 217 break; 218 case 217: 219 console.debug(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 event:' + data.event); 220 that.Sub_InputMethod_IME_ScreenRotation_0100(); 221 break; 222 case 218: 223 console.debug(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 event:' + data.event); 224 that.Sub_InputMethod_IME_ScreenRotation_0200(); 225 break; 226 case 230: 227 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0900 event:' + data.event); 228 that.Sub_InputMethod_IME_Custom_0900(); 229 break; 230 case 231: 231 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0200 event:' + data.event); 232 that.Sub_InputMethod_IME_Custom_0200(); 233 break; 234 case 232: 235 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0800 event:' + data.event); 236 that.Sub_InputMethod_IME_Custom_0800(); 237 break; 238 case 233: 239 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0400 event:' + data.event); 240 that.Sub_InputMethod_IME_Custom_0400(); 241 break; 242 case 234: 243 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0300 event:' + data.event); 244 that.Sub_InputMethod_IME_Custom_0300(); 245 break; 246 case 235: 247 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_1100 event:' + data.event); 248 that.Sub_InputMethod_IME_Custom_1100(); 249 break; 250 case 240: 251 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 event:' + data.event); 252 that.Sub_Misc_inputMethod_Panel_onSizeChange_0100(); 253 break; 254 case 241: 255 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 event:' + data.event); 256 that.Sub_Misc_inputMethod_Panel_onSizeChange_0200(); 257 break; 258 case 250: 259 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_1100 event:' + data.event); 260 that.Sub_InputMethod_IME_Dragging_1100(); 261 break; 262 case 251: 263 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_0800 event:' + data.event); 264 that.Sub_InputMethod_IME_Dragging_0800(); 265 break; 266 case 253: 267 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_0900 event:' + data.event); 268 that.Sub_InputMethod_IME_Dragging_0900(); 269 break; 270 case 260: 271 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0100 event:' + data.event); 272 that.Sub_InputMethod_IME_Attach_0100(); 273 break; 274 case 261: 275 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0200 event:' + data.event); 276 that.Sub_InputMethod_IME_Attach_0200(); 277 break; 278 case 262: 279 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0300 event:' + data.event); 280 that.Sub_InputMethod_IME_Attach_0300(); 281 break; 282 case 263: 283 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0400 event:' + data.event); 284 that.Sub_InputMethod_IME_Attach_0400(); 285 break; 286 case 270: 287 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0100 event:' + data.event); 288 that.Sub_InputMethod_IME_ShowTextInput_0100(); 289 break; 290 case 271: 291 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0200 event:' + data.event); 292 that.Sub_InputMethod_IME_ShowTextInput_0200(); 293 break; 294 case 272: 295 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0300 event:' + data.event); 296 that.Sub_InputMethod_IME_ShowTextInput_0300(); 297 break; 298 case 273: 299 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0400 event:' + data.event); 300 that.Sub_InputMethod_IME_ShowTextInput_0400(); 301 break; 302 case 280: 303 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 event:' + data.event); 304 that.Sub_InputMethod_IME_FullScreenAbnormal_0100(); 305 break; 306 case 281: 307 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 event:' + data.event); 308 that.Sub_InputMethod_IME_FullScreenAbnormal_0200(); 309 break; 310 case 282: 311 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 event:' + data.event); 312 that.Sub_InputMethod_IME_FullScreenAbnormal_0500(); 313 break; 314 case 283: 315 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 event:' + data.event); 316 that.Sub_InputMethod_IME_FullScreenAbnormal_0400(); 317 break; 318 case 284: 319 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 event:' + data.event); 320 that.Sub_InputMethod_IME_FullScreenAbnormal_0300(); 321 break; 322 case 285: 323 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 event:' + data.event); 324 that.Sub_InputMethod_IME_FullScreenAbnormal_1200(); 325 break; 326 case 286: 327 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 event:' + data.event); 328 that.Sub_InputMethod_IME_FullScreenAbnormal_0700(); 329 break; 330 case 287: 331 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 event:' + data.event); 332 that.Sub_InputMethod_IME_FullScreenAbnormal_0600(); 333 break; 334 case 288: 335 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 event:' + data.event); 336 that.Sub_InputMethod_IME_FullScreenAbnormal_0800(); 337 break; 338 case 289: 339 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 event:' + data.event); 340 that.Sub_InputMethod_IME_FullScreenAbnormal_0900(); 341 break; 342 case 290: 343 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 event:' + data.event); 344 that.Sub_InputMethod_IME_FullScreenAbnormal_1000(); 345 break; 346 case 291: 347 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 event:' + data.event); 348 that.Sub_InputMethod_IME_FullScreenUR_0200(); 349 break; 350 case 292: 351 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 event:' + data.event); 352 that.Sub_InputMethod_IME_FullScreenUR_0300(); 353 break; 354 case 293: 355 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 event:' + data.event); 356 that.Sub_InputMethod_IME_FullScreenUR_0400(); 357 break; 358 case 294: 359 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 event:' + data.event); 360 that.Sub_InputMethod_IME_FullScreenUR_0700(); 361 break; 362 case 295: 363 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 event:' + data.event); 364 that.Sub_InputMethod_IME_FullScreenAbnormal_1100(); 365 break; 366 case 296: 367 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 event:' + data.event); 368 that.Sub_InputMethod_IME_FullScreenUR_0100(); 369 break; 370 case 297: 371 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_0900 event:' + data.event); 372 that.Sub_InputMethod_IME_Immersive_0900(); 373 break; 374 case 298: 375 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1000 event:' + data.event); 376 that.Sub_InputMethod_IME_Immersive_1000(); 377 break; 378 case 299: 379 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1100 event:' + data.event); 380 that.Sub_InputMethod_IME_Immersive_1100(); 381 break; 382 case 300: 383 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1200 event:' + data.event); 384 that.Sub_InputMethod_IME_Immersive_1200(); 385 break; 386 case 301: 387 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_0500 event:' + data.event); 388 that.Sub_InputMethod_IME_Immersive_0500(); 389 break; 390 } 391 } 392 393 let unSubscriberCallback = (err) => { 394 console.info(TAG + '====>unSubscriberCallback start'); 395 if (err) { 396 console.error(TAG + '====>unSubscriberCallback failed: ' + JSON.stringify(err)); 397 } else { 398 console.info(TAG + '====>unSubscriberCallback finsh'); 399 } 400 } 401 } 402 403 public newArrayBuffer(str:string): ArrayBuffer { 404 let arrayBuffer = new ArrayBuffer(str.length); 405 const view = new Uint8Array(arrayBuffer); 406 for(let i = 0; i < str.length; i++){ 407 view[i] = str.charCodeAt(i); 408 } 409 return arrayBuffer; 410 } 411 412 public GetArrayBufferString(buffer: ArrayBuffer): string { 413 const decoder = util.TextDecoder.create('"utf-8"'); 414 const str = decoder.decodeWithStream(new Uint8Array(buffer)); 415 return str; 416 } 417 418 private initWindow(): void { 419 display.getDefaultDisplay().then(dis => { 420 let dWidth = dis.width; 421 let dHeight = dis.height; 422 let keyHeightRate = 0.47; 423 let keyHeight = dHeight * keyHeightRate; 424 this.windowWidth = dWidth; 425 this.windowHeight = keyHeight; 426 this.nonBarPosition = dHeight - keyHeight 427 428 let config = { 429 name: this.windowName, 430 windowType: windowManager.WindowType.TYPE_INPUT_METHOD, 431 ctx: this.mContext 432 }; 433 windowManager.createWindow(config).then((win) => { 434 win.resize(dWidth, keyHeight).then(() => { 435 win.moveWindowTo(0, this.nonBarPosition).then(() => { 436 win.setUIContent('testability/pages/Second').then(() => { 437 }); 438 }); 439 }); 440 }); 441 }); 442 } 443 444 private publishCallback(err): void { 445 if (err) { 446 console.error(TAG + '====>publish failed: ' + JSON.stringify(err)); 447 } else { 448 console.log(TAG + '====>publish'); 449 } 450 } 451 452 453 private Sub_Misc_inputMethod_Panel_createPanelCallback_0010(): void { 454 let commonEventPublishData; 455 let panelInfo1 = { 456 type: STATUS_BAR, 457 flag: FLG_FLOATING 458 }; 459 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 success'); 460 try { 461 inputMethodAbility.createPanel(this.mContext, panelInfo1, async (err, panel) => { 462 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel'); 463 if (err) { 464 commonEventPublishData = { 465 data: 'FAILED' 466 }; 467 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel error: ' + JSON.stringify(err)); 468 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 469 } else { 470 commonEventPublishData = { 471 data: 'SUCCESS' 472 }; 473 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 Succeed in creating panel.' + JSON.stringify(panel)); 474 } 475 await inputMethodAbility.destroyPanel(panel); 476 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 477 }) 478 } catch (error) { 479 commonEventPublishData = { 480 data: 'FAILED' 481 }; 482 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 catch error: ' + JSON.stringify(error)); 483 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 484 } 485 } 486 487 private Sub_Misc_inputMethod_Panel_createPanelPromise_0020(): void { 488 let commonEventPublishData; 489 let panelInfo1 = { 490 type: STATUS_BAR, 491 flag: FLG_FLOATING 492 }; 493 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 success'); 494 try { 495 inputMethodAbility.createPanel(this.mContext, panelInfo1).then(async (panel) => { 496 commonEventPublishData = { 497 data: 'SUCCESS' 498 }; 499 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 Succeed in creating panel.' + JSON.stringify(panel)); 500 await inputMethodAbility.destroyPanel(panel); 501 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 502 }).catch(async (err) => { 503 commonEventPublishData = { 504 data: 'FAILED' 505 }; 506 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 createPanel error: ' + JSON.stringify(err)); 507 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 508 }); 509 } catch (error) { 510 commonEventPublishData = { 511 data: 'FAILED' 512 }; 513 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 catch error: ' + JSON.stringify(error)); 514 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 515 } 516 } 517 518 private async Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030(): Promise<void> { 519 let commonEventPublishData; 520 let panelInfo1 = { 521 type: STATUS_BAR, 522 flag: FLG_FIXED 523 }; 524 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 success'); 525 try { 526 let panel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 527 inputMethodAbility.destroyPanel(panel, async (err, panel) => { 528 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel'); 529 if (err) { 530 commonEventPublishData = { 531 data: 'FAILED' 532 }; 533 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel error: ' + JSON.stringify(err)); 534 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 535 } else { 536 commonEventPublishData = { 537 data: 'SUCCESS' 538 }; 539 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 Succeed in destroying panel.' + JSON.stringify(panel)); 540 } 541 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 542 }); 543 } catch (error) { 544 commonEventPublishData = { 545 data: 'FAILED' 546 }; 547 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 catch error: ' + JSON.stringify(error)); 548 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 549 } 550 } 551 552 private async Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040(): Promise<void> { 553 let commonEventPublishData; 554 let panelInfo1 = { 555 type: STATUS_BAR, 556 flag: FLG_FIXED 557 }; 558 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 success'); 559 try { 560 let panel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 561 inputMethodAbility.destroyPanel(panel).then(async () => { 562 commonEventPublishData = { 563 data: 'SUCCESS' 564 }; 565 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 Succeed in destroyPanel panel.' + JSON.stringify(panel)); 566 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 567 }).catch(async (err) => { 568 commonEventPublishData = { 569 data: 'FAILED' 570 }; 571 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 destroyPanel error: ' + JSON.stringify(err)); 572 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 573 }); 574 } catch (error) { 575 commonEventPublishData = { 576 data: 'FAILED' 577 }; 578 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 catch error: ' + JSON.stringify(error)); 579 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 580 } 581 } 582 583 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0050(): void { 584 let commonEventPublishData; 585 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 success'); 586 try { 587 if (this.softKeyboardPanel !== null) { 588 this.softKeyboardPanel.setUiContent('testability/pages/Second', async (err, data) => { 589 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent'); 590 if (err) { 591 commonEventPublishData = { 592 data: 'FAILED' 593 }; 594 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent error: ' + JSON.stringify(err)); 595 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 596 } else { 597 commonEventPublishData = { 598 data: 'SUCCESS' 599 }; 600 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 Succeed setUiContent: ' + JSON.stringify(data)); 601 } 602 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 603 }); 604 } else { 605 commonEventPublishData = { 606 data: 'FAILED' 607 }; 608 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 this.softKeyboardPanel is null'); 609 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 610 } 611 } catch (error) { 612 commonEventPublishData = { 613 data: 'FAILED' 614 }; 615 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 catch error: ' + JSON.stringify(error)); 616 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 617 } 618 } 619 620 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0060(): void { 621 let commonEventPublishData; 622 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 success'); 623 try { 624 if (this.softKeyboardPanel !== null) { 625 this.softKeyboardPanel.setUiContent('testability/pages/Second').then(async (data) => { 626 commonEventPublishData = { 627 data: 'SUCCESS' 628 }; 629 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 Succeed in setUiContent.' + JSON.stringify(data)); 630 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 631 }).catch(async (err) => { 632 commonEventPublishData = { 633 data: 'FAILED' 634 }; 635 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 setUiContent error: ' + JSON.stringify(err)); 636 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 637 }); 638 } else { 639 commonEventPublishData = { 640 data: 'FAILED' 641 }; 642 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 this.softKeyboardPanel is null'); 643 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 644 } 645 } catch (error) { 646 commonEventPublishData = { 647 data: 'FAILED' 648 }; 649 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 catch error: ' + JSON.stringify(error)); 650 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 651 } 652 } 653 654 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0070(): void { 655 let commonEventPublishData; 656 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 success'); 657 try { 658 if (this.softKeyboardPanel !== null) { 659 this.softKeyboardPanel.setUiContent('testability/pages/Second', this.storage, async (err, data) => { 660 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 setUiContent'); 661 if (err) { 662 commonEventPublishData = { 663 data: 'FAILED' 664 }; 665 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 setUiContent error: ' + JSON.stringify(err)); 666 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 667 } else { 668 commonEventPublishData = { 669 data: 'SUCCESS' 670 }; 671 console.info(TAG + 'Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 Succeed setUiContent: ' + JSON.stringify(data)); 672 } 673 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 674 }) 675 } else { 676 commonEventPublishData = { 677 data: 'FAILED' 678 }; 679 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 this.softKeyboardPanel is null'); 680 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 681 } 682 } catch (error) { 683 commonEventPublishData = { 684 data: 'FAILED' 685 }; 686 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 catch error: ' + JSON.stringify(error)); 687 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 688 } 689 } 690 691 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0080(): void { 692 let commonEventPublishData; 693 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 success'); 694 try { 695 if (this.softKeyboardPanel !== null) { 696 this.softKeyboardPanel.setUiContent('testability/pages/Second', this.storage).then(async (data) => { 697 commonEventPublishData = { 698 data: 'SUCCESS' 699 }; 700 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 Succeed in setUiContent: ' + JSON.stringify(data)); 701 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 702 }).catch(async (err) => { 703 commonEventPublishData = { 704 data: 'FAILED' 705 }; 706 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 setUiContent error: ' + JSON.stringify(err)); 707 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 708 }); 709 } else { 710 commonEventPublishData = { 711 data: 'FAILED' 712 }; 713 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 this.softKeyboardPanel is null'); 714 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 715 } 716 } catch (error) { 717 commonEventPublishData = { 718 data: 'FAILED' 719 }; 720 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 catch error: ' + JSON.stringify(error)); 721 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 722 } 723 } 724 725 private Sub_Misc_inputMethod_Panel_resizeCallback_0090(): void { 726 let commonEventPublishData; 727 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 success'); 728 try { 729 if (this.softKeyboardPanel !== null) { 730 this.softKeyboardPanel.resize(this.windowWidth, this.windowHeight, async (err, data) => { 731 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize'); 732 if (err) { 733 commonEventPublishData = { 734 data: 'FAILED' 735 }; 736 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize error: ' + JSON.stringify(err)); 737 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 738 } else { 739 commonEventPublishData = { 740 data: 'SUCCESS' 741 }; 742 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 Succeeded in changing the panel size: ' + JSON.stringify(data)); 743 } 744 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 745 }) 746 } else { 747 commonEventPublishData = { 748 data: 'FAILED' 749 }; 750 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 this.softKeyboardPanel is null'); 751 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 752 } 753 } catch (error) { 754 commonEventPublishData = { 755 data: 'FAILED' 756 }; 757 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 catch error: ' + JSON.stringify(error)); 758 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 759 } 760 } 761 762 private Sub_Misc_inputMethod_Panel_resizePromise_0100(): void { 763 let commonEventPublishData; 764 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 success'); 765 try { 766 if (this.softKeyboardPanel !== null) { 767 this.softKeyboardPanel.resize(this.windowWidth, this.windowHeight).then(async (data) => { 768 commonEventPublishData = { 769 data: 'SUCCESS' 770 }; 771 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0100 Succeed in changing the panel size: ' + JSON.stringify(data)); 772 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 773 }).catch(async (err) => { 774 commonEventPublishData = { 775 data: 'FAILED' 776 }; 777 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 resize error: ' + JSON.stringify(err)); 778 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 779 }); 780 } else { 781 commonEventPublishData = { 782 data: 'FAILED' 783 }; 784 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 this.softKeyboardPanel is null'); 785 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 786 } 787 } catch (error) { 788 commonEventPublishData = { 789 data: 'FAILED' 790 }; 791 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 catch error: ' + JSON.stringify(error)); 792 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 793 } 794 } 795 796 private Sub_Misc_inputMethod_Panel_moveToCallback_0110(): void { 797 let commonEventPublishData; 798 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 success'); 799 try { 800 if (this.softKeyboardPanel !== null) { 801 this.softKeyboardPanel.moveTo(100, 100, async (err, data) => { 802 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo'); 803 if (err) { 804 commonEventPublishData = { 805 data: 'FAILED' 806 }; 807 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo error: ' + JSON.stringify(err)); 808 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 809 } else { 810 commonEventPublishData = { 811 data: 'SUCCESS' 812 }; 813 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 Succeed in moving the panel: ' + JSON.stringify(data)); 814 } 815 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 816 }); 817 } else { 818 commonEventPublishData = { 819 data: 'FAILED' 820 }; 821 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 this.softKeyboardPanel is null'); 822 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 823 } 824 } catch (error) { 825 commonEventPublishData = { 826 data: 'FAILED' 827 }; 828 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 catch error: ' + JSON.stringify(error)); 829 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 830 } 831 } 832 833 private Sub_Misc_inputMethod_Panel_moveToPromise_0120(): void { 834 let commonEventPublishData; 835 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 success'); 836 try { 837 if (this.softKeyboardPanel !== null) { 838 this.softKeyboardPanel.moveTo(100, 100).then(async (data) => { 839 commonEventPublishData = { 840 data: 'SUCCESS' 841 }; 842 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 Succeed in moving the panel: ' + JSON.stringify(data)); 843 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 844 }).catch(async (err) => { 845 commonEventPublishData = { 846 data: 'FAILED' 847 }; 848 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 moveTo error: ' + JSON.stringify(err)); 849 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 850 }); 851 } else { 852 commonEventPublishData = { 853 data: 'FAILED' 854 }; 855 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 this.softKeyboardPanel is null'); 856 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 857 } 858 } catch (error) { 859 commonEventPublishData = { 860 data: 'FAILED' 861 }; 862 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 catch error: ' + JSON.stringify(error)); 863 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 864 } 865 } 866 867 private Sub_Misc_inputMethod_Panel_showCallback_0130(): void { 868 let commonEventPublishData; 869 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 success'); 870 try { 871 if (this.softKeyboardPanel !== null) { 872 this.softKeyboardPanel.show(async (err, data) => { 873 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show'); 874 if (err) { 875 commonEventPublishData = { 876 data: 'FAILED' 877 }; 878 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show error: ' + JSON.stringify(err)); 879 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 880 } else { 881 commonEventPublishData = { 882 data: 'SUCCESS' 883 }; 884 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_showCallback_0130 Succeed in showing the panel: ' + JSON.stringify(data)); 885 } 886 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 887 }); 888 } else { 889 commonEventPublishData = { 890 data: 'FAILED' 891 }; 892 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 this.softKeyboardPanel is null'); 893 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 894 } 895 } catch (error) { 896 commonEventPublishData = { 897 data: 'FAILED' 898 }; 899 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 catch error: ' + JSON.stringify(error)); 900 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 901 } 902 } 903 904 private Sub_Misc_inputMethod_Panel_showPromise_0140(): void { 905 let commonEventPublishData; 906 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 success'); 907 try { 908 if (this.softKeyboardPanel !== null) { 909 this.softKeyboardPanel.show().then(async (data) => { 910 commonEventPublishData = { 911 data: 'SUCCESS' 912 }; 913 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_showPromise_0140 Succeed in showing the panel: ' + JSON.stringify(data)); 914 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 915 }).catch(async (err) => { 916 commonEventPublishData = { 917 data: 'FAILED' 918 }; 919 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 show error: ' + JSON.stringify(err)); 920 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 921 }); 922 } else { 923 commonEventPublishData = { 924 data: 'FAILED' 925 }; 926 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 this.softKeyboardPanel is null'); 927 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 928 } 929 } catch (error) { 930 commonEventPublishData = { 931 data: 'FAILED' 932 }; 933 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 catch error: ' + JSON.stringify(error)); 934 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 935 } 936 } 937 938 private Sub_Misc_inputMethod_Panel_hideCallback_0150(): void { 939 let commonEventPublishData; 940 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 success'); 941 try { 942 if (this.softKeyboardPanel !== null) { 943 this.softKeyboardPanel.hide(async (err, data) => { 944 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide'); 945 if (err) { 946 commonEventPublishData = { 947 data: 'FAILED' 948 }; 949 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide error: ' + JSON.stringify(err)); 950 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 951 } else { 952 commonEventPublishData = { 953 data: 'SUCCESS' 954 }; 955 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_hideCallback_0150 Succeed in hiding the panel: ' + JSON.stringify(data)); 956 } 957 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 958 }); 959 } else { 960 commonEventPublishData = { 961 data: 'FAILED' 962 }; 963 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 this.softKeyboardPanel is null'); 964 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 965 } 966 } catch (error) { 967 commonEventPublishData = { 968 data: 'FAILED' 969 }; 970 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 catch error: ' + JSON.stringify(error)); 971 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 972 } 973 } 974 975 private Sub_Misc_inputMethod_Panel_hidePromise_0160(): void { 976 let commonEventPublishData; 977 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 success'); 978 try { 979 if (this.softKeyboardPanel !== null) { 980 this.softKeyboardPanel.hide().then(async (data) => { 981 commonEventPublishData = { 982 data: 'SUCCESS' 983 }; 984 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_hidePromise_0160 Succeed in hiding the panel: ' + JSON.stringify(data)); 985 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 986 }).catch(async (err) => { 987 commonEventPublishData = { 988 data: 'FAILED' 989 }; 990 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 hide error: ' + JSON.stringify(err)); 991 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 992 }); 993 } else { 994 commonEventPublishData = { 995 data: 'FAILED' 996 }; 997 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 this.softKeyboardPanel is null'); 998 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 999 } 1000 } catch (error) { 1001 commonEventPublishData = { 1002 data: 'FAILED' 1003 }; 1004 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 catch error: ' + JSON.stringify(error)); 1005 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 1006 } 1007 } 1008 1009 private async Sub_Misc_inputMethod_Panel_onShow_0170(): Promise<void> { 1010 let commonEventPublishData; 1011 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 success'); 1012 try { 1013 if (this.softKeyboardPanel !== null) { 1014 this.softKeyboardPanel.on('show', async () => { 1015 commonEventPublishData = { 1016 data: 'SUCCESS' 1017 }; 1018 this.softKeyboardPanel.off('show'); 1019 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 onShow error: '); 1020 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onShow_0170 Succeed onShow: '); 1021 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1022 }); 1023 await this.softKeyboardPanel.show(); 1024 } else { 1025 commonEventPublishData = { 1026 data: 'FAILED' 1027 }; 1028 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 this.softKeyboardPanel is null'); 1029 commoneventmanager.publish('ub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1030 } 1031 } catch (error) { 1032 commonEventPublishData = { 1033 data: 'FAILED' 1034 }; 1035 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 catch error: ' + JSON.stringify(error)); 1036 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1037 } 1038 } 1039 1040 private async Sub_Misc_inputMethod_Panel_onHide_0180(): Promise<void> { 1041 let commonEventPublishData; 1042 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 success'); 1043 try { 1044 if (this.softKeyboardPanel !== null) { 1045 this.softKeyboardPanel.on('hide', async () => { 1046 commonEventPublishData = { 1047 data: 'SUCCESS' 1048 }; 1049 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 onHide'); 1050 this.softKeyboardPanel.off('hide'); 1051 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onHide_0180 Succeed onHide:'); 1052 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1053 }); 1054 await this.softKeyboardPanel.hide(); 1055 } else { 1056 commonEventPublishData = { 1057 data: 'FAILED' 1058 }; 1059 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 this.softKeyboardPanel is null'); 1060 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1061 } 1062 } catch (error) { 1063 commonEventPublishData = { 1064 data: 'FAILED' 1065 }; 1066 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 catch error: ' + JSON.stringify(error)); 1067 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1068 } 1069 } 1070 1071 private Sub_Misc_inputMethod_Panel_offShow_0190(): void { 1072 let commonEventPublishData = { 1073 data: 'FAILED' 1074 }; 1075 let count = 0; 1076 let timeCount = 0; 1077 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 success'); 1078 try { 1079 if (this.softKeyboardPanel !== null) { 1080 this.softKeyboardPanel.on('show', async (err, data) => { 1081 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 offShow if success: ' + JSON.stringify(err)); 1082 this.softKeyboardPanel.off('show'); 1083 count += 1; 1084 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 off Show count: ' + count); 1085 }); 1086 let t1 = setInterval(async () => { 1087 await this.softKeyboardPanel.show(); 1088 await this.softKeyboardPanel.hide(); 1089 timeCount += 1; 1090 console.info(TAG + '====>this.softKeyboardPanel.show setInterval timeCount: ' + timeCount); 1091 if (timeCount === 2) { 1092 clearInterval(t1); 1093 } 1094 }, 100); 1095 1096 let t2 = setTimeout(() => { 1097 console.info(TAG + '====>setTimeout count: ' + count); 1098 if (count === 1) { 1099 commonEventPublishData = { 1100 data: 'SUCCESS' 1101 }; 1102 } 1103 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1104 clearTimeout(t2); 1105 }, 500); 1106 1107 } else { 1108 commonEventPublishData = { 1109 data: 'FAILED' 1110 }; 1111 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 this.softKeyboardPanel is null'); 1112 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1113 } 1114 } catch (error) { 1115 commonEventPublishData = { 1116 data: 'FAILED' 1117 }; 1118 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 catch error: ' + JSON.stringify(error)); 1119 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1120 } 1121 } 1122 1123 private Sub_Misc_inputMethod_Panel_offHide_0200(): void { 1124 let commonEventPublishData = { 1125 data: 'FAILED' 1126 }; 1127 let count = 0; 1128 let timeCount = 0; 1129 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 success'); 1130 try { 1131 if (this.softKeyboardPanel !== null) { 1132 this.softKeyboardPanel.on('hide', async (err, data) => { 1133 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 offHide if success: ' + JSON.stringify(err)); 1134 this.softKeyboardPanel.off('hide'); 1135 count += 1; 1136 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 off hide count: ' + count); 1137 }); 1138 1139 let t1 = setInterval(async () => { 1140 ; 1141 await this.softKeyboardPanel.show(); 1142 await this.softKeyboardPanel.hide(); 1143 timeCount += 1; 1144 console.info(TAG + '====>this.softKeyboardPanel.hide setInterval timeCount: ' + timeCount); 1145 if (timeCount === 2) { 1146 clearInterval(t1); 1147 } 1148 }, 300); 1149 1150 let t2 = setTimeout(() => { 1151 console.info(TAG + '====>setTimeout count: ' + count); 1152 if (count === 1) { 1153 commonEventPublishData = { 1154 data: 'SUCCESS' 1155 }; 1156 } 1157 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1158 clearTimeout(t2); 1159 }, 1000); 1160 1161 } else { 1162 commonEventPublishData = { 1163 data: 'FAILED' 1164 }; 1165 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 this.softKeyboardPanel is null'); 1166 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1167 } 1168 } catch (error) { 1169 commonEventPublishData = { 1170 data: 'FAILED' 1171 }; 1172 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 catch error: ' + JSON.stringify(error)); 1173 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1174 } 1175 } 1176 1177 private Sub_Misc_inputMethod_Panel_changeFlag_0210(): void { 1178 let commonEventPublishData = { 1179 data: 'FAILED' 1180 }; 1181 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 success'); 1182 try { 1183 if (this.softKeyboardPanel !== null) { 1184 try { 1185 this.softKeyboardPanel.changeFlag(1); 1186 commonEventPublishData = { 1187 data: 'SUCCESS' 1188 }; 1189 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1190 } catch (err) { 1191 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0210 throw_error: ' + err); 1192 } 1193 1194 } else { 1195 commonEventPublishData = { 1196 data: 'FAILED' 1197 }; 1198 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 this.softKeyboardPanel is null'); 1199 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1200 } 1201 } catch (error) { 1202 commonEventPublishData = { 1203 data: 'FAILED' 1204 }; 1205 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 catch error: ' + JSON.stringify(error)); 1206 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1207 } 1208 } 1209 1210 private Sub_Misc_inputMethod_Panel_changeFlag_0211(): void { 1211 let commonEventPublishData = { 1212 data: 'FAILED' 1213 }; 1214 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 success'); 1215 try { 1216 if (this.softKeyboardPanel !== null) { 1217 try { 1218 let fla_fixed = inputmethodengine.PanelFlag.FLG_FIXED; 1219 let fla_floating = inputmethodengine.PanelFlag.FLG_FLOATING; 1220 this.softKeyboardPanel.changeFlag(fla_fixed); 1221 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 switch to fla_fixed'); 1222 this.softKeyboardPanel.changeFlag(fla_floating); 1223 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 switch to fla_floating'); 1224 commonEventPublishData = { 1225 data: 'SUCCESS' 1226 }; 1227 } catch (err) { 1228 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 throw_error: ' + err); 1229 } 1230 } else { 1231 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 this.softKeyboardPanel is null'); 1232 } 1233 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0211', commonEventPublishData, this.publishCallback); 1234 } catch (error) { 1235 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 catch error: ' + JSON.stringify(error)); 1236 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0211', commonEventPublishData, this.publishCallback); 1237 } 1238 } 1239 1240 private Sub_InputMethod_IMF_SecurityKeyboard_0600(): void { 1241 let commonEventPublishData = { 1242 data: 'FAILED' 1243 }; 1244 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 success'); 1245 try { 1246 if (this.softKeyboardPanel !== null) { 1247 try { 1248 let isPrivacyMode: boolean = true; 1249 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1250 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 success switch to PrivacyMode'); 1251 commonEventPublishData = { 1252 data: 'SUCCESS' 1253 }; 1254 } catch (err) { 1255 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 Failed to set privacy mode' + err); 1256 commonEventPublishData = { 1257 data: 'FAILED' 1258 }; 1259 } 1260 } else { 1261 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 this.softKeyboardPanel is null'); 1262 } 1263 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0600', commonEventPublishData, this.publishCallback); 1264 } catch (error) { 1265 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 catch error: ' + JSON.stringify(error)); 1266 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0600', commonEventPublishData, this.publishCallback); 1267 } 1268 } 1269 1270 private Sub_InputMethod_IMF_SecurityKeyboard_0700(): void { 1271 let commonEventPublishData = { 1272 data: 'FAILED' 1273 }; 1274 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 success'); 1275 try { 1276 if (this.softKeyboardPanel !== null) { 1277 try { 1278 let isPrivacyMode: boolean = false; 1279 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1280 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 success switch to PrivacyMode'); 1281 commonEventPublishData = { 1282 data: 'SUCCESS' 1283 }; 1284 } catch (err) { 1285 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 Failed to set privacy mode' + err); 1286 commonEventPublishData = { 1287 data: 'FAILED' 1288 }; 1289 } 1290 } else { 1291 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 this.softKeyboardPanel is null'); 1292 } 1293 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0700', commonEventPublishData, this.publishCallback); 1294 } catch (error) { 1295 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 catch error: ' + JSON.stringify(error)); 1296 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0700', commonEventPublishData, this.publishCallback); 1297 } 1298 } 1299 1300 private Sub_InputMethod_IMF_SecurityKeyboard_0800(): void { 1301 let commonEventPublishData = { 1302 data: 'FAILED' 1303 }; 1304 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 success'); 1305 try { 1306 if (this.softKeyboardPanel !== null) { 1307 try { 1308 let isPrivacyMode: boolean = undefined; 1309 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1310 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 success switch to PrivacyMode'); 1311 } catch (err) { 1312 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 Failed to set privacy mode catch: ' + err); 1313 if (err.code === 401) { 1314 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 Failed to set privacy mode002: ' + err); 1315 commonEventPublishData = { 1316 data: 'SUCCESS' 1317 }; 1318 } 1319 } 1320 } else { 1321 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 this.softKeyboardPanel is null'); 1322 } 1323 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0800', commonEventPublishData, this.publishCallback); 1324 } catch (error) { 1325 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 catch error: ' + JSON.stringify(error)); 1326 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0800', commonEventPublishData, this.publishCallback); 1327 } 1328 } 1329 1330 private Sub_InputMethod_IMF_getSecurityMode_0100(): void { 1331 let commonEventPublishData = { 1332 data: 'FAILED' 1333 }; 1334 console.info(TAG + '====>receive Sub_InputMethod_IMF_getSecurityMode_0100 success'); 1335 try { 1336 let mode1: inputmethodengine.SecurityMode = inputMethodAbility.getSecurityMode(); 1337 if (mode1 === inputmethodengine.SecurityMode.BASIC || mode1 === inputmethodengine.SecurityMode.FULL) { 1338 console.info(TAG + '====>getSecurityMode, securityMode is : ${mode1}'); 1339 commonEventPublishData = { 1340 data: 'SUCCESS' 1341 }; 1342 commoneventmanager.publish('Sub_InputMethod_IMF_getSecurityMode_0100', commonEventPublishData, this.publishCallback); 1343 } else { 1344 commonEventPublishData = { 1345 data: 'FAILED' 1346 }; 1347 console.info(TAG + '====>Failed to getSecurityMode: ${JSON.stringify(err)}'); 1348 } 1349 } catch (error) { 1350 commonEventPublishData = { 1351 data: 'FAILED' 1352 }; 1353 console.info(TAG + '====>receive Sub_InputMethod_IMF_getSecurityMode_0100 catch error: ' + JSON.stringify(error)); 1354 commoneventmanager.publish('Sub_InputMethod_IMF_getSecurityMode_0100', commonEventPublishData, this.publishCallback); 1355 } 1356 } 1357 1358 private async SUB_InputMethod_IME_SplitScreen_0100(): Promise<void> { 1359 let commonEventPublishData = { 1360 data: 'FAILED' 1361 }; 1362 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 start'); 1363 try { 1364 if (this.softKeyboardPanel !== null) { 1365 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 this.softKeyboardPanel:' + this.softKeyboardPanel); 1366 let t = setTimeout(async () => { 1367 clearTimeout(t); 1368 try { 1369 let WindowInfo = await this.InputClient.getCallingWindowInfo(); 1370 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo WindowInfo:' + JSON.stringify(WindowInfo)); 1371 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo rect: ' + JSON.stringify(WindowInfo.rect)); 1372 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo status: ' + JSON.stringify(WindowInfo.status)); 1373 if (typeof (WindowInfo) === 'object' && typeof (WindowInfo.rect) === 'object' && typeof (WindowInfo.status) === 'number') { 1374 commonEventPublishData = { 1375 data: "SUCCESS" 1376 } 1377 } 1378 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo WindowInfo: success'); 1379 } catch (err) { 1380 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInf0 err: ' + JSON.stringify(err.message)); 1381 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInf0 err: ' + JSON.stringify(err.code)); 1382 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfO err: ' + err); 1383 } 1384 commoneventmanager.publish("SUB_InputMethod_IME_SplitScreen_0100", commonEventPublishData, this.publishCallback); 1385 1386 }, 500); 1387 1388 } else { 1389 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo softKeyboardPanel is null '); 1390 } 1391 1392 } catch (error) { 1393 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 catch error: ' + JSON.stringify(error.message)); 1394 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 catch error: ' + JSON.stringify(error.code)) 1395 commoneventmanager.publish('SUB_InputMethod_IME_SplitScreen_0100', commonEventPublishData, this.publishCallback); 1396 } 1397 } 1398 1399 private async Sub_InputMethod_IME_ScreenRotation_0100() { 1400 console.info(TAG + '====>receive Sub_InputMethod_IME_ScreenRotation_0100 data'); 1401 let commonEventPublishData = { 1402 data: "FAILED" 1403 }; 1404 try{ 1405 let keyboardRect: inputMethodEngine.PanelRect = { 1406 landscapeRect: { left: 100, top: 100, width: this.display_info.width, height: this.display_info.height*0.4}, 1407 portraitRect: { left: 100, top: 100, width: this.display_info.height*0.4, height: this.display_info.width} 1408 } 1409 this.softKeyboardPanel.adjustPanelRect(inputMethodEngine.PanelFlag.FLG_FIXED, keyboardRect); 1410 commonEventPublishData = { 1411 data: "SUCCESS" 1412 } 1413 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 startAbility success' ); 1414 } catch (err) { 1415 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 err: ' + JSON.stringify(err)); 1416 } 1417 commoneventmanager.publish("Sub_InputMethod_IME_ScreenRotation_0100", commonEventPublishData, this.publishCallback); 1418 } 1419 1420 private async Sub_InputMethod_IME_ScreenRotation_0200() { 1421 console.info(TAG + '====>receive Sub_InputMethod_IME_ScreenRotation_0200 data'); 1422 let commonEventPublishData = { 1423 data: "FAILED" 1424 }; 1425 try{ 1426 let keyboardRect: inputMethodEngine.PanelRect = { 1427 landscapeRect: { left: 100, top: 100, width: this.display_info.width, height: this.display_info.height*0.4}, 1428 portraitRect: { left: 100, top: 100, width: this.display_info.height*0.4, height: this.display_info.width} 1429 } 1430 this.softKeyboardPanel.adjustPanelRect(inputMethodEngine.PanelFlag.FLG_FLOATING, keyboardRect); 1431 commonEventPublishData = { 1432 data: "SUCCESS" 1433 } 1434 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 startAbility success' ); 1435 } catch (err) { 1436 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 err: ' + JSON.stringify(err)); 1437 } 1438 commoneventmanager.publish("Sub_InputMethod_IME_ScreenRotation_0200", commonEventPublishData, this.publishCallback); 1439 } 1440 1441 private async Sub_Misc_inputMethod_Panel_onSizeChange_0100(): Promise<void> { 1442 let commonEventPublishData; 1443 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 success'); 1444 try { 1445 if (this.softKeyboardPanel !== null) { 1446 this.softKeyboardPanel.on('sizeChange', async (size) => { 1447 commonEventPublishData = { 1448 data: 'SUCCESS' 1449 }; 1450 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 onSizeChange'); 1451 this.softKeyboardPanel.off('sizeChange'); 1452 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 offSizeChange'); 1453 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1454 }) 1455 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.width1: ' + this.display_info.width); 1456 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.height1: ' + this.display_info.height); 1457 await this.softKeyboardPanel.resize(200, 100); 1458 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.width2: ' + this.display_info.width); 1459 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.height2: ' + this.display_info.height); 1460 } else { 1461 commonEventPublishData = { 1462 data: 'FAILED' 1463 }; 1464 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 this.softKeyboardPanel is null'); 1465 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1466 } 1467 } catch (error) { 1468 commonEventPublishData = { 1469 data: 'FAILED' 1470 }; 1471 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 catch error: ' + JSON.stringify(error)); 1472 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1473 } 1474 } 1475 1476 private async Sub_Misc_inputMethod_Panel_onSizeChange_0200(): Promise<void> { 1477 let commonEventPublishData = { 1478 data: 'FAILED' 1479 }; 1480 let count = 0; 1481 let timeCount = 0; 1482 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 success'); 1483 try { 1484 if (this.softKeyboardPanel !== null) { 1485 this.softKeyboardPanel.on('sizeChange', async (size) => { 1486 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 onSizeChange'); 1487 this.softKeyboardPanel.off('sizeChange'); 1488 count += 1; 1489 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 off SizeChange count: ' + count); 1490 }) 1491 let flage:boolean = true; 1492 let t1 = setInterval(async () => { 1493 if(flage === true){ 1494 flage = false; 1495 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.width: ' + this.display_info.width); 1496 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.height: ' + this.display_info.height); 1497 await this.softKeyboardPanel.resize(200, 120); 1498 }else{ 1499 flage = true; 1500 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.width: ' + this.display_info.width); 1501 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.height: ' + this.display_info.height); 1502 await this.softKeyboardPanel.resize(200, 130); 1503 } 1504 timeCount += 1; 1505 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 timeCount: ' + timeCount); 1506 if (timeCount ===2){ 1507 clearInterval(t1) 1508 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 clearInterval success'); 1509 } 1510 }, 100) 1511 1512 let t2 = setTimeout(() => { 1513 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 count: ' + count); 1514 if (count === 1){ 1515 commonEventPublishData = { 1516 data: 'SUCCESS' 1517 }; 1518 } 1519 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1520 clearTimeout(t2); 1521 }, 500) 1522 1523 } else { 1524 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 this.softKeyboardPanel is null'); 1525 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1526 } 1527 } catch (error) { 1528 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 catch error: ' + JSON.stringify(error)); 1529 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1530 } 1531 } 1532 1533 private Sub_InputMethod_IME_Dragging_1100(): void { 1534 let commonEventPublishData = { 1535 data: 'FAILED' 1536 }; 1537 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 success'); 1538 try { 1539 if (this.softKeyboardPanel !== null) { 1540 try { 1541 this.softKeyboardPanel.startMoving(); 1542 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 startMoving success'); 1543 } catch (err) { 1544 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 startMoving err' + JSON.stringify(err)); 1545 if(err.code === 12800017){ 1546 commonEventPublishData = { 1547 data: 'SUCCESS' 1548 }; 1549 } 1550 } 1551 } else { 1552 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 this.softKeyboardPanel is null'); 1553 } 1554 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_1100', commonEventPublishData, this.publishCallback); 1555 } catch (error) { 1556 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 catch error: ' + JSON.stringify(error)); 1557 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_1100', commonEventPublishData, this.publishCallback); 1558 } 1559 } 1560 1561 private async Sub_InputMethod_IME_Dragging_0800(): Promise<void> { 1562 let commonEventPublishData = { 1563 data: 'FAILED' 1564 }; 1565 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 success'); 1566 try { 1567 if (this.softKeyboardPanel !== null) { 1568 try { 1569 let num = await this.softKeyboardPanel.getDisplayId(); 1570 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 typeof num: ' + typeof(num)); 1571 if(typeof(num) === 'number'){ 1572 commonEventPublishData = { 1573 data: 'SUCCESS' 1574 }; 1575 } 1576 } catch (err) { 1577 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 getDisplayId err' + JSON.stringify(err)); 1578 } 1579 } else { 1580 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 this.softKeyboardPanel is null'); 1581 } 1582 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0800', commonEventPublishData, this.publishCallback); 1583 } catch (error) { 1584 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 catch error: ' + JSON.stringify(error)); 1585 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0800', commonEventPublishData, this.publishCallback); 1586 } 1587 } 1588 1589 private async Sub_InputMethod_IME_Dragging_0900(): Promise<void> { 1590 let commonEventPublishData = { 1591 data: 'FAILED' 1592 }; 1593 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 success'); 1594 try { 1595 let panelInfo: inputMethodEngine.PanelInfo = { 1596 type: inputMethodEngine.PanelType.STATUS_BAR, 1597 flag: inputMethodEngine.PanelFlag.FLG_FLOATING 1598 } 1599 inputMethodAbility.createPanel(this.mContext, panelInfo).then(async(inputPanel: inputMethodEngine.Panel) => { 1600 if(inputPanel){ 1601 let wid = Math.floor(this.display_info.width * 0.4); 1602 let hei = Math.floor(this.display_info.height * 0.5); 1603 console.info(TAG + `====>Sub_InputMethod_IME_Dragging_0900 wid: ${wid},hei: ${hei}`); 1604 await inputPanel.resize(wid, hei); 1605 let wid_ = Math.floor(this.display_info.width * 0.3); 1606 let hei_ = Math.floor(this.display_info.height * 0.4); 1607 console.info(TAG + `====>Sub_InputMethod_IME_Dragging_0900 wid_: ${wid_},hei_: ${hei_}`); 1608 await inputPanel.moveTo(wid_, hei_); 1609 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 creat panel success!'); 1610 let displayId = await inputPanel.getDisplayId(); 1611 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 getDisplayId success!'); 1612 commonEventPublishData = { 1613 data: typeof displayId 1614 }; 1615 } 1616 await inputMethodAbility.destroyPanel(inputPanel); 1617 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1618 }).catch((err) => { 1619 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 creat panel throw err: ' + JSON.stringify(err)); 1620 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1621 }) 1622 } catch (error) { 1623 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 catch error: ' + JSON.stringify(error)); 1624 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1625 } 1626 } 1627 1628 private Sub_InputMethod_IME_Custom_0900(): void { 1629 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0900 data'); 1630 let commonEventPublishData = { 1631 data: 'FAILED' 1632 }; 1633 try { 1634 let that = this; 1635 let msgHandler: inputMethodEngine.MessageHandler = { 1636 onTerminated(): void { 1637 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0900 onTerminated'); 1638 }, 1639 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1640 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 onMessage msgId: ' + msgId + ', msgParam: ' + 1641 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1642 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 sedMessages msgIdSize: ' + msgId.length + ', msgParamSize: ' + 1643 that.GetArrayBufferString(msgParam)?.length + ', ArrayBufferSize' + msgParam?.byteLength); 1644 if(msgId === 'Sub_InputMethod_IME_Custom_0900'){ 1645 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 start sendMessage'); 1646 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0900', that.newArrayBuffer('SUCCESS')) 1647 }else{ 1648 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0900', that.newArrayBuffer('FAILED')) 1649 } 1650 that.InputClient.recvMessage() 1651 } 1652 } 1653 this.InputClient.recvMessage(msgHandler); 1654 commonEventPublishData = { 1655 data: 'SUCCESS' 1656 }; 1657 } catch (error) { 1658 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0900 recvMessage catch err!'); 1659 } 1660 let t = setTimeout(() => { 1661 clearTimeout(t); 1662 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0900', commonEventPublishData, this.publishCallback); 1663 }, 100) 1664 } 1665 1666 private Sub_InputMethod_IME_Custom_0200(): void { 1667 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0200 data'); 1668 let commonEventPublishData = { 1669 data: 'FAILED' 1670 }; 1671 try { 1672 let that = this; 1673 let msgHandler: inputMethodEngine.MessageHandler = { 1674 onTerminated(): void { 1675 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0200 onTerminated'); 1676 }, 1677 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1678 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 onMessage msgId: ' + msgId + ', msgParam: ' + 1679 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1680 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 sedMessages msgIdSize: ' + msgId.length + ', msgParamSize: ' + 1681 that.GetArrayBufferString(msgParam)?.length + ', ArrayBufferSize' + msgParam?.byteLength); 1682 if(msgId.length === 256 && msgParam?.byteLength === 131072){ 1683 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 start sendMessage'); 1684 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0200', that.newArrayBuffer('SUCCESS')) 1685 }else{ 1686 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0200', that.newArrayBuffer('FAILED')) 1687 } 1688 that.InputClient.recvMessage() 1689 } 1690 } 1691 this.InputClient.recvMessage(msgHandler); 1692 commonEventPublishData = { 1693 data: 'SUCCESS' 1694 }; 1695 } catch (error) { 1696 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0200 recvMessage catch err!'); 1697 } 1698 let t = setTimeout(() => { 1699 clearTimeout(t); 1700 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0200', commonEventPublishData, this.publishCallback); 1701 }, 100) 1702 } 1703 1704 private Sub_InputMethod_IME_Custom_0800(): void { 1705 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0800 data'); 1706 let commonEventPublishData = { 1707 data: 'FAILED' 1708 }; 1709 try { 1710 let that = this; 1711 let msgHandler: inputMethodEngine.MessageHandler = { 1712 onTerminated(): void { 1713 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0800 onTerminated'); 1714 }, 1715 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1716 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 onMessage msgId: ' + msgId + ', msgParam: ' + 1717 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1718 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 sedMessages msgIdSize: ' + msgId.length + ', msgParamSize: ' + 1719 that.GetArrayBufferString(msgParam)?.length + ', ArrayBufferSize' + msgParam?.byteLength); 1720 if(msgId.length === 0 && msgParam?.byteLength === 131072){ 1721 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 start sendMessage'); 1722 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0800', that.newArrayBuffer('SUCCESS')) 1723 }else{ 1724 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0800', that.newArrayBuffer('FAILED')) 1725 } 1726 that.InputClient.recvMessage() 1727 } 1728 } 1729 this.InputClient.recvMessage(msgHandler); 1730 commonEventPublishData = { 1731 data: 'SUCCESS' 1732 }; 1733 } catch (error) { 1734 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0800 recvMessage catch err!'); 1735 } 1736 let t = setTimeout(() => { 1737 clearTimeout(t); 1738 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0800', commonEventPublishData, this.publishCallback); 1739 }, 100) 1740 } 1741 1742 private Sub_InputMethod_IME_Custom_0400(): void { 1743 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0400 data'); 1744 let commonEventPublishData = { 1745 data: 'FAILED' 1746 }; 1747 try { 1748 let that = this; 1749 let msgHandler: inputMethodEngine.MessageHandler = { 1750 onTerminated(): void { 1751 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0400 onTerminated'); 1752 }, 1753 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1754 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0400 onMessage msgId: ' + msgId + ', msgParam: ' + 1755 that.GetArrayBufferString(msgParam) ); 1756 that.InputClient.recvMessage() 1757 } 1758 } 1759 this.InputClient.recvMessage(msgHandler); 1760 commonEventPublishData = { 1761 data: 'SUCCESS' 1762 }; 1763 } catch (error) { 1764 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0400 recvMessage catch err!'); 1765 } 1766 let t = setTimeout(() => { 1767 clearTimeout(t); 1768 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0400', commonEventPublishData, this.publishCallback); 1769 }, 100) 1770 } 1771 1772 private Sub_InputMethod_IME_Custom_0300(): void { 1773 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0300 data'); 1774 let commonEventPublishData = { 1775 data: 'FAILED' 1776 }; 1777 try { 1778 let that = this; 1779 let msgHandler: inputMethodEngine.MessageHandler = { 1780 onTerminated(): void { 1781 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0300 onTerminated'); 1782 }, 1783 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1784 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0300 onMessage msgId: ' + msgId + ', msgParam: ' + 1785 that.GetArrayBufferString(msgParam) ); 1786 that.InputClient.recvMessage() 1787 } 1788 } 1789 this.InputClient.recvMessage(msgHandler); 1790 commonEventPublishData = { 1791 data: 'SUCCESS' 1792 }; 1793 } catch (error) { 1794 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0300 recvMessage catch err!'); 1795 } 1796 let t = setTimeout(() => { 1797 clearTimeout(t); 1798 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0300', commonEventPublishData, this.publishCallback); 1799 }, 100) 1800 } 1801 1802 private Sub_InputMethod_IME_Custom_1100(): void { 1803 console.info(TAG +'====>Sub_InputMethod_IME_Custom_1100 data'); 1804 let commonEventPublishData = { 1805 data: 'FAILED' 1806 }; 1807 try { 1808 let that = this; 1809 let msgHandler: inputMethodEngine.MessageHandler = { 1810 onTerminated(): void { 1811 console.info(TAG +'====>Sub_InputMethod_IME_Custom_1100 onTerminated'); 1812 }, 1813 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1814 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 onMessage msgId: ' + msgId + ', msgParam: ' + 1815 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1816 if(msgId.length === 256 && msgParam?.byteLength === undefined){ 1817 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 start sendMessage'); 1818 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_1100', that.newArrayBuffer('SUCCESS')) 1819 }else{ 1820 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_1100', that.newArrayBuffer('FAILED')) 1821 } 1822 that.InputClient.recvMessage() 1823 } 1824 } 1825 this.InputClient.recvMessage(msgHandler); 1826 commonEventPublishData = { 1827 data: 'SUCCESS' 1828 }; 1829 } catch (error) { 1830 console.info(TAG +'====>Sub_InputMethod_IME_Custom_1100 recvMessage catch err!'); 1831 } 1832 let t = setTimeout(() => { 1833 clearTimeout(t); 1834 commoneventmanager.publish('Sub_InputMethod_IME_Custom_1100', commonEventPublishData, this.publishCallback); 1835 }, 100) 1836 } 1837 1838 private async Sub_InputMethod_IME_Attach_0100() { 1839 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0100 data'); 1840 let commonEventPublishData = { 1841 data: "FAILED" 1842 }; 1843 try{ 1844 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 1845 inputMethodAbility.off('inputStart'); 1846 this.keyboardController = keyboardController; 1847 this.InputClient = InputClient; 1848 1849 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0100 inputMethonAbility inputStart into'); 1850 commonEventPublishData = { 1851 data: "SUCCESS" 1852 }; 1853 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0100", commonEventPublishData, this.publishCallback); 1854 }) 1855 commonEventPublishData = { 1856 data: "on_SUCCESS" 1857 }; 1858 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0100", commonEventPublishData, this.publishCallback); 1859 } catch (err) { 1860 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0100 err: ' + JSON.stringify(err)); 1861 } 1862 } 1863 1864 private async Sub_InputMethod_IME_Attach_0200() { 1865 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0200 data'); 1866 let commonEventPublishData = { 1867 data: "FAILED" 1868 }; 1869 try{ 1870 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 1871 inputMethodAbility.off('inputStart'); 1872 this.keyboardController = keyboardController; 1873 this.InputClient = InputClient; 1874 1875 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0200 inputMethonAbility inputStart into'); 1876 commonEventPublishData = { 1877 data: "SUCCESS" 1878 }; 1879 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0200", commonEventPublishData, this.publishCallback); 1880 }) 1881 commonEventPublishData = { 1882 data: "on_SUCCESS" 1883 }; 1884 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0200", commonEventPublishData, this.publishCallback); 1885 } catch (err) { 1886 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0200 err: ' + JSON.stringify(err)); 1887 } 1888 } 1889 1890 private async Sub_InputMethod_IME_Attach_0300() { 1891 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0300 data'); 1892 let commonEventPublishData = { 1893 data: "FAILED" 1894 }; 1895 try{ 1896 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 1897 inputMethodAbility.off('inputStart'); 1898 this.keyboardController = keyboardController; 1899 this.InputClient = InputClient; 1900 1901 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0300 inputMethonAbility inputStart into'); 1902 commonEventPublishData = { 1903 data: "SUCCESS" 1904 }; 1905 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0300", commonEventPublishData, this.publishCallback); 1906 }) 1907 commonEventPublishData = { 1908 data: "on_SUCCESS" 1909 }; 1910 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0300", commonEventPublishData, this.publishCallback); 1911 } catch (err) { 1912 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0300 err: ' + JSON.stringify(err)); 1913 } 1914 } 1915 1916 private async Sub_InputMethod_IME_Attach_0400() { 1917 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0400 data'); 1918 let commonEventPublishData = { 1919 data: "FAILED" 1920 }; 1921 try{ 1922 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 1923 inputMethodAbility.off('inputStart'); 1924 this.keyboardController = keyboardController; 1925 this.InputClient = InputClient; 1926 1927 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0400 inputMethonAbility inputStart into'); 1928 commonEventPublishData = { 1929 data: "SUCCESS" 1930 }; 1931 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0400", commonEventPublishData, this.publishCallback); 1932 }) 1933 commonEventPublishData = { 1934 data: "on_SUCCESS" 1935 }; 1936 commoneventmanager.publish("Sub_InputMethod_IME_Attach_0400", commonEventPublishData, this.publishCallback); 1937 } catch (err) { 1938 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0400 err: ' + JSON.stringify(err)); 1939 } 1940 } 1941 1942 private async Sub_InputMethod_IME_ShowTextInput_0100() { 1943 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 data'); 1944 let commonEventPublishData = { 1945 data: 'FAILED' 1946 }; 1947 try { 1948 if (this.softKeyboardPanel !== null) { 1949 this.softKeyboardPanel.on('show', async () => { 1950 commonEventPublishData = { 1951 data: 'SUCCESS' 1952 }; 1953 this.softKeyboardPanel.off('show'); 1954 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 onShow error: '); 1955 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0100 Succeed onShow: '); 1956 commoneventmanager.publish( 1957 'Sub_InputMethod_IME_ShowTextInput_0100', commonEventPublishData, this.publishCallback); 1958 }); 1959 } 1960 commonEventPublishData = { 1961 data: "on_SUCCESS" 1962 }; 1963 commoneventmanager.publish("Sub_InputMethod_IME_ShowTextInput_0100", commonEventPublishData, this.publishCallback); 1964 } catch (error) { 1965 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 catch error: ' + JSON.stringify(error)); 1966 } 1967 } 1968 1969 private async Sub_InputMethod_IME_ShowTextInput_0200() { 1970 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 data'); 1971 let commonEventPublishData = { 1972 data: 'FAILED' 1973 }; 1974 try { 1975 if (this.softKeyboardPanel !== null) { 1976 this.softKeyboardPanel.on('show', async () => { 1977 commonEventPublishData = { 1978 data: 'SUCCESS' 1979 }; 1980 this.softKeyboardPanel.off('show'); 1981 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 onShow error: '); 1982 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0200 Succeed onShow: '); 1983 commoneventmanager.publish( 1984 'Sub_InputMethod_IME_ShowTextInput_0200', commonEventPublishData, this.publishCallback); 1985 }); 1986 } 1987 commonEventPublishData = { 1988 data: "on_SUCCESS" 1989 }; 1990 commoneventmanager.publish("Sub_InputMethod_IME_ShowTextInput_0200", commonEventPublishData, this.publishCallback); 1991 } catch (error) { 1992 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 catch error: ' + JSON.stringify(error)); 1993 } 1994 } 1995 1996 private async Sub_InputMethod_IME_ShowTextInput_0300() { 1997 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 data'); 1998 let commonEventPublishData = { 1999 data: 'FAILED' 2000 }; 2001 try { 2002 if (this.softKeyboardPanel !== null) { 2003 this.softKeyboardPanel.on('show', async () => { 2004 commonEventPublishData = { 2005 data: 'SUCCESS' 2006 }; 2007 this.softKeyboardPanel.off('show'); 2008 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 onShow error: '); 2009 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0300 Succeed onShow: '); 2010 commoneventmanager.publish( 2011 'Sub_InputMethod_IME_ShowTextInput_0300', commonEventPublishData, this.publishCallback); 2012 }); 2013 } 2014 commonEventPublishData = { 2015 data: "on_SUCCESS" 2016 }; 2017 commoneventmanager.publish("Sub_InputMethod_IME_ShowTextInput_0300", commonEventPublishData, this.publishCallback); 2018 } catch (error) { 2019 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 catch error: ' + JSON.stringify(error)); 2020 } 2021 } 2022 2023 private async Sub_InputMethod_IME_ShowTextInput_0400() { 2024 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 data'); 2025 let commonEventPublishData = { 2026 data: 'FAILED' 2027 }; 2028 try { 2029 if (this.softKeyboardPanel !== null) { 2030 this.softKeyboardPanel.on('show', async () => { 2031 commonEventPublishData = { 2032 data: 'SUCCESS' 2033 }; 2034 this.softKeyboardPanel.off('show'); 2035 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 onShow error: '); 2036 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0400 Succeed onShow: '); 2037 commoneventmanager.publish( 2038 'Sub_InputMethod_IME_ShowTextInput_0400', commonEventPublishData, this.publishCallback); 2039 }); 2040 } 2041 commonEventPublishData = { 2042 data: "on_SUCCESS" 2043 }; 2044 commoneventmanager.publish("Sub_InputMethod_IME_ShowTextInput_0400", commonEventPublishData, this.publishCallback); 2045 } catch (error) { 2046 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 catch error: ' + JSON.stringify(error)); 2047 } 2048 } 2049 2050 private async Sub_InputMethod_IME_FullScreenAbnormal_0100() { 2051 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0100 data'); 2052 let commonEventPublishData = { 2053 data: "FAILED" 2054 }; 2055 try{ 2056 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2057 portraitRect: { left: 0, top: 0, width: this.display_info.width, height: this.display_info.height*0.5}, 2058 landscapeAvoidY: 500, 2059 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2060 portraitAvoidY: 1960, 2061 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2062 }; 2063 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2064 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 success '); 2065 } catch (err) { 2066 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 cathch err: ' + JSON.stringify(err)); 2067 if(err.code === 401){ 2068 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 Failed to adjustPanelRect err is ' + err); 2069 commonEventPublishData = { 2070 data: "SUCCESS" 2071 } 2072 } 2073 } 2074 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0100", commonEventPublishData, this.publishCallback); 2075 } 2076 2077 private async Sub_InputMethod_IME_FullScreenAbnormal_0200() { 2078 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0200 data'); 2079 let commonEventPublishData = { 2080 data: "FAILED" 2081 }; 2082 try{ 2083 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2084 landscapeRect: { left: 0, top: 0, width: this.display_info.height, height: this.display_info.width*0.5}, 2085 landscapeAvoidY: 500, 2086 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2087 portraitAvoidY: 1950, 2088 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2089 fullScreenMode:false 2090 }; 2091 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2092 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 success '); 2093 } catch (err) { 2094 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 cathch err: ' + JSON.stringify(err)); 2095 if(err.code === 401){ 2096 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 Failed to adjustPanelRect err is ' + err); 2097 commonEventPublishData = { 2098 data: "SUCCESS" 2099 } 2100 } 2101 } 2102 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0200", commonEventPublishData, this.publishCallback); 2103 } 2104 2105 private async Sub_InputMethod_IME_FullScreenAbnormal_0500() { 2106 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0500 data'); 2107 let commonEventPublishData = { 2108 data: "FAILED" 2109 }; 2110 try{ 2111 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2112 landscapeRect: { left: 0, top: 3000, width: this.display_info.height+2000, height: this.display_info.width+2000}, 2113 portraitRect: { left: 0, top: 3000, width: this.display_info.width+2000, height: this.display_info.height+2000}, 2114 landscapeAvoidY: 500, 2115 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2116 portraitAvoidY: 1950, 2117 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2118 fullScreenMode:false 2119 }; 2120 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2121 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 success '); 2122 } catch (err) { 2123 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 cathch err: ' + JSON.stringify(err)); 2124 if(err.code === 401){ 2125 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 Failed to adjustPanelRect err is ' + err); 2126 commonEventPublishData = { 2127 data: "SUCCESS" 2128 } 2129 } 2130 } 2131 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0500", commonEventPublishData, this.publishCallback); 2132 } 2133 2134 private async Sub_InputMethod_IME_FullScreenAbnormal_0400() { 2135 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0400 data'); 2136 let commonEventPublishData = { 2137 data: "FAILED" 2138 }; 2139 try{ 2140 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2141 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2142 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2143 landscapeAvoidY: 500, 2144 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150},{ left: 0, top: 247, width: this.display_info.height, height: 150},{ left: 0, top: 247, width: this.display_info.height, height: 150},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2145 portraitAvoidY: 1950, 2146 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2147 fullScreenMode:true 2148 }; 2149 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2150 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 success '); 2151 } catch (err) { 2152 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 cathch err: ' + JSON.stringify(err)); 2153 if(err.code === 401){ 2154 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 Failed to adjustPanelRect err is ' + err); 2155 commonEventPublishData = { 2156 data: "SUCCESS" 2157 } 2158 } 2159 } 2160 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0400", commonEventPublishData, this.publishCallback); 2161 } 2162 2163 private async Sub_InputMethod_IME_FullScreenAbnormal_0300() { 2164 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0300 data'); 2165 let commonEventPublishData = { 2166 data: "FAILED" 2167 }; 2168 try{ 2169 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2170 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2171 portraitRect: { left: 0, top: 800, width: 300, height: 800}, 2172 landscapeAvoidY: 500, 2173 landscapeInputRegion:[], 2174 portraitAvoidY: 1950, 2175 portraitInputRegion: [], 2176 fullScreenMode:true 2177 }; 2178 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2179 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 success '); 2180 } catch (err) { 2181 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 cathch err: ' + JSON.stringify(err)); 2182 if(err.code === 401){ 2183 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 Failed to adjustPanelRect err is ' + err); 2184 commonEventPublishData = { 2185 data: "SUCCESS" 2186 } 2187 } 2188 } 2189 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0300", commonEventPublishData, this.publishCallback); 2190 } 2191 2192 private async Sub_InputMethod_IME_FullScreenAbnormal_1200() { 2193 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1200 data'); 2194 let commonEventPublishData = { 2195 data: "FAILED" 2196 }; 2197 try{ 2198 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2199 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2200 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2201 landscapeAvoidY: 500, 2202 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2203 portraitAvoidY: 1950, 2204 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2205 fullScreenMode:true 2206 }; 2207 this.softKeyboardPanel.adjustPanelRect(2, enhancedPanelRect); 2208 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 success '); 2209 } catch (err) { 2210 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 cathch err: ' + JSON.stringify(err)); 2211 if(err.code === 12800017){ 2212 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 Failed to adjustPanelRect err is ' + err); 2213 commonEventPublishData = { 2214 data: "SUCCESS" 2215 } 2216 } 2217 } 2218 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_1200", commonEventPublishData, this.publishCallback); 2219 } 2220 2221 private async Sub_InputMethod_IME_FullScreenAbnormal_0700() { 2222 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0700 data'); 2223 let commonEventPublishData = { 2224 data: "FAILED" 2225 }; 2226 try{ 2227 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2228 landscapeRect: { left: 0, top: 500, width: 400, height: this.display_info.width}, 2229 portraitRect: { left: 0, top: 1500, width: 300, height: this.display_info.height}, 2230 landscapeAvoidY: 20, 2231 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2232 portraitAvoidY: 20, 2233 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2234 fullScreenMode:false 2235 }; 2236 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2237 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 success '); 2238 } catch (err) { 2239 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 cathch err: ' + JSON.stringify(err)); 2240 if(err.code === 401){ 2241 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 Failed to adjustPanelRect err is ' + err); 2242 commonEventPublishData = { 2243 data: "SUCCESS" 2244 } 2245 } 2246 } 2247 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0700", commonEventPublishData, this.publishCallback); 2248 } 2249 2250 private async Sub_InputMethod_IME_FullScreenAbnormal_0600() { 2251 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0600 data'); 2252 let commonEventPublishData = { 2253 data: "FAILED" 2254 }; 2255 try{ 2256 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2257 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2258 portraitRect: { left: 0, top: 1500, width: 300, height: 2100}, 2259 landscapeAvoidY: 20, 2260 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2261 portraitAvoidY: 20, 2262 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2263 fullScreenMode:true 2264 }; 2265 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2266 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 success '); 2267 } catch (err) { 2268 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 cathch err: ' + JSON.stringify(err)); 2269 if(err.code === 401){ 2270 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 Failed to adjustPanelRect err is ' + err); 2271 commonEventPublishData = { 2272 data: "SUCCESS" 2273 } 2274 } 2275 } 2276 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0600", commonEventPublishData, this.publishCallback); 2277 } 2278 2279 private async Sub_InputMethod_IME_FullScreenAbnormal_0800() { 2280 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0800 data'); 2281 let commonEventPublishData = { 2282 data: "FAILED" 2283 }; 2284 try{ 2285 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2286 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2287 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2288 landscapeAvoidY: -1, 2289 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2290 portraitAvoidY: -1, 2291 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2292 fullScreenMode:true 2293 }; 2294 this.softKeyboardPanel.adjustPanelRect(1, enhancedPanelRect); 2295 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 success '); 2296 } catch (err) { 2297 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 cathch err: ' + JSON.stringify(err)); 2298 if(err.code === 401){ 2299 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 Failed to adjustPanelRect err is ' + err); 2300 commonEventPublishData = { 2301 data: "SUCCESS" 2302 } 2303 } 2304 } 2305 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0800", commonEventPublishData, this.publishCallback); 2306 } 2307 2308 private async Sub_InputMethod_IME_FullScreenAbnormal_0900() { 2309 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0900 data'); 2310 let commonEventPublishData = { 2311 data: "FAILED" 2312 }; 2313 try{ 2314 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2315 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2316 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2317 landscapeAvoidY: -1, 2318 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2319 portraitAvoidY: -1, 2320 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2321 fullScreenMode:false 2322 }; 2323 this.softKeyboardPanel.adjustPanelRect(1, enhancedPanelRect); 2324 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 success '); 2325 } catch (err) { 2326 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 cathch err: ' + JSON.stringify(err)); 2327 if(err.code === 401){ 2328 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 Failed to adjustPanelRect err is ' + err); 2329 commonEventPublishData = { 2330 data: "SUCCESS" 2331 } 2332 } 2333 } 2334 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_0900", commonEventPublishData, this.publishCallback); 2335 } 2336 2337 private async Sub_InputMethod_IME_FullScreenAbnormal_1000() { 2338 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1000 data'); 2339 let commonEventPublishData = { 2340 data: "FAILED" 2341 }; 2342 try{ 2343 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2344 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2345 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2346 landscapeAvoidY: 500, 2347 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600},{ left: 0, top: 247, width: this.display_info.height, height: 150}], 2348 portraitAvoidY: 1200, 2349 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2350 fullScreenMode:false 2351 }; 2352 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2353 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 success '); 2354 } catch (err) { 2355 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 cathch err: ' + JSON.stringify(err)); 2356 if(err.code === 401){ 2357 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 Failed to adjustPanelRect err is ' + err); 2358 commonEventPublishData = { 2359 data: "SUCCESS" 2360 } 2361 } 2362 } 2363 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_1000", commonEventPublishData, this.publishCallback); 2364 } 2365 2366 private async Sub_InputMethod_IME_FullScreenUR_0200() { 2367 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0200 data'); 2368 let commonEventPublishData = { 2369 data: "FAILED" 2370 }; 2371 try{ 2372 this.softKeyboardPanel.changeFlag(2) 2373 this.softKeyboardPanel.updateRegion([{ left: 320, top: 650, width: this.display_info.width, height: 500}]); 2374 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 success '); 2375 } catch (err) { 2376 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 cathch err: ' + JSON.stringify(err)); 2377 if(err.code === 12800017){ 2378 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 Failed to adjustPanelRect err is ' + err); 2379 commonEventPublishData = { 2380 data: "SUCCESS" 2381 } 2382 this.softKeyboardPanel.changeFlag(0) 2383 } 2384 } 2385 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenUR_0200", commonEventPublishData, this.publishCallback); 2386 } 2387 2388 private async Sub_InputMethod_IME_FullScreenUR_0300() { 2389 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0300 data'); 2390 let commonEventPublishData = { 2391 data: "FAILED" 2392 }; 2393 try{ 2394 this.softKeyboardPanel.updateRegion([]); 2395 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 success '); 2396 } catch (err) { 2397 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 cathch err: ' + JSON.stringify(err)); 2398 if(err.code === 401){ 2399 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 Failed to adjustPanelRect err is ' + err); 2400 commonEventPublishData = { 2401 data: "SUCCESS" 2402 } 2403 } 2404 } 2405 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenUR_0300", commonEventPublishData, this.publishCallback); 2406 } 2407 2408 private async Sub_InputMethod_IME_FullScreenUR_0400() { 2409 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0400 data'); 2410 let commonEventPublishData = { 2411 data: "FAILED" 2412 }; 2413 try{ 2414 this.softKeyboardPanel.updateRegion([{ left: 320, top: 650, width: this.display_info.width, height: 500},{ left: 320, top: 650, width: this.display_info.width, height: 500},{ left: 320, top: 650, width: this.display_info.width, height: 500},{ left: 320, top: 650, width: this.display_info.width, height: 500},{ left: 320, top: 650, width: this.display_info.width, height: 500}]); 2415 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 success '); 2416 } catch (err) { 2417 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 cathch err: ' + JSON.stringify(err)); 2418 if(err.code === 401){ 2419 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 Failed to adjustPanelRect err is ' + err); 2420 commonEventPublishData = { 2421 data: "SUCCESS" 2422 } 2423 } 2424 } 2425 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenUR_0400", commonEventPublishData, this.publishCallback); 2426 } 2427 2428 private async Sub_InputMethod_IME_FullScreenUR_0700() { 2429 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0700 data'); 2430 let commonEventPublishData = { 2431 data: "FAILED" 2432 }; 2433 try{ 2434 this.softKeyboardPanel.updateRegion([{ left: -1, top: -1, width: this.display_info.width+3000, height: this.display_info.height+3000}]); 2435 commonEventPublishData = { 2436 data: "SUCCESS" 2437 } 2438 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 success '); 2439 } catch (err) { 2440 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 cathch err: ' + JSON.stringify(err)); 2441 } 2442 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenUR_0700", commonEventPublishData, this.publishCallback); 2443 } 2444 2445 private async Sub_InputMethod_IME_FullScreenAbnormal_1100() { 2446 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1100 data'); 2447 let commonEventPublishData = { 2448 data: "FAILED" 2449 }; 2450 try{ 2451 let panelInfo1:inputMethodEngine.PanelInfo={ 2452 type: inputMethodEngine.PanelType.STATUS_BAR, 2453 } 2454 let inputPanel = await inputMethodAbility.createPanel(this.mContext,panelInfo1) 2455 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 creatPanel Succeed.'); 2456 let enhancedPanelRect:inputMethodEngine.EnhancedPanelRect = { 2457 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2458 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2459 landscapeAvoidY: 500, 2460 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2461 portraitAvoidY: 1000, 2462 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2463 fullScreenMode:true 2464 }; 2465 try{ 2466 inputPanel.adjustPanelRect(0, enhancedPanelRect); 2467 }catch(err){ 2468 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 cathch err: ' + err); 2469 if(err.code === 12800017){ 2470 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 Failed to adjustPanelRect err is ' + err); 2471 commonEventPublishData = { 2472 data: "SUCCESS" 2473 } 2474 await inputMethodAbility.destroyPanel(inputPanel) 2475 } 2476 } 2477 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 success '); 2478 } catch (err) { 2479 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 cathch err: ' + JSON.stringify(err)); 2480 } 2481 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenAbnormal_1100", commonEventPublishData, this.publishCallback); 2482 } 2483 2484 private async Sub_InputMethod_IME_FullScreenUR_0100() { 2485 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0100 data'); 2486 let commonEventPublishData = { 2487 data: "FAILED" 2488 }; 2489 try{ 2490 let panelInfo1:inputMethodEngine.PanelInfo={ 2491 type: inputMethodEngine.PanelType.STATUS_BAR, 2492 } 2493 let inputPanel = await inputMethodAbility.createPanel(this.mContext,panelInfo1) 2494 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 creatPanel Succeed.'); 2495 try{ 2496 inputPanel.updateRegion([{ left: this.display_info.width*0.3, top: this.display_info.height*0.5, width: this.display_info.width, height: this.display_info.height*0.5}]); 2497 }catch(err){ 2498 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 cathch err: ' + err); 2499 if(err.code === 12800017){ 2500 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 Failed to adjustPanelRect err is ' + err); 2501 commonEventPublishData = { 2502 data: "SUCCESS" 2503 } 2504 await inputMethodAbility.destroyPanel(inputPanel) 2505 } 2506 } 2507 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 success '); 2508 } catch (err) { 2509 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 cathch err: ' + JSON.stringify(err)); 2510 } 2511 commoneventmanager.publish("Sub_InputMethod_IME_FullScreenUR_0100", commonEventPublishData, this.publishCallback); 2512 } 2513 2514 private async Sub_InputMethod_IME_Immersive_0900() { 2515 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_0900 data'); 2516 let commonEventPublishData = { 2517 data: "FAILED" 2518 }; 2519 try{ 2520 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.NONE_IMMERSIVE); 2521 let mode = this.softKeyboardPanel.getImmersiveMode() 2522 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 ImmersiveMode :' + JSON.stringify(mode)); 2523 if(mode == 0){ 2524 commonEventPublishData = { 2525 data: "SUCCESS" 2526 } 2527 } 2528 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 success '); 2529 } catch (err) { 2530 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 cathch err: ' + JSON.stringify(err)); 2531 } 2532 commoneventmanager.publish("Sub_InputMethod_IME_Immersive_0900", commonEventPublishData, this.publishCallback); 2533 } 2534 2535 private async Sub_InputMethod_IME_Immersive_1000() { 2536 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1000 data'); 2537 let commonEventPublishData = { 2538 data: "FAILED" 2539 }; 2540 try{ 2541 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 2542 let mode = this.softKeyboardPanel.getImmersiveMode() 2543 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 ImmersiveMode :' + JSON.stringify(mode)); 2544 if(mode == 2){ 2545 commonEventPublishData = { 2546 data: "SUCCESS" 2547 } 2548 } 2549 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 success '); 2550 } catch (err) { 2551 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 cathch err: ' + JSON.stringify(err)); 2552 } 2553 commoneventmanager.publish("Sub_InputMethod_IME_Immersive_1000", commonEventPublishData, this.publishCallback); 2554 } 2555 2556 private async Sub_InputMethod_IME_Immersive_1100() { 2557 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1100 data'); 2558 let commonEventPublishData = { 2559 data: "FAILED" 2560 }; 2561 try{ 2562 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.DARK_IMMERSIVE); 2563 let mode = this.softKeyboardPanel.getImmersiveMode() 2564 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 ImmersiveMode :' + JSON.stringify(mode)); 2565 if(mode == 3){ 2566 commonEventPublishData = { 2567 data: "SUCCESS" 2568 } 2569 } 2570 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 success '); 2571 } catch (err) { 2572 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 cathch err: ' + JSON.stringify(err)); 2573 } 2574 commoneventmanager.publish("Sub_InputMethod_IME_Immersive_1100", commonEventPublishData, this.publishCallback); 2575 } 2576 2577 private async Sub_InputMethod_IME_Immersive_1200() { 2578 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1200 data'); 2579 let commonEventPublishData = { 2580 data: "FAILED" 2581 }; 2582 try{ 2583 let t = setTimeout(() => { 2584 clearTimeout(t); 2585 let mode = this.immersive 2586 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 ImmersiveMode :' + JSON.stringify(mode)); 2587 if(mode == 2){ 2588 commonEventPublishData = { 2589 data: "SUCCESS" 2590 } 2591 } 2592 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 success '); 2593 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_1200', commonEventPublishData, this.publishCallback); 2594 }, 500) 2595 } catch (err) { 2596 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 cathch err: ' + JSON.stringify(err)); 2597 commoneventmanager.publish("Sub_InputMethod_IME_Immersive_1200", commonEventPublishData, this.publishCallback); 2598 } 2599 } 2600 2601 private async Sub_InputMethod_IME_Immersive_0500() { 2602 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_0500 data'); 2603 let commonEventPublishData = { 2604 data: "FAILED" 2605 }; 2606 try{ 2607 try{ 2608 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.IMMERSIVE); 2609 }catch(err){ 2610 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 setImmersiveMode err: ' + JSON.stringify(err)); 2611 if(err.code === 401){ 2612 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 setImmersiveMode err: ' + err); 2613 commonEventPublishData = { 2614 data: "SUCCESS" 2615 } 2616 } 2617 } 2618 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 success '); 2619 } catch (err) { 2620 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 cathch err: ' + JSON.stringify(err)); 2621 } 2622 commoneventmanager.publish("Sub_InputMethod_IME_Immersive_0500", commonEventPublishData, this.publishCallback); 2623 } 2624 2625 public set_IMMERSIVE(immersive:inputMethodEngine.ImmersiveMode){ 2626 try{ 2627 this.softKeyboardPanel?.setImmersiveMode(immersive); 2628 console.info(TAG + `====>this.panel ${this.softKeyboardPanel} `); 2629 console.info(TAG + `====>setImmersiveMode ${immersive} success`); 2630 this.immersive = this.softKeyboardPanel?.getImmersiveMode(); 2631 console.info(TAG + `====>getImmersiveMode ${this.immersive} `); 2632 }catch(err){ 2633 console.info(TAG + `====>setImmersiveMode err! errCode: ${err.code} ,errMessage: ${err.message}`); 2634 } 2635 } 2636 2637}