1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.plugins; 18 19 import android.content.Context; 20 21 import com.android.systemui.plugins.annotations.DependsOn; 22 import com.android.systemui.plugins.annotations.ProvidesInterface; 23 24 /** 25 * Used to capture Falsing data (related to unlocking the screen). 26 * 27 * The intent is that the data can later be analyzed to validate the quality of the 28 * {@link FalsingManager}. 29 */ 30 @ProvidesInterface(action = FalsingPlugin.ACTION, version = FalsingPlugin.VERSION) 31 @DependsOn(target = FalsingManager.class) 32 public interface FalsingPlugin extends Plugin { 33 String ACTION = "com.android.systemui.action.FALSING_PLUGIN"; 34 int VERSION = 2; 35 36 /** 37 * Called when there is data to be recorded. 38 * 39 * @param success Indicates whether the action is considered a success. 40 * @param data The raw data to be recorded for analysis. 41 */ dataCollected(boolean success, byte[] data)42 default void dataCollected(boolean success, byte[] data) { } 43 44 /** 45 * Return a {@link FalsingManager} to be used in place of the system's default. 46 * 47 * @param context 48 */ getFalsingManager(Context context)49 default FalsingManager getFalsingManager(Context context) { 50 return null; 51 } 52 } 53