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

Commit 1b35253f authored by Kunhung Li's avatar Kunhung Li
Browse files

Add clock plugin interface

More flexible to test any clock plugin in the future

Bug: 111971817
Test: manual test
Change-Id: I45fa2d1ca99446abdb315cc28b58956d8e409283
parent b7c4ef8b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -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
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
# Global plugin dependencies
These classes can be accessed by any plugin using PluginDependency as long as they @Requires them.
These classes can be accessed by any plugin using PluginDependency as long as they @Requires them.
+47 −0
Original line number Original line Diff line number Diff line
/*
 * 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);
}