mirror of
https://gitee.com/openharmony/applications_systemui
synced 2025-01-05 23:48:45 +00:00
fix bug: jscrash caused by asynchrony
Signed-off-by: xuchangzhou <xuzhangzhou@huawei.com>
This commit is contained in:
parent
8c8398a8a2
commit
230e236aed
@ -34,11 +34,6 @@ var volumePanelWant = {
|
||||
"abilityName": "com.ohos.systemui.volumepanel.ServiceExtAbility"
|
||||
}
|
||||
|
||||
var dropdownPanelWant = {
|
||||
"bundleName": "com.ohos.systemui",
|
||||
"abilityName": "com.ohos.systemui.dropdownpanel.ServiceExtAbility"
|
||||
}
|
||||
|
||||
class ServiceExtAbility extends ServiceExtension {
|
||||
onCreate(want) {
|
||||
Log.showInfo(TAG, `onCreate, want: ${JSON.stringify(want)}`)
|
||||
@ -47,7 +42,6 @@ class ServiceExtAbility extends ServiceExtension {
|
||||
AbilityManager.startAbility(statusBarWant)
|
||||
AbilityManager.startAbility(navigationBarWant)
|
||||
AbilityManager.startAbility(volumePanelWant)
|
||||
AbilityManager.startAbility(dropdownPanelWant)
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
|
@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import deviceInfo from "@ohos.deviceInfo"
|
||||
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log'
|
||||
import WindowManager, { WindowType } from '../../../../../../../common/src/main/ets/default/WindowManager'
|
||||
@ -21,6 +22,11 @@ import NavBarConfiguration from '../common/navbarconfiguration'
|
||||
|
||||
const TAG = "NavigationBar_ServiceExtAbility"
|
||||
|
||||
var dropdownPanelWant = {
|
||||
"bundleName": "com.ohos.systemui",
|
||||
"abilityName": "com.ohos.systemui.dropdownpanel.ServiceExtAbility"
|
||||
}
|
||||
|
||||
class ServiceExtAbility extends ServiceExtension {
|
||||
async onCreate(want) {
|
||||
Log.showInfo(TAG, `onCreate, want: ${JSON.stringify(want)}`);
|
||||
@ -49,6 +55,10 @@ class ServiceExtAbility extends ServiceExtension {
|
||||
}
|
||||
}
|
||||
AbilityManager.setAbilityData(AbilityManager.ABILITY_NAME_NAVIGATION_BAR, 'config', configInfo)
|
||||
|
||||
if(deviceInfo.deviceType == "phone"){
|
||||
AbilityManager.startAbility(dropdownPanelWant)
|
||||
}
|
||||
Log.showDebug(TAG, `onCreate, configInfo: ${JSON.stringify(configInfo)}`)
|
||||
|
||||
let navigationBarRect = {
|
||||
|
Loading…
Reference in New Issue
Block a user