Revert "Use codegen to catch LinkageErrors from plugins"
Revert submission 28801121-codegen-plugin
Reason for revert: Droidmonitor created revert due to b/368040334.
Reverted changes: /q/submissionid:28801121-codegen-plugin
Change-Id: I7888264372acdbb7352f80317926aab84be140da
diff --git a/packages/SystemUI/plugin/Android.bp b/packages/SystemUI/plugin/Android.bp
index a26cf12..682a68f 100644
--- a/packages/SystemUI/plugin/Android.bp
+++ b/packages/SystemUI/plugin/Android.bp
@@ -23,7 +23,9 @@
}
java_library {
+
name: "SystemUIPluginLib",
+
srcs: [
"bcsmartspace/src/**/*.java",
"bcsmartspace/src/**/*.kt",
@@ -38,8 +40,6 @@
export_proguard_flags_files: true,
},
- plugins: ["PluginAnnotationProcessor"],
-
// If you add a static lib here, you may need to also add the package to the ClassLoaderFilter
// in PluginInstance. That will ensure that loaded plugins have access to the related classes.
// You should also add it to proguard_common.flags so that proguard does not remove the portions
@@ -53,6 +53,7 @@
"SystemUILogLib",
"androidx.annotation_annotation",
],
+
}
android_app {
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockProviderPlugin.kt b/packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockProviderPlugin.kt
index 6d27b6f..8dc4815 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockProviderPlugin.kt
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockProviderPlugin.kt
@@ -21,11 +21,7 @@
import com.android.internal.annotations.Keep
import com.android.systemui.log.core.MessageBuffer
import com.android.systemui.plugins.Plugin
-import com.android.systemui.plugins.annotations.GeneratedImport
-import com.android.systemui.plugins.annotations.ProtectedInterface
-import com.android.systemui.plugins.annotations.ProtectedReturn
import com.android.systemui.plugins.annotations.ProvidesInterface
-import com.android.systemui.plugins.annotations.SimpleProperty
import java.io.PrintWriter
import java.util.Locale
import java.util.TimeZone
@@ -35,7 +31,6 @@
typealias ClockId = String
/** A Plugin which exposes the ClockProvider interface */
-@ProtectedInterface
@ProvidesInterface(action = ClockProviderPlugin.ACTION, version = ClockProviderPlugin.VERSION)
interface ClockProviderPlugin : Plugin, ClockProvider {
companion object {
@@ -45,42 +40,31 @@
}
/** Interface for building clocks and providing information about those clocks */
-@ProtectedInterface
-@GeneratedImport("java.util.List")
-@GeneratedImport("java.util.ArrayList")
interface ClockProvider {
/** Initializes the clock provider with debug log buffers */
fun initialize(buffers: ClockMessageBuffers?)
- @ProtectedReturn("return new ArrayList<ClockMetadata>();")
/** Returns metadata for all clocks this provider knows about */
fun getClocks(): List<ClockMetadata>
- @ProtectedReturn("return null;")
/** Initializes and returns the target clock design */
- fun createClock(settings: ClockSettings): ClockController?
+ fun createClock(settings: ClockSettings): ClockController
- @ProtectedReturn("return new ClockPickerConfig(\"\", \"\", \"\", null);")
/** Settings configuration parameters for the clock */
fun getClockPickerConfig(id: ClockId): ClockPickerConfig
}
/** Interface for controlling an active clock */
-@ProtectedInterface
interface ClockController {
- @get:SimpleProperty
/** A small version of the clock, appropriate for smaller viewports */
val smallClock: ClockFaceController
- @get:SimpleProperty
/** A large version of the clock, appropriate when a bigger viewport is available */
val largeClock: ClockFaceController
- @get:SimpleProperty
/** Determines the way the hosting app should behave when rendering either clock face */
val config: ClockConfig
- @get:SimpleProperty
/** Events that clocks may need to respond to */
val events: ClockEvents
@@ -92,26 +76,19 @@
}
/** Interface for a specific clock face version rendered by the clock */
-@ProtectedInterface
interface ClockFaceController {
- @get:SimpleProperty
- @Deprecated("Prefer use of layout")
/** View that renders the clock face */
val view: View
- @get:SimpleProperty
/** Layout specification for this clock */
val layout: ClockFaceLayout
- @get:SimpleProperty
/** Determines the way the hosting app should behave when rendering this clock face */
val config: ClockFaceConfig
- @get:SimpleProperty
/** Events specific to this clock face */
val events: ClockFaceEvents
- @get:SimpleProperty
/** Triggers for various animations */
val animations: ClockAnimations
}
@@ -130,21 +107,14 @@
data class AodClockBurnInModel(val scale: Float, val translationX: Float, val translationY: Float)
-/** Specifies layout information for the clock face */
-@ProtectedInterface
-@GeneratedImport("java.util.ArrayList")
-@GeneratedImport("android.view.View")
+/** Specifies layout information for the */
interface ClockFaceLayout {
- @get:ProtectedReturn("return new ArrayList<View>();")
/** All clock views to add to the root constraint layout before applying constraints. */
val views: List<View>
- @ProtectedReturn("return constraints;")
/** Custom constraints to apply to Lockscreen ConstraintLayout. */
fun applyConstraints(constraints: ConstraintSet): ConstraintSet
- @ProtectedReturn("return constraints;")
- /** Custom constraints to apply to preview ConstraintLayout. */
fun applyPreviewConstraints(constraints: ConstraintSet): ConstraintSet
fun applyAodBurnIn(aodBurnInModel: AodClockBurnInModel)
@@ -175,9 +145,7 @@
}
/** Events that should call when various rendering parameters change */
-@ProtectedInterface
interface ClockEvents {
- @get:ProtectedReturn("return false;")
/** Set to enable or disable swipe interaction */
var isReactiveTouchInteractionEnabled: Boolean
@@ -219,7 +187,6 @@
)
/** Methods which trigger various clock animations */
-@ProtectedInterface
interface ClockAnimations {
/** Runs an enter animation (if any) */
fun enter()
@@ -263,7 +230,6 @@
}
/** Events that have specific data about the related face */
-@ProtectedInterface
interface ClockFaceEvents {
/** Call every time tick */
fun onTimeTick()
@@ -304,9 +270,7 @@
/** Some data about a clock design */
data class ClockMetadata(val clockId: ClockId)
-data class ClockPickerConfig
-@JvmOverloads
-constructor(
+data class ClockPickerConfig(
val id: String,
/** Localized name of the clock */
@@ -374,7 +338,7 @@
/** Transition to AOD should move smartspace like large clock instead of small clock */
val useAlternateSmartspaceAODTransition: Boolean = false,
- /** Deprecated version of isReactiveToTone; moved to ClockPickerConfig */
+ /** Use ClockPickerConfig.isReactiveToTone instead */
@Deprecated("TODO(b/352049256): Remove in favor of ClockPickerConfig.isReactiveToTone")
val isReactiveToTone: Boolean = true,