Merge "Remove error-level deprecations from ktx" into pi-androidx-dev
diff --git a/core/ktx/src/main/java/androidx/core/content/Context.kt b/core/ktx/src/main/java/androidx/core/content/Context.kt
index cba0a7d..7659c9b 100644
--- a/core/ktx/src/main/java/androidx/core/content/Context.kt
+++ b/core/ktx/src/main/java/androidx/core/content/Context.kt
@@ -34,14 +34,6 @@
 inline fun <reified T> Context.getSystemService(): T? =
         ContextCompat.getSystemService(this, T::class.java)
 
-@Deprecated(
-    "Use getSystemService",
-    ReplaceWith("this.getSystemService<T>()"),
-    DeprecationLevel.ERROR
-)
-inline fun <reified T> Context.systemService(): T? =
-        ContextCompat.getSystemService(this, T::class.java)
-
 /**
  * Executes [block] on a [TypedArray] receiver. The [TypedArray] holds the attribute
  * values in [set] that are listed in [attrs]. In addition, if the given [AttributeSet]
diff --git a/core/ktx/src/main/java/androidx/core/database/Cursor.kt b/core/ktx/src/main/java/androidx/core/database/Cursor.kt
index d88a3ac..0132b2d 100644
--- a/core/ktx/src/main/java/androidx/core/database/Cursor.kt
+++ b/core/ktx/src/main/java/androidx/core/database/Cursor.kt
@@ -21,114 +21,6 @@
 import android.database.Cursor
 
 /**
- * Returns the value of the requested column as a byte array.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not a blob type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getBlob
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getBlob(columnName: String): ByteArray =
-    getBlob(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as a double.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not a floating-point type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getDouble
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getDouble(columnName: String): Double =
-    getDouble(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as a float.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not a floating-point type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getFloat
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getFloat(columnName: String): Float = getFloat(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as an integer.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not an integral type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getInt
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getInt(columnName: String): Int = getInt(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as a long.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not an integral type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getLong
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getLong(columnName: String): Long = getLong(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as a short.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not an integral type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getShort
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getShort(columnName: String): Short = getShort(getColumnIndexOrThrow(columnName))
-
-/**
- * Returns the value of the requested column as a string.
- *
- * The result and whether this method throws an exception when the column value is null or the
- * column type is not a string type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.getString
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getString(columnName: String): String =
-    getString(getColumnIndexOrThrow(columnName))
-
-/**
  * Returns the value of the requested column as a nullable byte array.
  *
  * The result and whether this method throws an exception when the column type is not a blob type is
@@ -204,122 +96,3 @@
  * @see Cursor.getString
  */
 inline fun Cursor.getStringOrNull(index: Int) = if (isNull(index)) null else getString(index)
