不同於許多 Android 裝置,Android Automotive OS 車輛通常屬於共用裝置。為了讓使用者能保護機密資料,例如密碼和付款資訊,針對 Android Automotive OS 建構的瀏覽器必須能讓使用者以設定檔鎖定功能封鎖密碼存取權,否則不得儲存或允許存取密碼或付款資訊。驗證可以透過裝置憑證完成,或在應用程式中建構驗證系統。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Build browsers for Android Automotive OS\n\nThe Browsers category is in beta \nAt this time, anyone can publish browsers to internal testing tracks on the Play Store. Publishing to closed testing, open testing, and production tracks will be permitted at a later date. \n[Nominate yourself to be an early access partner →](https://forms.gle/VsXEdDEBidxw8q8u8) \n\nBeyond the requirements described in [Build parked apps for cars](/training/cars/parked) and [Add support for\nAndroid Automotive OS to your parked app](/training/cars/parked/automotive-os),\nthere are a few additional requirements specific to browsers that are detailed\non this page.\n| **Important:** Make sure your app meets the [quality guidelines for\n| browsers](/docs/quality-guidelines/car-app-quality?category=browser), as it is reviewed against them when submitted to tracks other than internal testing.\n\nAllow users to block access to sensitive data\n---------------------------------------------\n\nUnlike many Android devices, Android Automotive OS vehicles are often shared\ndevices. To give users the ability to protect their sensitive data such as\npasswords and payments information, browsers built for Android Automotive OS\n[must not save or allow access to passwords or payment information unless the\nuser can block access to passwords using a profile lock](/docs/quality-guidelines/car-app-quality?category=browser#SD-1).\nAuthentication can be accomplished either by using the device credential or by\nbuilding an authentication system within your app.\n\nAdditionally, before syncing sensitive data, browsers built for Android\nAutomotive OS [must prompt the user to authenticate and provide messaging to let\nthe user know that their data is being synchronized to the car](/docs/quality-guidelines/car-app-quality?category=browser#SD-2).\nIf the user does not have any method of authentication set up, you can prompt\nthem to set one up when they try to sync sensitive data, using either the\n[device credential](#open-settings) or one specific to your app.\n\nUse the device credential for authentication\n--------------------------------------------\n\nThis section provides guidance on how to use the device credential and\nsystem authentication APIs to meet the sensitive data requirements described\nprior.\n\n### Check if there is a device credential set\n\nTo determine if the user has secured their device with a PIN, pattern, or\npassword, you can use the [`KeyguardManager::isDeviceSecure`](/reference/android/app/KeyguardManager#isDeviceSecure())\nmethod. \n\n### Kotlin\n\n```kotlin\nval keyguardManager = context.getSystemService(KeyguardManager::class.java)\nval isDeviceSecure = keyguardManager.isDeviceSecure()\n```\n\n### Java\n\n```java\nKeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\nboolean isDeviceSecure = keyguardManager.isDeviceSecure();\n```\n\n### Open the lock screen settings\n\nTo reduce user friction in the case they need to set a device credential, you\ncan open up the Security screen within the Settings app using the\n[`Settings.ACTION_SECURITY_SETTINGS`](/reference/android/provider/Settings#ACTION_SECURITY_SETTINGS)\nintent action. \n\n### Kotlin\n\n```kotlin\ncontext.startActivity(Intent(Settings.ACTION_SECURITY_SETTINGS))\n```\n\n### Java\n\n```java\ncontext.startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS))\n```\n\n### Prompt the user to authenticate\n\nTo prompt the user to authenticate, you can use the `BiometricPrompt` API as\ndescribed in [Show a biometric authentication dialog](/training/sign-in/biometric-auth).\n| **Caution:** Despite the name, you should only use the [`DEVICE_CREDENTIAL`](/reference/androidx/biometric/BiometricManager.Authenticators#DEVICE_CREDENTIAL) authenticator and not any of the biometric ones, as Android Automotive OS vehicles with Google built-in don't have biometric sensors."]]