운전 세션 간 핫스팟 유지

이 페이지에서는 다음 서비스 간에 핫스팟을 유지하도록 사용자를 설정하는 방법을 설명합니다. AAOS의 Wi-Fi 운전 환경과 유사합니다.

public class CarSettings {
  ...

  @SystemApi
  public static final class 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
    public static final String ENABLE_PERSISTENT_TETHERING =
           "android.car.ENABLE_PERSISTENT_TETHERING";
  }
}

테더링을 유지하려면 다음을 통해 ENABLE_PERSISTENT_TETHERING를 사용하세요. Settings API 쿼리에도 사용할 수 있습니다

권한

CarWifiManager API 사용이 제한됩니다. 이 새로운 권한은 다음을 위해 생성됩니다. 액세스를 보호할 수 있습니다

public boolean canControlPersistApSettings() { ... }

이 권한의 보호 수준은 다음과 같습니다.

새 권한 권한 보호 수준
READ_PERSIST_TETHERING_SETTINGS 서명 | 독점

지속 동작은 기본적으로 지원되지 않음으로 설정됩니다. 리소스 오버레이 (config_enablePersistTetheringCapabilities)는 테더링 유지 기능. 의도적으로 테더링을 유지하려면 값을 true로 설정하여 사용자 환경설정 외에 기능을 사용 설정합니다. WRITE_SECURE_SETTINGS 권한이 있는 다른 시스템 앱에서 이 설정을 제어할 수도 있습니다.

다음 API는 동작의 사용 설정 여부를 결정합니다. 다음 날짜 이전에 이 API 호출 ENABLE_PERSISTENT_TETHERING를 변경하면 됩니다.

/**
 * CarWifiManager provides API to allow for applications to perform Wi-Fi specific
 * operations.
 *
 * @hide
 */
@SystemApi
public final class CarWifiManager extends CarManagerBase {
 /**
  * Returns {@code true} if the persist tethering settings are able to be
  * changed.
  *
  * @hide
  */
 @SystemApi
 @RequiresPermission(Car.PERMISSION_READ_PERSIST_TETHERING_SETTINGS)
 public boolean canControlPersistApSettings() { ... }
}