Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.

Maintain hotspots between driving sessions

This page describes how you can set up users to maintain hotspots between driving sessions, similar to the Wi-Fi driving experience in AAOS.

publicclass CarSettings{
...
@SystemApi
publicstaticfinalclass Global{
...
/**
 * Enables persistent tethering when set to {@code "true"}.
 *
 * <p>When enabled, tethering is started when the car is started given
 * that the hotspot was enabled at shutdown and all tethering sessions
 * will remain on even if no devices are connected to it.
 *
 * <p>When disabled, hotspot will turn off automatically if no devices
 * are connected and will no longer persist through drives.
 *
 * @hide
 */
@SystemApi
publicstaticfinalStringENABLE_PERSISTENT_TETHERING=
"android.car.ENABLE_PERSISTENT_TETHERING";
}
}

To persist tethering, use ENABLE_PERSISTENT_TETHERING through the Settings API, which can also be used to query.

Permissions

Use of the CarWifiManager API is restricted. This new permission is created to guard access.

publicbooleancanControlPersistApSettings(){...}

Protection levels for this permission are:

New permission Permission Protection level
Yes READ_PERSIST_TETHERING_SETTINGS Signature | Privileged

The persist behavior defaults to not supported. A resource overlay (config_enablePersistTetheringCapabilities) is configured to block the ability to persist tethering. To intentionally persist tethering, set the value to true to enable the feature on top of the user preference opt-in since other system apps with the WRITE_SECURE_SETTINGS permission can also control this setting.

The following API determines if the behavior is enabled. Call this API before you change ENABLE_PERSISTENT_TETHERING.

/**
 * CarWifiManager provides API to allow for applications to perform Wi-Fi specific
 * operations.
 *
 * @hide
 */
@SystemApi
publicfinalclass CarWifiManagerextendsCarManagerBase{
/**
 * Returns {@code true} if the persist tethering settings are able to be
 * changed.
 *
 * @hide
 */
@SystemApi
@RequiresPermission(Car.PERMISSION_READ_PERSIST_TETHERING_SETTINGS)
publicbooleancanControlPersistApSettings(){...}
}

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025年12月02日 UTC.