mirror of
https://github.com/go-i2p/gomobile-java.git
synced 2025-07-13 11:54:44 -04:00
exp/sensor: fix nsec to usec conversion.
Also remove an unnecessary constant type conversion. Change-Id: Iff466553fac450bd531785f4fb4e2be97a991a52 Reviewed-on: https://go-review.googlesource.com/13715 Reviewed-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
@ -79,12 +79,12 @@ func (m *manager) initialize() {
|
||||
v := <-m.inout
|
||||
switch s := v.in.(type) {
|
||||
case initSignal:
|
||||
id := atomic.AddInt64(&nextLooperID, int64(1))
|
||||
id := atomic.AddInt64(&nextLooperID, 1)
|
||||
var mgr C.GoAndroid_SensorManager
|
||||
C.GoAndroid_createManager(C.int(id), &mgr)
|
||||
m.m = &mgr
|
||||
case enableSignal:
|
||||
usecsDelay := s.delay.Nanoseconds() * 1000
|
||||
usecsDelay := s.delay.Nanoseconds() / 1000
|
||||
code := int(C.GoAndroid_enableSensor(m.m.queue, typeToInt(s.t), C.int32_t(usecsDelay)))
|
||||
if code != 0 {
|
||||
*s.err = fmt.Errorf("sensor: no default %v sensor on the device", s.t)
|
||||
|
Reference in New Issue
Block a user