1ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk/* 2ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * Copyright (C) 2017 The Android Open Source Project 3ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * 4ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 5ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * except in compliance with the License. You may obtain a copy of the License at 6ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * 7ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * http://www.apache.org/licenses/LICENSE-2.0 8ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * 9ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * Unless required by applicable law or agreed to in writing, software distributed under the 10ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 11ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * KIND, either express or implied. See the License for the specific language governing 12ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk * permissions and limitations under the License. 13ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk */ 14ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk 15ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monkpackage com.android.systemui.plugins; 16ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk 17ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monkimport com.android.systemui.plugins.annotations.ProvidesInterface; 18ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk 19ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk@ProvidesInterface(version = PluginDependency.VERSION) 20ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monkpublic class PluginDependency { 21ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk public static final int VERSION = 1; 22ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk static DependencyProvider sProvider; 23ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk 24ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk public static <T> T get(Plugin p, Class<T> cls) { 25ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk return sProvider.get(p, cls); 26ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk } 27ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk 28ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk static abstract class DependencyProvider { 29ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk abstract <T> T get(Plugin p, Class<T> cls); 30ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk } 31ec34da8f6f31c5ee1e543c0c7999a067487e0ce9Jason Monk} 32