Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf5e9578 authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Automerger Merge Worker
Browse files

Merge "Override for testing when clock is not set" into tm-qpr-dev am: 2e1ca7f6

parents 655f531b 2e1ca7f6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1940,6 +1940,9 @@
    <!-- SysUI Tuner: Summary of no shortcut being selected [CHAR LIMIT=60] -->
    <string name="lockscreen_none">None</string>

    <!-- ClockId to use when none is set by user -->
    <string name="lockscreen_clock_id_fallback" translatable="false">DEFAULT</string>

    <!-- SysUI Tuner: Format string for describing launching an app [CHAR LIMIT=60] -->
    <string name="tuner_launch_app">Launch <xliff:g id="app" example="Settings">%1$s</xliff:g></string>

+6 −2
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ open class ClockRegistry(
    val isEnabled: Boolean,
    userHandle: Int,
    defaultClockProvider: ClockProvider,
    val fallbackClockId: ClockId = DEFAULT_CLOCK_ID,
) {
    // Usually this would be a typealias, but a SAM provides better java interop
    fun interface ClockChangeListener {
@@ -69,10 +70,13 @@ open class ClockRegistry(
                    context.contentResolver,
                    Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE
                )
                ClockSetting.deserialize(json)?.clockId ?: DEFAULT_CLOCK_ID
                if (json == null || json.isEmpty()) {
                    return fallbackClockId
                }
                ClockSetting.deserialize(json).clockId
            } catch (ex: Exception) {
                Log.e(TAG, "Failed to parse clock setting", ex)
                DEFAULT_CLOCK_ID
                fallbackClockId
            }
        }
        set(value) {
+3 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Handler;
import android.os.UserHandle;

import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Application;
import com.android.systemui.dagger.qualifiers.Main;
@@ -50,6 +51,7 @@ public abstract class ClockRegistryModule {
                handler,
                featureFlags.isEnabled(Flags.LOCKSCREEN_CUSTOM_CLOCKS),
                UserHandle.USER_ALL,
                defaultClockProvider);
                defaultClockProvider,
                context.getString(R.string.lockscreen_clock_id_fallback));
    }
}