gioui.org/ui@v0.0.0-20190926171558-ce74bc0cbaea/app/datadir_android.go (about)

     1  // SPDX-License-Identifier: Unlicense OR MIT
     2  
     3  // +build android
     4  
     5  package app
     6  
     7  import "C"
     8  import "sync"
     9  
    10  var (
    11  	dataDirOnce sync.Once
    12  	dataDirChan = make(chan string, 1)
    13  	dataPath    string
    14  )
    15  
    16  func dataDir() (string, error) {
    17  	dataDirOnce.Do(func() {
    18  		dataPath = <-dataDirChan
    19  	})
    20  	return dataPath, nil
    21  }
    22  
    23  func setDataDir(dir string) {
    24  	dataDirChan <- dir
    25  }