有没有一种方法可以在 android studio 中使用(副本)类,它曾经被弃用然后被删除?

Is there a way I can use (copies of) classes in android studio, that once got deprecated and then deleted?

我在 google/Whosebug 上的任何地方都没有找到我的问题的答案,我想很多其他人也会想知道同样的事情。 我的问题不是,如果弃用 classes/methods 可以在 android studio 中使用。
我想知道是否有办法使用 classes/methods,即使它们已从 android 库中删除。

例如,我创建了自己的系统键盘,它需要 键盘 class,自 API 29.
以来已弃用 如果那个 class 一旦被删除,我可以在某处找到它的副本,然后 copy/import 到我的项目中吗?这是最简单的方法吗?
还是我只需要更改 .gradle 文件中有关 SdkVersions 的内容?

感谢任何帮助。 -kuyaC

If that class once gets deleted

那个class不太可能被删除。如果是,它将破坏任何依赖它的现有输入法编辑器。

can I just find a copy of it somewhere, and copy/import it into my project?

我不会在那句话中使用 "just" 这个词。 :-)

您可以很容易地获得 Keyboard 的来源 — here is the one from Android Q Beta 6。但是,它不会为您编译,因为它将依赖于许多不属于 Android SDK 的内部 classes 和资源。

因此,虽然您可以将其用作创建自己的替代品的灵感,但它不太可能直接使用。