diff --git a/netenv/os_android.go b/netenv/os_android.go index a1ec8145..ccea7877 100644 --- a/netenv/os_android.go +++ b/netenv/os_android.go @@ -10,9 +10,13 @@ func osGetInterfaceAddrs() ([]net.Addr, error) { if err != nil { return nil, err } + var netList []net.Addr for _, addr := range list { - netList = append(netList, addr.ToIPNet()) + ipNetAddr, err := addr.ToIPNet() + if err == nil { + netList = append(netList, ipNetAddr) + } } return netList, nil diff --git a/updates/get.go b/updates/get.go index 68868f0d..2cf7acf7 100644 --- a/updates/get.go +++ b/updates/get.go @@ -59,3 +59,14 @@ func GetVersion(identifier string) (*updater.ResourceVersion, error) { return rv, nil } + +// GetVersionWithFullID returns the selected generic version of the given full identifier. +// The returned resource version may not be modified. +func GetVersionWithFullID(identifier string) (*updater.ResourceVersion, error) { + rv, err := registry.GetVersion(identifier) + if err != nil { + return nil, err + } + + return rv, nil +} diff --git a/updates/main.go b/updates/main.go index db9951bb..6012b509 100644 --- a/updates/main.go +++ b/updates/main.go @@ -58,6 +58,9 @@ var ( // more context to requests made by the registry when // fetching resources from the update server. UserAgent = "Core" + + // Explicitly disables automatic software updates. Used in android. + DisableSoftwareAutoUpdate = false ) const ( @@ -145,7 +148,7 @@ func start() error { registry, initialReleaseChannel, true, - enableSoftwareUpdates(), + enableSoftwareUpdates() && !DisableSoftwareAutoUpdate, enableIntelUpdates(), ) if warning != nil { @@ -247,7 +250,7 @@ func checkForUpdates(ctx context.Context) (err error) { } defer func() { - // Resolve any error and and send succes notification. + // Resolve any error and and send success notification. if err == nil { log.Infof("updates: successfully checked for updates") notifyUpdateSuccess(forcedUpdate) diff --git a/updates/notify.go b/updates/notify.go index 6bc34817..5445cb2c 100644 --- a/updates/notify.go +++ b/updates/notify.go @@ -115,7 +115,7 @@ func notifyUpdateCheckFailed(forced bool, err error) { // Not failed often enough for notification. return case lastSuccess == nil: - // No recorded successful udpate. + // No recorded successful update. case time.Now().Add(-failedUpdateNotifyDurationThreshold).Before(*lastSuccess): // Failed too recently for notification. return