Documentation
¶
Overview ¶
Query device rotation and display state via WindowManager and DisplayManager.
The rotation resolver service is a bound Java service only available to the system server. Instead, this example queries the actual rotation state through WindowManager (GetDefaultDisplayRotation, IsRotationFrozen, HasNavigationBar, IsKeyguardLocked) and DisplayManager (display IDs, brightness).
Build:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o build/rotation_resolver ./examples/rotation_resolver/ adb push build/rotation_resolver /data/local/tmp/ && adb shell /data/local/tmp/rotation_resolver
Click to show internal directories.
Click to hide internal directories.