Skip to content

Add form-factor detection utility and layout contract interfaces - #47

Merged
yrezgui merged 1 commit into
android:mainfrom
pflammertsma:pr/form-factor-contracts
Oct 13, 2026
Merged

yrezgui merged 1 commit into
android:mainfrom
pflammertsma:pr/form-factor-contracts

Conversation

@pflammertsma

Copy link
Copy Markdown
Member
  • Add FormFactorUtils to detect TV, Mobile, Wear, Auto, and XR devices.
  • Define compile-time layout contract interfaces (AgentDemoScreenLayout, DebuggingScreenLayout, SettingsScreenLayout, ConnectedAppsScreenLayout) to decouple screen routers from form-factor presentation.
…faces

- Add FormFactorUtils to detect TV, Mobile, Wear, Auto, and XR devices.
- Define compile-time layout contract interfaces (AgentDemoScreenLayout, DebuggingScreenLayout, SettingsScreenLayout, ConnectedAppsScreenLayout) to decouple screen routers from form-factor presentation.

TAG=agy
CONV=93e51fa6-7028-4707-8a32-f7af65eb2041
pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK) -> FormFactor.TV
pm.hasSystemFeature(PackageManager.FEATURE_WATCH) -> FormFactor.WEAR
pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) -> FormFactor.AUTO
pm.hasSystemFeature("android.hardware.xr.display") -> FormFactor.XR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be replaced by a constant if there's one part of the platform API

@yrezgui
yrezgui merged commit 16aa38a into android:main Oct 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants