exp/sensor: reorg package to create space for darwin/arm,arm64 impl
Change-Id: I41e4088a92fff2f411dd82102fc3c421d2679c21 Reviewed-on: https://go-review.googlesource.com/13582 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
df7e121d2f
commit
b5583e233e
@ -2,12 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build android
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include <android/sensor.h>
|
||||
|
||||
#include "sensors_android.h"
|
||||
#include "android.h"
|
||||
|
||||
void android_createManager(int looperId, android_SensorManager* dst) {
|
||||
ASensorManager* manager = ASensorManager_getInstance();
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build android
|
||||
|
||||
package sensor
|
||||
|
||||
/*
|
||||
@ -10,7 +12,7 @@ package sensor
|
||||
#include <stdlib.h>
|
||||
#include <android/sensor.h>
|
||||
|
||||
#include "sensors_android.h"
|
||||
#include "android.h"
|
||||
*/
|
||||
import "C"
|
||||
import (
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build android
|
||||
|
||||
#ifndef SENSORS_ANDROID_H
|
||||
#define SENSORS_ANDROID_H
|
||||
|
@ -2,7 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !android
|
||||
// +build darwin
|
||||
// +build arm arm64
|
||||
|
||||
package sensor
|
||||
|
34
exp/sensor/notmobile.go
Normal file
34
exp/sensor/notmobile.go
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build linux,!android darwin,!arm,!arm64
|
||||
|
||||
package sensor
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
type manager struct {
|
||||
}
|
||||
|
||||
func (m *manager) initialize() {
|
||||
}
|
||||
|
||||
func (m *manager) enable(t Type, delay time.Duration) error {
|
||||
return errors.New("sensor: no sensors available")
|
||||
}
|
||||
|
||||
func (m *manager) disable(t Type) error {
|
||||
return errors.New("sensor: no sensors available")
|
||||
}
|
||||
|
||||
func (m *manager) read(e []Event) (n int, err error) {
|
||||
return 0, errors.New("sensor: no sensor data available")
|
||||
}
|
||||
|
||||
func (m *manager) close() error {
|
||||
return nil
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user