From b897614379e60ab62c195f20bdb01e1994c108b0 Mon Sep 17 00:00:00 2001 From: Maggie Choy Date: Mon, 28 Oct 2024 13:59:13 -0700 Subject: [PATCH] feat: cleanup unused default manifest (#662) * feat: cleanup unused default manifest --- .../storage/default_storage_properties.rs | 17 ++++---------- core/sdk/src/api/manifest/device_manifest.rs | 23 ++----------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/core/main/src/processor/storage/default_storage_properties.rs b/core/main/src/processor/storage/default_storage_properties.rs index 286fb67dd..40cded198 100644 --- a/core/main/src/processor/storage/default_storage_properties.rs +++ b/core/main/src/processor/storage/default_storage_properties.rs @@ -25,10 +25,10 @@ use ripple_sdk::{ KEY_ALLOW_WATCH_HISTORY, KEY_AUDIO_DESCRIPTION_ENABLED, KEY_BACKGROUND_COLOR, KEY_BACKGROUND_OPACITY, KEY_COUNTRY_CODE, KEY_ENABLED, KEY_FONT_COLOR, KEY_FONT_EDGE, KEY_FONT_EDGE_COLOR, KEY_FONT_FAMILY, KEY_FONT_OPACITY, KEY_FONT_SIZE, KEY_LANGUAGE, - KEY_LOCALE, KEY_NAME, KEY_POSTAL_CODE, KEY_SKIP_RESTRICTION, KEY_TEXT_ALIGN, - KEY_TEXT_ALIGN_VERTICAL, KEY_WINDOW_COLOR, KEY_WINDOW_OPACITY, NAMESPACE_ADVERTISING, - NAMESPACE_AUDIO_DESCRIPTION, NAMESPACE_CLOSED_CAPTIONS, NAMESPACE_DEVICE_NAME, - NAMESPACE_LOCALIZATION, NAMESPACE_PRIVACY, + KEY_LOCALE, KEY_NAME, KEY_SKIP_RESTRICTION, KEY_TEXT_ALIGN, KEY_TEXT_ALIGN_VERTICAL, + KEY_WINDOW_COLOR, KEY_WINDOW_OPACITY, NAMESPACE_ADVERTISING, NAMESPACE_AUDIO_DESCRIPTION, + NAMESPACE_CLOSED_CAPTIONS, NAMESPACE_DEVICE_NAME, NAMESPACE_LOCALIZATION, + NAMESPACE_PRIVACY, }, log::trace, }; @@ -251,15 +251,6 @@ impl DefaultStorageProperties { key.to_owned(), )), } - } else if let Some(defaults) = state - .get_device_manifest() - .get_settings_defaults_per_app() - .get(namespace) - { - match key { - KEY_POSTAL_CODE => Ok(defaults.postal_code.clone()), - _ => Err(DefaultStoragePropertiesError::NotFound(key.to_owned())), - } } else { Err(DefaultStoragePropertiesError::UnreconizedNamespace( namespace.to_owned(), diff --git a/core/sdk/src/api/manifest/device_manifest.rs b/core/sdk/src/api/manifest/device_manifest.rs index 6ccfc177b..5f0ffe0e7 100644 --- a/core/sdk/src/api/manifest/device_manifest.rs +++ b/core/sdk/src/api/manifest/device_manifest.rs @@ -51,8 +51,6 @@ pub struct RippleConfiguration { #[serde(default)] pub default_values: DefaultValues, #[serde(default)] - pub settings_defaults_per_app: HashMap, - #[serde(default)] pub model_friendly_names: HashMap, pub distributor_experience_id: String, pub distributor_services: Option, @@ -361,14 +359,11 @@ pub fn default_video_dimensions() -> Vec { } pub fn countries_using_us_privacy_default() -> Vec { - Vec::new() + vec!["CA".to_string()] } fn country_postal_code_default() -> HashMap { - let mut default_map = HashMap::default(); - default_map.insert("USA".to_string(), "66952".to_string()); - default_map.insert("CAN".to_string(), "L6T 0C1".to_string()); - default_map + HashMap::default() } #[derive(Deserialize, Debug, Clone, Default)] @@ -726,7 +721,6 @@ impl Default for RippleConfiguration { distribution_id_salt: None, form_factor: Default::default(), default_values: DefaultValues::default(), - settings_defaults_per_app: Default::default(), model_friendly_names: Default::default(), distributor_experience_id: Default::default(), distributor_services: None, @@ -836,10 +830,6 @@ impl DeviceManifest { self.configuration.features.clone() } - pub fn get_settings_defaults_per_app(&self) -> HashMap { - self.configuration.clone().settings_defaults_per_app - } - pub fn get_model_friendly_names(&self) -> HashMap { self.configuration.model_friendly_names.clone() } @@ -933,7 +923,6 @@ pub(crate) mod tests { country_postal_code: HashMap::new(), countries_using_us_privacy: Vec::new(), }, - settings_defaults_per_app: HashMap::new(), model_friendly_names: { let mut names = HashMap::new(); names.insert("RSPPI".to_string(), "Raspberry PI".to_string()); @@ -1114,14 +1103,6 @@ pub(crate) mod tests { ); } - #[test] - fn test_get_settings_defaults_per_app() { - let manifest = DeviceManifest::mock(); - let settings_defaults_per_app = manifest.get_settings_defaults_per_app(); - - assert_eq!(settings_defaults_per_app, HashMap::new()); - } - #[test] fn test_get_model_friendly_names() { let manifest = DeviceManifest::mock();