-
-/**
- * Returns the value of the requested column as a nullable byte array.
- *
- * The result and whether this method throws an exception when the column type is not a blob type is
- * implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getBlob
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getBlobOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getBlob(it) }
-
-/**
- * Returns the value of the requested column as a nullable double.
- *
- * The result and whether this method throws an exception when the column type is not a
- * floating-point type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getDouble
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getDoubleOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getDouble(it) }
-
-/**
- * Returns the value of the requested column as a nullable float.
- *
- * The result and whether this method throws an exception when the column type is not a
- * floating-point type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getFloat
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getFloatOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getFloat(it) }
-
-/**
- * Returns the value of the requested column as a nullable integer.
- *
- * The result and whether this method throws an exception when the column type is not an integral
- * type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getInt
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getIntOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getInt(it) }
-
-/**
- * Returns the value of the requested column as a nullable long.
- *
- * The result and whether this method throws an exception when the column type is not an integral
- * type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getLong
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getLongOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getLong(it) }
-
-/**
- * Returns the value of the requested column as a nullable short.
- *
- * The result and whether this method throws an exception when the column type is not an integral
- * type is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getShort
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getShortOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getShort(it) }
-
-/**
- * Returns the value of the requested column as a nullable string.
- *
- * The result and whether this method throws an exception when the column type is not a string type
- * is implementation-defined.
- *
- * @see Cursor.getColumnIndexOrThrow
- * @see Cursor.isNull
- * @see Cursor.getString
- */
-@Deprecated(
-    "Use an abstraction like Room or look up column names once prior to iteration",
-    level = DeprecationLevel.ERROR
-)
-inline fun Cursor.getStringOrNull(columnName: String) =
-    getColumnIndexOrThrow(columnName).let { if (isNull(it)) null else getString(it) }
diff --git a/core/ktx/src/main/java/androidx/core/preference/PreferenceGroup.kt b/core/ktx/src/main/java/androidx/core/preference/PreferenceGroup.kt
deleted file mode 100644
index 718f6c2..0000000
--- a/core/ktx/src/main/java/androidx/core/preference/PreferenceGroup.kt
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.
- */
-
-@file:Suppress("NOTHING_TO_INLINE", "DeprecatedCallableAddReplaceWith", "DEPRECATION")
-
-package androidx.core.preference
-
-import android.preference.Preference
-import android.preference.PreferenceGroup
-
-/**
- * Returns the preference with `key`.
- *
- * @throws NullPointerException if no preference is found with that key.
- */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline operator fun PreferenceGroup.get(key: CharSequence): Preference = findPreference(key)
-
-/**
- * Returns the preference at `index`.
- *
- * @throws IndexOutOfBoundsException if index is less than 0 or greater than or equal to the count.
- */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-operator fun PreferenceGroup.get(index: Int): Preference = getPreference(index)
-        ?: throw IndexOutOfBoundsException("Index: $index, Size: $preferenceCount")
-
-/** Returns `true` if `preference` is found in this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-operator fun PreferenceGroup.contains(preference: Preference): Boolean {
-    for (index in 0 until preferenceCount) {
-        if (getPreference(index) == preference) {
-            return true
-        }
-    }
-    return false
-}
-
-/** Adds `preference` to this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline operator fun PreferenceGroup.plusAssign(preference: Preference) {
-    addPreference(preference)
-}
-
-/** Removes `preference` from this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline operator fun PreferenceGroup.minusAssign(preference: Preference) {
-    removePreference(preference)
-}
-
-/** Returns the number of preferences in this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline val PreferenceGroup.size: Int get() = preferenceCount
-
-/** Returns true if this preference group contains no preferences. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline fun PreferenceGroup.isEmpty(): Boolean = preferenceCount == 0
-
-/** Returns true if this preference group contains one or more preferences. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline fun PreferenceGroup.isNotEmpty(): Boolean = preferenceCount != 0
-
-/** Performs the given action on each preference in this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline fun PreferenceGroup.forEach(action: (preference: Preference) -> Unit) {
-    for (index in 0 until preferenceCount) {
-        action(getPreference(index))
-    }
-}
-
-/** Performs the given action on each preference in this preference group, providing its sequential index. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-inline fun PreferenceGroup.forEachIndexed(action: (index: Int, preference: Preference) -> Unit) {
-    for (index in 0 until preferenceCount) {
-        action(index, getPreference(index))
-    }
-}
-
-/** Returns a [MutableIterator] over the preferences in this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-operator fun PreferenceGroup.iterator(): Iterator<Preference> = PreferenceIterator(this)
-
-/** Returns a [Sequence] over the preferences in this preference group. */
-@Deprecated("Use Jetpack preference library", level = DeprecationLevel.ERROR)
-val PreferenceGroup.children: Sequence<Preference>
-    get() = object : Sequence<Preference> {
-        override fun iterator() = PreferenceIterator(this@children)
-    }
-
-private class PreferenceIterator(val group: PreferenceGroup) : MutableIterator<Preference> {
-    private var index = 0
-    override fun hasNext() = index < group.preferenceCount
-    override fun next() = group.getPreference(index++) ?: throw IndexOutOfBoundsException()
-    override fun remove() {
-        group.removePreference(group.getPreference(--index))
-    }
-}
diff --git a/core/ktx/src/main/java/androidx/core/text/SpannableString.kt b/core/ktx/src/main/java/androidx/core/text/SpannableString.kt
index 602e027..745dbf1 100644
--- a/core/ktx/src/main/java/androidx/core/text/SpannableString.kt
+++ b/core/ktx/src/main/java/androidx/core/text/SpannableString.kt
@@ -29,23 +29,6 @@
  */
 inline fun CharSequence.toSpannable(): Spannable = SpannableString.valueOf(this)
 
-/** Adds [span] to the entire text. */
-@Deprecated(
-    "Creates ambiguity when the Spannable is a SpannableStringBuilder",
-    ReplaceWith("this.setSpan(span, 0, this.length, SPAN_INCLUSIVE_EXCLUSIVE)"),
-    DeprecationLevel.ERROR
-)
-inline operator fun Spannable.plusAssign(span: Any) =
-    setSpan(span, 0, length, SPAN_INCLUSIVE_EXCLUSIVE)
-
-/** Removes [span] from this text. */
-@Deprecated(
-    "Creates ambiguity when the Spannable is a SpannableStringBuilder",
-    ReplaceWith("this.removeSpan(span)"),
-    DeprecationLevel.ERROR
-)
-inline operator fun Spannable.minusAssign(span: Any) = removeSpan(span)
-
 /** Clear all spans from this text. */
 @SuppressLint("SyntheticAccessor") // TODO remove https://issuetracker.google.com/issues/110243369
 inline fun Spannable.clearSpans() = getSpans<Any>().forEach { removeSpan(it) }
diff --git a/core/ktx/src/main/java/androidx/core/util/ArrayMap.kt b/core/ktx/src/main/java/androidx/core/util/ArrayMap.kt
deleted file mode 100644
index 853ceb2..0000000
--- a/core/ktx/src/main/java/androidx/core/util/ArrayMap.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-@file:Suppress("NOTHING_TO_INLINE") // Aliases to public API.
-
-package androidx.core.util
-
-import android.util.ArrayMap
-import androidx.annotation.RequiresApi
-import kotlin.Pair
-
-/** Returns an empty new [ArrayMap]. */
-@Deprecated("Use the AndroidX version of ArrayMap", level = DeprecationLevel.ERROR)
-@RequiresApi(19)
-inline fun <K, V> arrayMapOf(): ArrayMap<K, V> = ArrayMap()
-
-/**
- * Returns a new [ArrayMap] with the specified contents, given as a list of pairs where the first
- * component is the key and the second component is the value.
- *
- * If multiple pairs have the same key, the resulting map will contain the value from the last of
- * those pairs.
- */
-@Deprecated("Use the AndroidX version of ArrayMap", level = DeprecationLevel.ERROR)
-@RequiresApi(19)
-fun <K, V> arrayMapOf(vararg pairs: Pair<K, V>): ArrayMap<K, V> {
-    val map = ArrayMap<K, V>(pairs.size)
-    for (pair in pairs) {
-        map[pair.first] = pair.second
-    }
-    return map
-}
diff --git a/core/ktx/src/main/java/androidx/core/util/ArraySet.kt b/core/ktx/src/main/java/androidx/core/util/ArraySet.kt
deleted file mode 100644
index 674cc0a..0000000
--- a/core/ktx/src/main/java/androidx/core/util/ArraySet.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-@file:Suppress("NOTHING_TO_INLINE") // Aliases to public API.
-
-package androidx.core.util
-
-import android.util.ArraySet
-import androidx.annotation.RequiresApi
-
-/** Returns an empty new [ArraySet]. */
-@Deprecated("Use the AndroidX version of ArraySet", level = DeprecationLevel.ERROR)
-@RequiresApi(23)
-inline fun <T> arraySetOf(): ArraySet<T> = ArraySet()
-
-/** Returns a new [ArraySet] with the specified contents. */
-@Deprecated("Use the AndroidX version of ArraySet", level = DeprecationLevel.ERROR)
-@RequiresApi(23)
-fun <T> arraySetOf(vararg values: T): ArraySet<T> {
-    val set = ArraySet<T>(values.size)
-    @Suppress("LoopToCallChain") // Causes needless copy to a list.
-    for (value in values) {
-        set.add(value)
-    }
-    return set
-}
diff --git a/core/ktx/src/main/java/androidx/core/util/Locale.kt b/core/ktx/src/main/java/androidx/core/util/Locale.kt
deleted file mode 100644
index e8f311a..0000000
--- a/core/ktx/src/main/java/androidx/core/util/Locale.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 androidx.core.util
-
-import android.text.TextUtils
-import androidx.annotation.RequiresApi
-import androidx.core.text.layoutDirection as newLayoutDirection
-import java.util.Locale
-
-/**
- * Returns layout direction for a given locale.
- *
- * @see TextUtils.getLayoutDirectionFromLocale
- */
-@Deprecated("Moved to androidx.core.text package", level = DeprecationLevel.ERROR)
-inline val Locale.layoutDirection: Int
-    @RequiresApi(17)
-    get() = newLayoutDirection
diff --git a/core/ktx/src/main/java/androidx/core/view/View.kt b/core/ktx/src/main/java/androidx/core/view/View.kt
index 0e92a5a..3a70445 100644
--- a/core/ktx/src/main/java/androidx/core/view/View.kt
+++ b/core/ktx/src/main/java/androidx/core/view/View.kt
@@ -23,10 +23,8 @@
 import android.view.ViewGroup
 import android.view.ViewGroup.MarginLayoutParams
 import android.view.ViewTreeObserver
-import android.view.accessibility.AccessibilityEvent
 import androidx.annotation.Px
 import androidx.annotation.RequiresApi
