背景
我需要解决一个仅影响运行三星 One UI 的设备的错误。
问题
如何以编程方式检测设备是否运行 One UI?
我尝试过的方法
我已经尝试了以下方法:
- 检查
android.os.Build
,但是我没有看到任何清晰地标识 One UI 的内容 - 检查
Build.BRAND == "samsung" && Build.VERSION.SDK_INT >= 28
,但这也会检测运行在三星设备上的自定义 ROM,而这些设备不运行 One UI
示例系统信息
供参考,这里是运行 Android 9 的三星 Galaxy Tab S4 上 android.os.Build
的详细信息:
Build.BOARD: msm8998
Build.BOOTLOADER: T835XXU4BSJ6
Build.BRAND: samsung
Build.CPU_ABI: arm64-v8a
Build.CPU_ABI2:
Build.DEVICE: gts4llte
Build.DISPLAY: PPR1.180610.011.T835XXU4BSJ6
Build.FINGERPRINT: samsung/gts4lltexx/gts4llte:9/PPR1.180610.011/T835XXU4BSJ6:user/release-keys
Build.HARDWARE: qcom
Build.HOST: 21HH1G10
Build.ID: PPR1.180610.011
Build.IS_DEBUGGABLE: false
Build.IS_EMULATOR: false
Build.MANUFACTURER: samsung
Build.MODEL: SM-T835
Build.PERMISSIONS_REVIEW_REQUIRED: false
Build.PRODUCT: gts4lltexx
Build.RADIO: unknown
Build.SERIAL: unknown
Build.TAGS: release-keys
Build.TIME: 1572504702000
Build.TYPE: user
Build.UNKNOWN: unknown
Build.USER: dpi
Build.Version.BASE_OS:
Build.Version.CODENAME: REL
Build.Version.FIRST_SDK_INT: 27
Build.Version.INCREMENTAL: T835XXU4BSJ6
Build.Version.PREVIEW_SDK_INT: 0
Build.Version.RELEASE: 9
Build.Version.RESOURCES_SDK_INT: 28
Build.Version.SDK: 28
Build.Version.SDK_INT: 28
Build.Version.SECURITY_INDEX: 1
Build.Version.SECURITY_PATCH: 2019-11-01
Build.Version.SEM_FIRST_SDK_INT: 27
Build.Version.SEM_INT: 2801
Build.Version.SEM_PLATFORM_INT: 100100
以下是需要翻译的内容: