mirror of
https://github.com/PenumbraOS/sdk.git
synced 2026-02-04 01:44:47 -06:00
Compare commits
3 Commits
2025-10-08
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1a344b882 | ||
|
|
215825dcbb | ||
|
|
b04ef40746 |
@ -125,7 +125,8 @@ class SettingsRegistry(
|
||||
// Reference to web server for broadcasting (set by SettingsService)
|
||||
private var webServer: SettingsWebServer? = null
|
||||
|
||||
private val _settingsFlow = MutableStateFlow<SettingsUpdate>(SettingsUpdate(emptyMap(), emptyList()))
|
||||
private val _settingsFlow =
|
||||
MutableStateFlow<SettingsUpdate>(SettingsUpdate(emptyMap(), emptyList()))
|
||||
val settingsFlow: StateFlow<SettingsUpdate> = _settingsFlow.asStateFlow()
|
||||
|
||||
private val json = Json {
|
||||
@ -136,7 +137,7 @@ class SettingsRegistry(
|
||||
init {
|
||||
loadSavedSettings()
|
||||
initializeSystemSettingsSync()
|
||||
setupTemperatureMonitoring()
|
||||
// setupTemperatureMonitoring()
|
||||
}
|
||||
|
||||
suspend fun initialize() {
|
||||
@ -353,7 +354,7 @@ class SettingsRegistry(
|
||||
suspend fun updateSystemSetting(key: String, value: Any): Boolean {
|
||||
if (validateSystemSetting(key, value)) {
|
||||
val previousValue = systemSettings[key]
|
||||
|
||||
|
||||
// Apply the setting to Android system if it's a system setting
|
||||
val success = if (isAndroidSystemSetting(key)) {
|
||||
applyAndroidSystemSetting(key, value)
|
||||
@ -612,7 +613,8 @@ class SettingsRegistry(
|
||||
temperatureController.temperatureFlow.collect { temperature ->
|
||||
val previousValue = systemSettings["device.temperature"]
|
||||
systemSettings["device.temperature"] = temperature
|
||||
val change = SettingChange("system", "", "device.temperature", temperature, previousValue)
|
||||
val change =
|
||||
SettingChange("system", "", "device.temperature", temperature, previousValue)
|
||||
updateSettingsFlow(listOf(change))
|
||||
}
|
||||
}
|
||||
|
||||
8
scripts/restart-sdk.sh
Executable file
8
scripts/restart-sdk.sh
Executable file
@ -0,0 +1,8 @@
|
||||
adb shell /data/local/tmp/bin/pinitd-cli stop bridge-settings-service
|
||||
adb shell /data/local/tmp/bin/pinitd-cli stop bridge-shell-service
|
||||
adb shell /data/local/tmp/bin/pinitd-cli stop bridge-system-service
|
||||
adb shell /data/local/tmp/bin/pinitd-cli restart bridge-service
|
||||
|
||||
adb shell /data/local/tmp/bin/pinitd-cli start bridge-settings-service
|
||||
adb shell /data/local/tmp/bin/pinitd-cli start bridge-shell-service
|
||||
adb shell /data/local/tmp/bin/pinitd-cli start bridge-system-service
|
||||
@ -20,7 +20,6 @@ import io.ktor.util.AttributeKey
|
||||
import io.ktor.util.date.GMTDate
|
||||
import io.ktor.utils.io.ByteChannel
|
||||
import io.ktor.utils.io.InternalAPI
|
||||
import io.ktor.utils.io.close
|
||||
import io.ktor.utils.io.writeStringUtf8
|
||||
|
||||
/**
|
||||
@ -91,24 +90,28 @@ class HttpClientPlugin(private val penumbraClient: PenumbraClient) {
|
||||
}
|
||||
|
||||
is HttpStreamResponse.Complete -> {
|
||||
Log.i("HttpClientPlugin", "Stream complete")
|
||||
streamingByteChannel.flushAndClose()
|
||||
}
|
||||
|
||||
is HttpStreamResponse.Error -> {
|
||||
streamingByteChannel.close(RuntimeException("Stream error: ${response.message}"))
|
||||
Log.e("HttpClientPlugin", "Stream error: ${response.message}")
|
||||
streamingByteChannel.close()
|
||||
throw RuntimeException("Stream error: ${response.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("HttpClientPlugin", "Exception in streaming flow", e)
|
||||
streamingByteChannel.close(e)
|
||||
streamingByteChannel.close()
|
||||
throw e
|
||||
}
|
||||
|
||||
val headersList = mutableListOf<Pair<String, List<String>>>()
|
||||
for (header in headers) {
|
||||
headersList.add(Pair(header.key, listOf(header.value)))
|
||||
}
|
||||
|
||||
|
||||
HttpClientCall(
|
||||
scope,
|
||||
request.build(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user