gpt4 book ai didi

android - 没有 "Apps using Usage Data"或 android.settings.USAGE_ACCESS_SETTINGS Intent 的设备

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:17:20 33 4
gpt4 key购买 nike

背景:Android 5 引入了一个新的 UsageStats可用于查询在不同应用程序上花费的时间的 API。此 API 在多个应用程序中用于检测当前的前台应用程序(如几个问题中所讨论的,例如 this ),但是:

This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application.

由于未向用户提供权限,应用程序使用带有操作的 Intent 将用户发送到设置 android.settings.USAGE_ACCESS_SETTINGS .但有时甚至连这个设置都不可用:

In some cases, a matching Activity may not exist, so ensure you safeguard against this.

这意味着在这些手机中,几乎不可能访问使用情况统计信息。

这已在其他问题中讨论过,例如 herehere .显然,一些制造商决定从某些设备(尤其是三星和 LG,但也可能是其他设备)中删除该功能。

问题:此问题的目的是收集有关不允许访问这些设置的设备的信息。请发布您发现是这种情况的品牌、型号和操作系统版本。 此外,如果有人可以找到访问使用情况统计信息的替代方法,那么如果您与他人分享,将会对其他人有所帮助。

请避免指向已弃用的 API,例如 getRecentTasks , 或 getRunningAppProcesses (通常会返回几个具有优先前景的包),或者如何配置 Manifest 文件。

最佳答案

我将从一个我已确认不符合 Intent 的列表开始:

Model                     OS version
Samsung Galaxy Note 3 5.0
Samsung Galaxy S4 5.0.1
Samsung Galaxy Note S4 5.0.1
Samsung Galaxy S5 5.0
Samsung Galaxy S5 CDMA 5.0
Meizu m2 note 5.1
Samsung Galaxy S5 5.0
OnePlus One 5.0.2
Meizu MX4 5.0.1

此外,我们的一些用户提示:

LG G3                     5.0

关于android - 没有 "Apps using Usage Data"或 android.settings.USAGE_ACCESS_SETTINGS Intent 的设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32135903/

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