|
|
@ -468,10 +468,7 @@ func (a *App) notify(state BackendState) {
|
|
|
|
case a.updates <- struct{}{}:
|
|
|
|
case a.updates <- struct{}{}:
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ready := jni.False
|
|
|
|
ready := jni.Bool(state.State >= ipn.Stopped)
|
|
|
|
if state.State >= ipn.Stopped {
|
|
|
|
|
|
|
|
ready = jni.True
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := a.callVoidMethod(a.appCtx, "setTileReady", "(Z)V", jni.Value(ready)); err != nil {
|
|
|
|
if err := a.callVoidMethod(a.appCtx, "setTileReady", "(Z)V", jni.Value(ready)); err != nil {
|
|
|
|
fatalErr(err)
|
|
|
|
fatalErr(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -480,10 +477,7 @@ func (a *App) notify(state BackendState) {
|
|
|
|
func (a *App) setPrefs(prefs *ipn.Prefs) {
|
|
|
|
func (a *App) setPrefs(prefs *ipn.Prefs) {
|
|
|
|
a.mu.Lock()
|
|
|
|
a.mu.Lock()
|
|
|
|
a.prefs = prefs
|
|
|
|
a.prefs = prefs
|
|
|
|
wantRunning := jni.True
|
|
|
|
wantRunning := jni.Bool(prefs.WantRunning)
|
|
|
|
if !prefs.WantRunning {
|
|
|
|
|
|
|
|
wantRunning = jni.False
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
a.mu.Unlock()
|
|
|
|
a.mu.Unlock()
|
|
|
|
if err := a.callVoidMethod(a.appCtx, "setTileStatus", "(Z)V", jni.Value(wantRunning)); err != nil {
|
|
|
|
if err := a.callVoidMethod(a.appCtx, "setTileStatus", "(Z)V", jni.Value(wantRunning)); err != nil {
|
|
|
|
fatalErr(err)
|
|
|
|
fatalErr(err)
|
|
|
|