Skip to content

Commit 6a88067

Browse files
author
lichangze
committed
feat: 增加startupNotify名单,强制显示加载状态
go-lib记录默认名单,/var/lib/apps/startupNotifyList.json作为oem名单.如果有oem名单,则oem名单应用优先.名单内应用强制显示加载状态 Log: 增加startupNotify名单,强制显示加载状态 Task: https://pms.uniontech.com/task-view-219109.html Influence: 应用启动参数 Change-Id: I3b46811228287e27afc3aeadb22561ac49b33952
1 parent a3fb0cc commit 6a88067

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

appinfo/desktopappinfo/desktopappinfo.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ package desktopappinfo
66

77
import (
88
"bytes"
9+
"encoding/json"
910
"errors"
11+
"io/ioutil"
1012
"os"
1113
"os/exec"
1214
"path/filepath"
@@ -612,6 +614,20 @@ func startCommand(ai *DesktopAppInfo, cmdline string, files []string, launchCont
612614

613615
var snId string
614616
startupNotify := ai.GetStartupNotify()
617+
// 名单中的应用强制startupNotify,
618+
forceStartupNotifyList := []string{
619+
"", //TODO 名单待更新
620+
}
621+
const startupNotifyListPath = "/var/lib/apps/startupNotifyList.json"
622+
c, err := ioutil.ReadFile(startupNotifyListPath)
623+
if err == nil {
624+
_ = json.Unmarshal(c, &forceStartupNotifyList)
625+
}
626+
for _, d := range forceStartupNotifyList {
627+
if strings.Contains(ai.GetFileName(), d) {
628+
startupNotify = true
629+
}
630+
}
615631
if startupNotify && launchContext != nil &&
616632
launchContext.GetTimestamp() != 0 {
617633
snId, _ = launchContext.GetStartupNotifyId(ai, files)

0 commit comments

Comments
 (0)