diff options
| author | 2018-07-30 18:15:12 +0800 | |
|---|---|---|
| committer | 2018-08-08 18:23:35 +0800 | |
| commit | 1b35253f58635a67cb3a31850e3989d3717a3755 (patch) | |
| tree | 1d60e69dc3abcb8fa858b2fdca7d31b80f914d0d | |
| parent | b7c4ef8bb02ec203edd2af0ba7bc3892ace7bae4 (diff) | |
Add clock plugin interface
More flexible to test any clock plugin in the future
Bug: 111971817
Test: manual test
Change-Id: I45fa2d1ca99446abdb315cc28b58956d8e409283
| -rw-r--r-- | packages/SystemUI/docs/plugin_hooks.md | 4 | ||||
| -rw-r--r-- | packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java | 47 |
2 files changed, 51 insertions, 0 deletions
diff --git a/packages/SystemUI/docs/plugin_hooks.md b/packages/SystemUI/docs/plugin_hooks.md index 5b08bfc387db..9fe2e181971a 100644 --- a/packages/SystemUI/docs/plugin_hooks.md +++ b/packages/SystemUI/docs/plugin_hooks.md @@ -51,6 +51,10 @@ Expected interface: [NotificationSwipeActionHelper](/packages/SystemUI/plugin/sr Use: Control over swipes/input for notification views, can be used to control what happens when you swipe/long-press +### Action: com.android.systemui.action.PLUGIN_CLOCK +Expected interface: [ClockPlugin](/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java) + +Use: Allows replacement of the keyguard main clock. # Global plugin dependencies These classes can be accessed by any plugin using PluginDependency as long as they @Requires them. diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java new file mode 100644 index 000000000000..b4fc82018303 --- /dev/null +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +package com.android.systemui.plugins; + +import com.android.systemui.plugins.annotations.ProvidesInterface; + +import android.graphics.Paint.Style; +import android.view.View; + +/** + * This plugin is used to replace main clock in keyguard. + */ +@ProvidesInterface(action = ClockPlugin.ACTION, version = ClockPlugin.VERSION) +public interface ClockPlugin extends Plugin { + + String ACTION = "com.android.systemui.action.PLUGIN_CLOCK"; + int VERSION = 1; + + /** + * Get clock view. + * @return clock view from plugin. + */ + View getView(); + + /** + * Set clock paint style. + * @param style The new style to set in the paint. + */ + void setStyle(Style style); + + /** + * Set clock text color. + * @param color A color value. + */ + void setTextColor(int color); +} |