-import androidx.annotation.StringRes
 import androidx.core.graphics.applyCanvas
 
 /**
@@ -94,22 +92,6 @@
 }
 
 /**
- * Sends [AccessibilityEvent] of type [AccessibilityEvent.TYPE_ANNOUNCEMENT].
- *
- * @see View.announceForAccessibility
- */
-@RequiresApi(16)
-@Deprecated(
-    "General usage of this functionality is discouraged",
-    ReplaceWith("this.announceForAccessibility(this.resources.getString(resource))"),
-    DeprecationLevel.ERROR
-)
-inline fun View.announceForAccessibility(@StringRes resource: Int) {
-    val announcement = resources.getString(resource)
-    announceForAccessibility(announcement)
-}
-
-/**
  * Updates this view's relative padding. This version of the method allows using named parameters
  * to just set one or more axes.
  *
@@ -203,27 +185,6 @@
  *
  * @param config Bitmap config of the desired bitmap. Defaults to [Bitmap.Config.ARGB_8888].
  */
-@Deprecated(
-    "Renamed to drawToBitmap()",
-    ReplaceWith("this.drawToBitmap(config)"),
-    DeprecationLevel.ERROR
-)
-inline fun View.toBitmap(config: Bitmap.Config = Bitmap.Config.ARGB_8888) = drawToBitmap(config)
-
-/**
- * Return a [Bitmap] representation of this [View].
- *
- * The resulting bitmap will be the same width and height as this view's current layout
- * dimensions. This does not take into account any transformations such as scale or translation.
- *
- * Note, this will use the software rendering pipeline to draw the view to the bitmap. This may
- * result with different drawing to what is rendered on a hardware accelerated canvas (such as
- * the device screen).
- *
- * If this view has not been laid out this method will throw a [IllegalStateException].
- *
- * @param config Bitmap config of the desired bitmap. Defaults to [Bitmap.Config.ARGB_8888].
- */
 fun View.drawToBitmap(config: Bitmap.Config = Bitmap.Config.ARGB_8888): Bitmap {
     if (!ViewCompat.isLaidOut(this)) {
         throw IllegalStateException("View needs to be laid out before calling drawToBitmap()")
diff --git a/core/ktx/src/main/java/androidx/core/widget/Toast.kt b/core/ktx/src/main/java/androidx/core/widget/Toast.kt
deleted file mode 100644
index 914d992..0000000
--- a/core/ktx/src/main/java/androidx/core/widget/Toast.kt
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-@file:Suppress("NOTHING_TO_INLINE")
-
-package androidx.core.widget
-
-import android.content.Context
-import android.widget.Toast
-import androidx.annotation.StringRes
-
-/**
- * Creates and shows a [Toast] with the given [text]
- *
- * @param duration Toast duration, defaults to [Toast.LENGTH_SHORT]
- */
-@Deprecated(
-    "The use of Toast is discouraged",
-    ReplaceWith("Toast.makeText(this, text, duration).show()"),
-    DeprecationLevel.ERROR
-)
-inline fun Context.toast(text: CharSequence, duration: Int = Toast.LENGTH_SHORT): Toast {
-    return Toast.makeText(this, text, duration).apply { show() }
-}
-
-/**
- * Creates and shows a [Toast] with text from a resource
- *
- * @param resId Resource id of the string resource to use
- * @param duration Toast duration, defaults to [Toast.LENGTH_SHORT]
- */
-@Deprecated(
-    "The use of Toast is discouraged",
-    ReplaceWith("Toast.makeText(this, resId, duration).show()"),
-    DeprecationLevel.ERROR
-)
-inline fun Context.toast(@StringRes resId: Int, duration: Int = Toast.LENGTH_SHORT): Toast {
-    return Toast.makeText(this, resId, duration).apply { show() }
-}
diff --git a/palette/ktx/src/main/java/androidx/palette/graphics/Palette.kt b/palette/ktx/src/main/java/androidx/palette/graphics/Palette.kt
index a98c809..f1d00a5 100644
--- a/palette/ktx/src/main/java/androidx/palette/graphics/Palette.kt
+++ b/palette/ktx/src/main/java/androidx/palette/graphics/Palette.kt
@@ -18,20 +18,6 @@
 
 package androidx.palette.graphics
 
-import android.graphics.Bitmap
-
-/**
- * Create a [Palette.Builder] from this bitmap.
- *
- * @see Palette.from
- */
-@Deprecated(
-    "Invoke the builder directly",
-    ReplaceWith("Palette.Builder(this)"),
-    DeprecationLevel.ERROR
-)
-inline fun Bitmap.buildPalette() = Palette.Builder(this)
-
 /**
  * Returns the selected swatch for the given target from the palette, or `null` if one
  * could not be found.