Add clock plugin interface

More flexible to test any clock plugin in the future

Bug: 111971817
Test: manual test
Change-Id: I45fa2d1ca99446abdb315cc28b58956d8e409283
This commit is contained in:
Kunhung Li
2018-07-30 18:15:12 +08:00
parent b7c4ef8bb0
commit 1b35253f58
2 changed files with 51 additions and 0 deletions

View File

@@ -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.

View File

@@ -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);
}