aconfig: add fixed read only flag
Add a new field in the declaration to indicate whether the permission can be overridden. When the field “is_fixed_read_only” is set to true, the flag permission will be set as fixed “READ_ONLY”, and the permission should not be changed by Gantry. Bug: 292521627 Test: atest aconfig.test Change-Id: Ic9bcd7823bccb8b947cf05568c7ced3763490a23
This commit is contained in:
@@ -108,6 +108,11 @@ impl FlagProvider {
|
||||
"false") == "true"
|
||||
}
|
||||
|
||||
/// query flag enabled_fixed_ro
|
||||
pub fn enabled_fixed_ro(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// query flag enabled_ro
|
||||
pub fn enabled_ro(&self) -> bool {
|
||||
true
|
||||
@@ -137,6 +142,12 @@ pub fn disabled_rw() -> bool {
|
||||
PROVIDER.disabled_rw()
|
||||
}
|
||||
|
||||
/// query flag enabled_fixed_ro
|
||||
#[inline(always)]
|
||||
pub fn enabled_fixed_ro() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// query flag enabled_ro
|
||||
#[inline(always)]
|
||||
pub fn enabled_ro() -> bool {
|
||||
@@ -189,6 +200,18 @@ impl FlagProvider {
|
||||
self.overrides.insert("disabled_rw", val);
|
||||
}
|
||||
|
||||
/// query flag enabled_fixed_ro
|
||||
pub fn enabled_fixed_ro(&self) -> bool {
|
||||
self.overrides.get("enabled_fixed_ro").copied().unwrap_or(
|
||||
true
|
||||
)
|
||||
}
|
||||
|
||||
/// set flag enabled_fixed_ro
|
||||
pub fn set_enabled_fixed_ro(&mut self, val: bool) {
|
||||
self.overrides.insert("enabled_fixed_ro", val);
|
||||
}
|
||||
|
||||
/// query flag enabled_ro
|
||||
pub fn enabled_ro(&self) -> bool {
|
||||
self.overrides.get("enabled_ro").copied().unwrap_or(
|
||||
@@ -251,6 +274,18 @@ pub fn set_disabled_rw(val: bool) {
|
||||
PROVIDER.lock().unwrap().set_disabled_rw(val);
|
||||
}
|
||||
|
||||
/// query flag enabled_fixed_ro
|
||||
#[inline(always)]
|
||||
pub fn enabled_fixed_ro() -> bool {
|
||||
PROVIDER.lock().unwrap().enabled_fixed_ro()
|
||||
}
|
||||
|
||||
/// set flag enabled_fixed_ro
|
||||
#[inline(always)]
|
||||
pub fn set_enabled_fixed_ro(val: bool) {
|
||||
PROVIDER.lock().unwrap().set_enabled_fixed_ro(val);
|
||||
}
|
||||
|
||||
/// query flag enabled_ro
|
||||
#[inline(always)]
|
||||
pub fn enabled_ro() -> bool {
|
||||
|
Reference in New Issue
Block a user