Add IS_DEBUG to SpaEnvironment

If set to true, this will also enable all the pages under development
(allows browsing and searching).

Bug: 244122804
Test: Manually with Settings
Change-Id: Ibf8f6f832f7f9f16e8224a83b92801635a83e1cb
This commit is contained in:
Chaohui Wang
2023-02-15 14:55:11 +08:00
parent cf16a02e27
commit 2f346f41a7
2 changed files with 11 additions and 3 deletions

View File

@@ -77,9 +77,8 @@ data class SettingsPage(
return true
}
fun isEnabled(): Boolean {
return getPageProvider(sppName)?.isEnabled(arguments) ?: false
}
fun isEnabled(): Boolean =
SpaEnvironment.IS_DEBUG || getPageProvider(sppName)?.isEnabled(arguments) ?: false
fun getTitle(): String {
return getPageProvider(sppName)?.getTitle(arguments) ?: ""

View File

@@ -88,4 +88,13 @@ abstract class SpaEnvironment(context: Context) {
open val sliceProviderAuthorities: String? = null
// TODO: add other environment setup here.
companion object {
/**
* Whether debug mode is on or off.
*
* If set to true, this will also enable all the pages under development (allows browsing
* and searching).
*/
const val IS_DEBUG = false
}
}