Use -Xjvm-default=all instead of -Xjvm-default=enable or @JvmDefault

The @JvmDefault annotation and -Xjvm-default=enable argument are both
removed from kotlinc 1.9.0 in favor of -Xjvm-default=all.

Bug: 291335478
Test: builds
Change-Id: I473e578b92482fbd6c8812c4d32acc1a4c27a84a
This commit is contained in:
Colin Cross
2023-07-18 10:52:21 -07:00
parent f06c3ce319
commit 6954ea754a
27 changed files with 30 additions and 78 deletions

View File

@@ -166,7 +166,7 @@ android_library {
// *.kt sources are inside a filegroup. // *.kt sources are inside a filegroup.
"kotlin-annotations", "kotlin-annotations",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
manifest: "AndroidManifest.xml", manifest: "AndroidManifest.xml",
plugins: ["dagger2-compiler"], plugins: ["dagger2-compiler"],
} }

View File

@@ -94,7 +94,6 @@ class FloatingContentCoordinator constructor() {
* non-overlapping. * non-overlapping.
* @return The new bounds for this content. * @return The new bounds for this content.
*/ */
@JvmDefault
fun calculateNewBoundsOnOverlap( fun calculateNewBoundsOnOverlap(
overlappingContentBounds: Rect, overlappingContentBounds: Rect,
otherContentBounds: List<Rect> otherContentBounds: List<Rect>

View File

@@ -368,7 +368,6 @@ class DesktopModeTaskRepository {
/** /**
* Called when the active tasks change in desktop mode. * Called when the active tasks change in desktop mode.
*/ */
@JvmDefault
fun onActiveTasksChanged(displayId: Int) {} fun onActiveTasksChanged(displayId: Int) {}
} }
@@ -379,13 +378,11 @@ class DesktopModeTaskRepository {
/** /**
* Called when the desktop starts or stops showing freeform tasks. * Called when the desktop starts or stops showing freeform tasks.
*/ */
@JvmDefault
fun onVisibilityChanged(displayId: Int, hasVisibleFreeformTasks: Boolean) {} fun onVisibilityChanged(displayId: Int, hasVisibleFreeformTasks: Boolean) {}
/** /**
* Called when the desktop stashed status changes. * Called when the desktop stashed status changes.
*/ */
@JvmDefault
fun onStashedChanged(displayId: Int, stashed: Boolean) {} fun onStashedChanged(displayId: Int, stashed: Boolean) {}
} }
} }

View File

@@ -61,7 +61,7 @@ android_test {
"libstaticjvmtiagent", "libstaticjvmtiagent",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
plugins: ["dagger2-compiler"], plugins: ["dagger2-compiler"],

View File

@@ -44,7 +44,7 @@ android_app {
platform_apis: true, platform_apis: true,
privileged: true, privileged: true,
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
optimize: { optimize: {
proguard_compatibility: false, proguard_compatibility: false,

View File

@@ -70,5 +70,5 @@ android_app {
manifest: "AndroidManifest.xml", manifest: "AndroidManifest.xml",
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
} }

View File

@@ -203,7 +203,7 @@ android_library {
manifest: "AndroidManifest.xml", manifest: "AndroidManifest.xml",
javacflags: ["-Adagger.fastInit=enabled"], javacflags: ["-Adagger.fastInit=enabled"],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
plugins: ["dagger2-compiler"], plugins: ["dagger2-compiler"],
@@ -394,7 +394,7 @@ android_library {
"android.test.base", "android.test.base",
"android.test.mock", "android.test.mock",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
aaptflags: [ aaptflags: [
"--extra-packages", "--extra-packages",
"com.android.systemui", "com.android.systemui",
@@ -516,7 +516,7 @@ android_app {
certificate: "platform", certificate: "platform",
privileged: true, privileged: true,
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
dxflags: ["--multi-dex"], dxflags: ["--multi-dex"],
optimize: { optimize: {

View File

@@ -302,10 +302,9 @@ class ActivityLaunchAnimator(
interface Callback { interface Callback {
/** Whether we are currently on the keyguard or not. */ /** Whether we are currently on the keyguard or not. */
@JvmDefault fun isOnKeyguard(): Boolean = false fun isOnKeyguard(): Boolean = false
/** Hide the keyguard and animate using [runner]. */ /** Hide the keyguard and animate using [runner]. */
@JvmDefault
fun hideKeyguardWithAnimation(runner: IRemoteAnimationRunner) { fun hideKeyguardWithAnimation(runner: IRemoteAnimationRunner) {
throw UnsupportedOperationException() throw UnsupportedOperationException()
} }
@@ -316,16 +315,16 @@ class ActivityLaunchAnimator(
interface Listener { interface Listener {
/** Called when an activity launch animation started. */ /** Called when an activity launch animation started. */
@JvmDefault fun onLaunchAnimationStart() {} fun onLaunchAnimationStart() {}
/** /**
* Called when an activity launch animation is finished. This will be called if and only if * Called when an activity launch animation is finished. This will be called if and only if
* [onLaunchAnimationStart] was called earlier. * [onLaunchAnimationStart] was called earlier.
*/ */
@JvmDefault fun onLaunchAnimationEnd() {} fun onLaunchAnimationEnd() {}
/** Called when an activity launch animation made progress. */ /** Called when an activity launch animation made progress. */
@JvmDefault fun onLaunchAnimationProgress(linearProgress: Float) {} fun onLaunchAnimationProgress(linearProgress: Float) {}
} }
/** /**

View File

@@ -44,5 +44,5 @@ android_test {
"androidx.compose.ui_ui-test-manifest", "androidx.compose.ui_ui-test-manifest",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
} }

View File

@@ -44,5 +44,5 @@ android_test {
"androidx.compose.ui_ui-test-manifest", "androidx.compose.ui_ui-test-manifest",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
} }

View File

@@ -48,5 +48,5 @@ android_library {
], ],
min_sdk_version: "current", min_sdk_version: "current",
plugins: ["dagger2-compiler"], plugins: ["dagger2-compiler"],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
} }

View File

@@ -65,7 +65,7 @@ android_library {
], ],
min_sdk_version: "current", min_sdk_version: "current",
plugins: ["dagger2-compiler"], plugins: ["dagger2-compiler"],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
} }
java_library { java_library {

View File

@@ -171,7 +171,6 @@ class KeyguardUnlockAnimationController @Inject constructor(
* for the canned animation (if applicable) so interested parties can sync with it. If no * for the canned animation (if applicable) so interested parties can sync with it. If no
* canned animation is playing, these are both 0. * canned animation is playing, these are both 0.
*/ */
@JvmDefault
fun onUnlockAnimationStarted( fun onUnlockAnimationStarted(
playingCannedAnimation: Boolean, playingCannedAnimation: Boolean,
isWakeAndUnlockNotFromDream: Boolean, isWakeAndUnlockNotFromDream: Boolean,
@@ -184,7 +183,6 @@ class KeyguardUnlockAnimationController @Inject constructor(
* The keyguard is no longer visible in this state and the app/launcher behind the keyguard * The keyguard is no longer visible in this state and the app/launcher behind the keyguard
* is now completely visible. * is now completely visible.
*/ */
@JvmDefault
fun onUnlockAnimationFinished() {} fun onUnlockAnimationFinished() {}
} }

View File

@@ -145,13 +145,10 @@ class PrivacyConfig @Inject constructor(
} }
interface Callback { interface Callback {
@JvmDefault
fun onFlagMicCameraChanged(flag: Boolean) {} fun onFlagMicCameraChanged(flag: Boolean) {}
@JvmDefault
fun onFlagLocationChanged(flag: Boolean) {} fun onFlagLocationChanged(flag: Boolean) {}
@JvmDefault
fun onFlagMediaProjectionChanged(flag: Boolean) {} fun onFlagMediaProjectionChanged(flag: Boolean) {}
} }
} }

View File

@@ -216,7 +216,6 @@ class PrivacyItemController @Inject constructor(
interface Callback : PrivacyConfig.Callback { interface Callback : PrivacyConfig.Callback {
fun onPrivacyItemsChanged(privacyItems: List<PrivacyItem>) fun onPrivacyItemsChanged(privacyItems: List<PrivacyItem>)
@JvmDefault
fun onFlagAllChanged(flag: Boolean) {} fun onFlagAllChanged(flag: Boolean) {}
} }

View File

@@ -52,12 +52,12 @@ interface DisplayTracker {
interface Callback { interface Callback {
/** Notifies that a display has been added. */ /** Notifies that a display has been added. */
@JvmDefault fun onDisplayAdded(displayId: Int) {} fun onDisplayAdded(displayId: Int) {}
/** Notifies that a display has been removed. */ /** Notifies that a display has been removed. */
@JvmDefault fun onDisplayRemoved(displayId: Int) {} fun onDisplayRemoved(displayId: Int) {}
/** Notifies a display has been changed */ /** Notifies a display has been changed */
@JvmDefault fun onDisplayChanged(displayId: Int) {} fun onDisplayChanged(displayId: Int) {}
} }
} }

View File

@@ -71,7 +71,6 @@ interface UserTracker : UserContentResolverProvider, UserContextProvider {
* Same as {@link onUserChanging(Int, Context, CountDownLatch)} but the latch will be * Same as {@link onUserChanging(Int, Context, CountDownLatch)} but the latch will be
* auto-decremented after the completion of this method. * auto-decremented after the completion of this method.
*/ */
@JvmDefault
fun onUserChanging(newUser: Int, userContext: Context) {} fun onUserChanging(newUser: Int, userContext: Context) {}
/** /**
@@ -82,7 +81,6 @@ interface UserTracker : UserContentResolverProvider, UserContextProvider {
* user switch duration. When overriding this method, countDown() MUST be called on the * user switch duration. When overriding this method, countDown() MUST be called on the
* latch once execution is complete. * latch once execution is complete.
*/ */
@JvmDefault
fun onUserChanging(newUser: Int, userContext: Context, latch: CountDownLatch) { fun onUserChanging(newUser: Int, userContext: Context, latch: CountDownLatch) {
onUserChanging(newUser, userContext) onUserChanging(newUser, userContext)
latch.countDown() latch.countDown()
@@ -93,13 +91,11 @@ interface UserTracker : UserContentResolverProvider, UserContextProvider {
* Override this method to run things after the screen is unfrozen for the user switch. * Override this method to run things after the screen is unfrozen for the user switch.
* Please see {@link #onUserChanging} if you need to hide jank. * Please see {@link #onUserChanging} if you need to hide jank.
*/ */
@JvmDefault
fun onUserChanged(newUser: Int, userContext: Context) {} fun onUserChanged(newUser: Int, userContext: Context) {}
/** /**
* Notifies that the current user's profiles have changed. * Notifies that the current user's profiles have changed.
*/ */
@JvmDefault
fun onProfilesChanged(profiles: List<@JvmSuppressWildcards UserInfo>) {} fun onProfilesChanged(profiles: List<@JvmSuppressWildcards UserInfo>) {}
} }
} }

View File

@@ -29,12 +29,12 @@ interface ShadeStateEvents {
interface ShadeStateEventsListener { interface ShadeStateEventsListener {
/** Invoked when the notification panel starts or stops collapsing. */ /** Invoked when the notification panel starts or stops collapsing. */
@JvmDefault fun onPanelCollapsingChanged(isCollapsing: Boolean) {} fun onPanelCollapsingChanged(isCollapsing: Boolean) {}
/** /**
* Invoked when the notification panel starts or stops launching an [android.app.Activity]. * Invoked when the notification panel starts or stops launching an [android.app.Activity].
*/ */
@JvmDefault fun onLaunchingActivityChanged(isLaunchingActivity: Boolean) {} fun onLaunchingActivityChanged(isLaunchingActivity: Boolean) {}
/** /**
* Invoked when the "expand immediate" attribute changes. * Invoked when the "expand immediate" attribute changes.
@@ -45,6 +45,6 @@ interface ShadeStateEvents {
* Another example is when full QS is showing, and we swipe up from the bottom. Instead of * Another example is when full QS is showing, and we swipe up from the bottom. Instead of
* going to QQS, the panel fully collapses. * going to QQS, the panel fully collapses.
*/ */
@JvmDefault fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) {} fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) {}
} }
} }

View File

@@ -553,7 +553,6 @@ class NotificationShadeDepthController @Inject constructor(
*/ */
fun onWallpaperZoomOutChanged(zoomOut: Float) fun onWallpaperZoomOutChanged(zoomOut: Float)
@JvmDefault
fun onBlurRadiusChanged(blurRadius: Int) {} fun onBlurRadiusChanged(blurRadius: Int) {}
} }
} }

View File

@@ -29,7 +29,6 @@ interface SignalCallback {
* *
* @param wifiIndicators a box type containing enough information to properly draw a Wi-Fi icon * @param wifiIndicators a box type containing enough information to properly draw a Wi-Fi icon
*/ */
@JvmDefault
fun setWifiIndicators(wifiIndicators: WifiIndicators) {} fun setWifiIndicators(wifiIndicators: WifiIndicators) {}
/** /**
@@ -42,7 +41,6 @@ interface SignalCallback {
* NOTE: phones can have multiple subscriptions, so this [mobileDataIndicators] object should be * NOTE: phones can have multiple subscriptions, so this [mobileDataIndicators] object should be
* indexed based on its [subId][MobileDataIndicators.subId] * indexed based on its [subId][MobileDataIndicators.subId]
*/ */
@JvmDefault
fun setMobileDataIndicators(mobileDataIndicators: MobileDataIndicators) {} fun setMobileDataIndicators(mobileDataIndicators: MobileDataIndicators) {}
/** /**
@@ -51,7 +49,6 @@ interface SignalCallback {
* *
* @param subs a [SubscriptionInfo] for each subscription that we know about * @param subs a [SubscriptionInfo] for each subscription that we know about
*/ */
@JvmDefault
fun setSubs(subs: List<@JvmSuppressWildcards SubscriptionInfo>) {} fun setSubs(subs: List<@JvmSuppressWildcards SubscriptionInfo>) {}
/** /**
@@ -63,7 +60,6 @@ interface SignalCallback {
* @param show whether or not to show a "no sim" view * @param show whether or not to show a "no sim" view
* @param simDetected whether any SIM is detected or not * @param simDetected whether any SIM is detected or not
*/ */
@JvmDefault
fun setNoSims(show: Boolean, simDetected: Boolean) {} fun setNoSims(show: Boolean, simDetected: Boolean) {}
/** /**
@@ -72,7 +68,6 @@ interface SignalCallback {
* *
* @param icon an [IconState] for the current ethernet status * @param icon an [IconState] for the current ethernet status
*/ */
@JvmDefault
fun setEthernetIndicators(icon: IconState) {} fun setEthernetIndicators(icon: IconState) {}
/** /**
@@ -80,7 +75,6 @@ interface SignalCallback {
* *
* @param icon an [IconState] for the current airplane mode status * @param icon an [IconState] for the current airplane mode status
*/ */
@JvmDefault
fun setIsAirplaneMode(icon: IconState) {} fun setIsAirplaneMode(icon: IconState) {}
/** /**
@@ -88,7 +82,6 @@ interface SignalCallback {
* *
* @param enabled the current mobile data feature ennabled state * @param enabled the current mobile data feature ennabled state
*/ */
@JvmDefault
fun setMobileDataEnabled(enabled: Boolean) {} fun setMobileDataEnabled(enabled: Boolean) {}
/** /**
@@ -97,7 +90,6 @@ interface SignalCallback {
* @param noValidatedNetwork whether there is any validated network. * @param noValidatedNetwork whether there is any validated network.
* @param noNetworksAvailable whether there is any WiFi networks available. * @param noNetworksAvailable whether there is any WiFi networks available.
*/ */
@JvmDefault
fun setConnectivityStatus( fun setConnectivityStatus(
noDefaultNetwork: Boolean, noDefaultNetwork: Boolean,
noValidatedNetwork: Boolean, noValidatedNetwork: Boolean,
@@ -109,7 +101,6 @@ interface SignalCallback {
* @param statusIcon the icon for the call indicator * @param statusIcon the icon for the call indicator
* @param subId subscription ID for which to update the UI * @param subId subscription ID for which to update the UI
*/ */
@JvmDefault
fun setCallIndicator(statusIcon: IconState, subId: Int) {} fun setCallIndicator(statusIcon: IconState, subId: Int) {}
} }

View File

@@ -49,11 +49,10 @@ interface SystemStatusAnimationCallback {
fun onSystemEventAnimationFinish(hasPersistentDot: Boolean): Animator? { return null } fun onSystemEventAnimationFinish(hasPersistentDot: Boolean): Animator? { return null }
// Best method name, change my mind // Best method name, change my mind
@JvmDefault
fun onSystemStatusAnimationTransitionToPersistentDot(contentDescription: String?): Animator? { fun onSystemStatusAnimationTransitionToPersistentDot(contentDescription: String?): Animator? {
return null return null
} }
@JvmDefault fun onHidePersistentDot(): Animator? { return null } fun onHidePersistentDot(): Animator? { return null }
} }

View File

@@ -613,20 +613,20 @@ constructor(
interface WakeUpListener { interface WakeUpListener {
/** Called whenever the notifications are fully hidden or shown */ /** Called whenever the notifications are fully hidden or shown */
@JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {} fun onFullyHiddenChanged(isFullyHidden: Boolean) {}
/** /**
* Called whenever the pulseExpansion changes * Called whenever the pulseExpansion changes
* *
* @param expandingChanged if the user has started or stopped expanding * @param expandingChanged if the user has started or stopped expanding
*/ */
@JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {} fun onPulseExpansionChanged(expandingChanged: Boolean) {}
/** /**
* Called when the animator started by [scheduleDelayedDozeAmountAnimation] begins running * Called when the animator started by [scheduleDelayedDozeAmountAnimation] begins running
* after the start delay, or after it ends/is cancelled. * after the start delay, or after it ends/is cancelled.
*/ */
@JvmDefault fun onDelayedDozeAmountAnimationRunning(running: Boolean) {} fun onDelayedDozeAmountAnimationRunning(running: Boolean) {}
} }
companion object { companion object {

View File

@@ -27,37 +27,31 @@ interface Roundable {
/** Current top roundness */ /** Current top roundness */
@get:FloatRange(from = 0.0, to = 1.0) @get:FloatRange(from = 0.0, to = 1.0)
@JvmDefault
val topRoundness: Float val topRoundness: Float
get() = roundableState.topRoundness get() = roundableState.topRoundness
/** Current bottom roundness */ /** Current bottom roundness */
@get:FloatRange(from = 0.0, to = 1.0) @get:FloatRange(from = 0.0, to = 1.0)
@JvmDefault
val bottomRoundness: Float val bottomRoundness: Float
get() = roundableState.bottomRoundness get() = roundableState.bottomRoundness
/** Max radius in pixel */ /** Max radius in pixel */
@JvmDefault
val maxRadius: Float val maxRadius: Float
get() = roundableState.maxRadius get() = roundableState.maxRadius
/** Current top corner in pixel, based on [topRoundness] and [maxRadius] */ /** Current top corner in pixel, based on [topRoundness] and [maxRadius] */
@JvmDefault
val topCornerRadius: Float val topCornerRadius: Float
get() = get() =
if (roundableState.newHeadsUpAnimFlagEnabled) roundableState.topCornerRadius if (roundableState.newHeadsUpAnimFlagEnabled) roundableState.topCornerRadius
else topRoundness * maxRadius else topRoundness * maxRadius
/** Current bottom corner in pixel, based on [bottomRoundness] and [maxRadius] */ /** Current bottom corner in pixel, based on [bottomRoundness] and [maxRadius] */
@JvmDefault
val bottomCornerRadius: Float val bottomCornerRadius: Float
get() = get() =
if (roundableState.newHeadsUpAnimFlagEnabled) roundableState.bottomCornerRadius if (roundableState.newHeadsUpAnimFlagEnabled) roundableState.bottomCornerRadius
else bottomRoundness * maxRadius else bottomRoundness * maxRadius
/** Get and update the current radii */ /** Get and update the current radii */
@JvmDefault
val updatedRadii: FloatArray val updatedRadii: FloatArray
get() = get() =
roundableState.radiiBuffer.also { radii -> roundableState.radiiBuffer.also { radii ->
@@ -80,7 +74,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestTopRoundness( fun requestTopRoundness(
@FloatRange(from = 0.0, to = 1.0) value: Float, @FloatRange(from = 0.0, to = 1.0) value: Float,
sourceType: SourceType, sourceType: SourceType,
@@ -125,7 +118,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestTopRoundness( fun requestTopRoundness(
@FloatRange(from = 0.0, to = 1.0) value: Float, @FloatRange(from = 0.0, to = 1.0) value: Float,
sourceType: SourceType, sourceType: SourceType,
@@ -149,7 +141,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestBottomRoundness( fun requestBottomRoundness(
@FloatRange(from = 0.0, to = 1.0) value: Float, @FloatRange(from = 0.0, to = 1.0) value: Float,
sourceType: SourceType, sourceType: SourceType,
@@ -194,7 +185,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestBottomRoundness( fun requestBottomRoundness(
@FloatRange(from = 0.0, to = 1.0) value: Float, @FloatRange(from = 0.0, to = 1.0) value: Float,
sourceType: SourceType, sourceType: SourceType,
@@ -219,7 +209,6 @@ interface Roundable {
* @param animate true if it should animate to that value. * @param animate true if it should animate to that value.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestRoundness( fun requestRoundness(
@FloatRange(from = 0.0, to = 1.0) top: Float, @FloatRange(from = 0.0, to = 1.0) top: Float,
@FloatRange(from = 0.0, to = 1.0) bottom: Float, @FloatRange(from = 0.0, to = 1.0) bottom: Float,
@@ -246,7 +235,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @return Whether the roundness was changed. * @return Whether the roundness was changed.
*/ */
@JvmDefault
fun requestRoundness( fun requestRoundness(
@FloatRange(from = 0.0, to = 1.0) top: Float, @FloatRange(from = 0.0, to = 1.0) top: Float,
@FloatRange(from = 0.0, to = 1.0) bottom: Float, @FloatRange(from = 0.0, to = 1.0) bottom: Float,
@@ -270,7 +258,6 @@ interface Roundable {
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
* @param animate true if it should animate to that value. * @param animate true if it should animate to that value.
*/ */
@JvmDefault
fun requestRoundnessReset(sourceType: SourceType, animate: Boolean) { fun requestRoundnessReset(sourceType: SourceType, animate: Boolean) {
requestRoundness(top = 0f, bottom = 0f, sourceType = sourceType, animate = animate) requestRoundness(top = 0f, bottom = 0f, sourceType = sourceType, animate = animate)
} }
@@ -284,19 +271,16 @@ interface Roundable {
* *
* @param sourceType the source from which the request for roundness comes. * @param sourceType the source from which the request for roundness comes.
*/ */
@JvmDefault
fun requestRoundnessReset(sourceType: SourceType) { fun requestRoundnessReset(sourceType: SourceType) {
requestRoundnessReset(sourceType = sourceType, animate = roundableState.targetView.isShown) requestRoundnessReset(sourceType = sourceType, animate = roundableState.targetView.isShown)
} }
/** Apply the roundness changes, usually means invalidate the [RoundableState.targetView]. */ /** Apply the roundness changes, usually means invalidate the [RoundableState.targetView]. */
@JvmDefault
fun applyRoundnessAndInvalidate() { fun applyRoundnessAndInvalidate() {
roundableState.targetView.invalidate() roundableState.targetView.invalidate()
} }
/** @return true if top or bottom roundness is not zero. */ /** @return true if top or bottom roundness is not zero. */
@JvmDefault
fun hasRoundedCorner(): Boolean { fun hasRoundedCorner(): Boolean {
return topRoundness != 0f || bottomRoundness != 0f return topRoundness != 0f || bottomRoundness != 0f
} }
@@ -307,7 +291,6 @@ interface Roundable {
* *
* This method reuses the previous [radii] for performance reasons. * This method reuses the previous [radii] for performance reasons.
*/ */
@JvmDefault
fun updateRadii( fun updateRadii(
topCornerRadius: Float, topCornerRadius: Float,
bottomCornerRadius: Float, bottomCornerRadius: Float,

View File

@@ -23,7 +23,6 @@ import android.os.UserHandle
* changes. * changes.
*/ */
interface UserAwareController { interface UserAwareController {
@JvmDefault
fun changeUser(newUser: UserHandle) {} fun changeUser(newUser: UserHandle) {}
val currentUserId: Int val currentUserId: Int

View File

@@ -33,7 +33,7 @@ android_library {
"dagger2", "dagger2",
"jsr330", "jsr330",
], ],
kotlincflags: ["-Xjvm-default=enable"], kotlincflags: ["-Xjvm-default=all"],
java_version: "1.8", java_version: "1.8",
sdk_version: "current", sdk_version: "current",
min_sdk_version: "current", min_sdk_version: "current",

View File

@@ -35,14 +35,12 @@ interface UnfoldTransitionProgressProvider : CallbackController<TransitionProgre
interface TransitionProgressListener { interface TransitionProgressListener {
/** Called when transition is started */ /** Called when transition is started */
@JvmDefault
fun onTransitionStarted() {} fun onTransitionStarted() {}
/** /**
* Called whenever transition progress is updated, [progress] is a value of the animation * Called whenever transition progress is updated, [progress] is a value of the animation
* where 0 is fully folded, 1 is fully unfolded * where 0 is fully folded, 1 is fully unfolded
*/ */
@JvmDefault
fun onTransitionProgress(@FloatRange(from = 0.0, to = 1.0) progress: Float) {} fun onTransitionProgress(@FloatRange(from = 0.0, to = 1.0) progress: Float) {}
/** /**
@@ -51,11 +49,9 @@ interface UnfoldTransitionProgressProvider : CallbackController<TransitionProgre
* For example, in [PhysicsBasedUnfoldTransitionProgressProvider] this could happen when the * For example, in [PhysicsBasedUnfoldTransitionProgressProvider] this could happen when the
* animation is not tied to the hinge angle anymore and it is about to run fixed animation. * animation is not tied to the hinge angle anymore and it is about to run fixed animation.
*/ */
@JvmDefault
fun onTransitionFinishing() {} fun onTransitionFinishing() {}
/** Called when transition is completely finished */ /** Called when transition is completely finished */
@JvmDefault
fun onTransitionFinished() {} fun onTransitionFinished() {}
} }
} }

View File

@@ -31,9 +31,9 @@ interface FoldStateProvider : CallbackController<FoldUpdatesListener> {
val isFinishedOpening: Boolean val isFinishedOpening: Boolean
interface FoldUpdatesListener { interface FoldUpdatesListener {
@JvmDefault fun onHingeAngleUpdate(@FloatRange(from = 0.0, to = 180.0) angle: Float) {} fun onHingeAngleUpdate(@FloatRange(from = 0.0, to = 180.0) angle: Float) {}
@JvmDefault fun onFoldUpdate(@FoldUpdate update: Int) {} fun onFoldUpdate(@FoldUpdate update: Int) {}
@JvmDefault fun onUnfoldedScreenAvailable() {} fun onUnfoldedScreenAvailable() {}
} }
@IntDef( @IntDef(