sl4f_lib/location/
regulatory_region_facade.rs1use anyhow::Error;
6use fidl_fuchsia_location_namedplace::{
7 RegulatoryRegionConfiguratorMarker, RegulatoryRegionConfiguratorProxy,
8};
9use fuchsia_component::client::connect_to_protocol;
10
11#[derive(Debug)]
12pub struct RegulatoryRegionFacade {
13 configurator: RegulatoryRegionConfiguratorProxy,
14}
15
16impl RegulatoryRegionFacade {
17 pub fn new() -> Result<RegulatoryRegionFacade, Error> {
18 Ok(RegulatoryRegionFacade {
19 configurator: connect_to_protocol::<RegulatoryRegionConfiguratorMarker>()?,
20 })
21 }
22
23 pub fn set_region(&self, region_code: &str) -> Result<(), Error> {
25 self.configurator.set_region(region_code)?;
26 Ok(())
27 }
28}