Background: Android 5 introduced a new UsageStats API that can be used to query time spent with different apps. This API is used in several apps for detecting the current foreground app (as discussed in several questions, like this), but:
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.
As the permission is not presented to the user, apps send the user to Settings using an intent with the action android.settings.USAGE_ACCESS_SETTINGS. But sometimes not even this setting is available:
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Which means that in those phones, it's practically impossible to get access to the usage stats.
This has been discussed in other questions, like here and here. Apparently some manufacturers decided to remove the functionality from some devices (notably Samsung and LG, but maybe others also).
The question: The purpose of this question is to collect information about those devices that do not allow access to these settings. Please post brand, model and os version where you have found that this is the case. Additionally, if someone can find an alternative way of accessing the usage stats, it would be helpful for others if you share it.
Please avoid pointing to deprecated APIs like getRecentTasks, or getRunningAppProcesses (which often returns several packages with priority foreground), or to how to configure the Manifest
file.