client

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinderClient

type BinderClient struct {
	// contains filtered or unexported fields
}

BinderClient provides Java-friendly access to Android binder services. All exported methods use gomobile-safe types only.

func NewBinderClient

func NewBinderClient() (*BinderClient, error)

NewBinderClient opens the binder driver, creates a version-aware transport, and initializes the service manager.

func (*BinderClient) CheckServiceExists

func (c *BinderClient) CheckServiceExists(serviceName string) (bool, error)

CheckServiceExists checks whether a service is registered in the service manager.

func (*BinderClient) Close

func (c *BinderClient) Close() error

Close releases the binder driver and all associated resources.

func (*BinderClient) GetDeviceInfo

func (c *BinderClient) GetDeviceInfo() (*DeviceInfo, error)

GetDeviceInfo returns an aggregate snapshot of device state by querying the power manager, thermal service, and service manager.

func (*BinderClient) GetDisplayInfo

func (c *BinderClient) GetDisplayInfo() (*DisplayInfo, error)

GetDisplayInfo returns the current display brightness (default constraint) and night mode state.

func (*BinderClient) GetLastLocation

func (c *BinderClient) GetLastLocation(
	provider string,
) (*LocationResult, error)

GetLastLocation returns the last known location for the given provider (e.g. "gps", "network", "fused"). Returns nil with no error if no location is cached for that provider.

func (*BinderClient) GetPowerStatus

func (c *BinderClient) GetPowerStatus() (*PowerStatus, error)

GetPowerStatus returns the current power state by querying the PowerManager service.

func (*BinderClient) ListServicesJSON

func (c *BinderClient) ListServicesJSON() (string, error)

ListServicesJSON returns all registered binder service names as a JSON array of strings.

type DeviceInfo

type DeviceInfo struct {
	ScreenOn      bool
	PowerSave     bool
	Brightness    float32
	ThermalStatus int32
	ServiceCount  int32
}

DeviceInfo holds aggregate device state in gomobile-safe types.

type DisplayInfo

type DisplayInfo struct {
	Brightness float32
	NightMode  bool
}

DisplayInfo holds display state in gomobile-safe types.

type LocationResult

type LocationResult struct {
	Provider string
	Lat      float64
	Lon      float64
	Alt      float64
	Speed    float32
	Bearing  float32
	Accuracy float32
	TimeMs   int64
}

LocationResult holds GPS location data in gomobile-safe types. All fields are exported primitives so gomobile can bridge them to Java.

type PowerStatus

type PowerStatus struct {
	IsInteractive           bool
	IsPowerSaveMode         bool
	IsBatterySaverSupported bool
}

PowerStatus holds power state in gomobile-safe types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL