gpt4 book ai didi

android - @UnsupportedAppUsage 注解描述了什么

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:49:00 26 4
gpt4 key购买 nike

我正在构建一个具有系统权限的企业应用程序,它需要使用 BluetoothAdapter 类 setScanMode 中的一个函数。这是一个隐藏的API,仅适用于系统签名的apks,现在这个函数上面有@UnsupportedAppUsage,任何人都可以帮助我理解这个注释。

https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/bluetooth/BluetoothAdapter.java

最佳答案

如果我们转到 annotation source :

/**
* Indicates that a class member, that is not part of the SDK, is used by apps.
* Since the member is not part of the SDK, such use is not supported.
*
* <p>This annotation acts as a heads up that changing a given method or field
* may affect apps, potentially breaking them when the next Android version is
* released. In some cases, for members that are heavily used, this annotation
* may imply restrictions on changes to the member.
*
* <p>This annotation also results in access to the member being permitted by the
* runtime, with a warning being generated in debug builds.
*
* <p>For more details, see go/UnsupportedAppUsage.
*
* {@hide}
*/

基本上,这意味着它正在被应用程序使用,即使它在技术上不是 SDK 的一部分,因此不受支持。这似乎更像是对任何为 AOSP 做出贡献的人的警告,而不是你需要担心太多的事情。

关于android - @UnsupportedAppUsage 注解描述了什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52499754/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com