Fix include_android_user

This commit is contained in:
世界 2022-08-27 12:16:50 +08:00
parent e01ce3a8a7
commit 3117b24c68
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 26 additions and 15 deletions

View file

@ -18,7 +18,7 @@ import (
type packageManager struct {
callback PackageManagerCallback
watcher *fsnotify.Watcher
idByPackage map[string][]uint32
idByPackage map[string]uint32
sharedByPackage map[string]uint32
packageById map[uint32]string
sharedById map[uint32]string
@ -78,7 +78,7 @@ func (m *packageManager) Close() error {
return common.Close(common.PtrOrNil(m.watcher))
}
func (m *packageManager) IDByPackage(packageName string) ([]uint32, bool) {
func (m *packageManager) IDByPackage(packageName string) (uint32, bool) {
id, loaded := m.idByPackage[packageName]
return id, loaded
}
@ -114,7 +114,7 @@ func (m *packageManager) updatePackages() error {
}
func (m *packageManager) decodePackages(decoder *xml.Decoder) error {
idByPackage := make(map[string][]uint32)
idByPackage := make(map[string]uint32)
sharedByPackage := make(map[string]uint32)
packageById := make(map[uint32]string)
sharedById := make(map[uint32]string)
@ -149,7 +149,7 @@ func (m *packageManager) decodePackages(decoder *xml.Decoder) error {
if userID == 0 && name == "" {
continue
}
idByPackage[name] = append(idByPackage[name], uint32(userID))
idByPackage[name] = uint32(userID)
packageById[uint32(userID)] = name
case "shared-user":
var name string