mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-01 15:14:34 +02:00
fix(GmsCore support): Do not show battery optimization error on Android Automotive devices (Google built-in)
This commit is contained in:
parent
b105fc1f62
commit
41aaeafbe9
@ -120,7 +120,11 @@ public class GmsCoreSupport {
|
||||
}
|
||||
|
||||
// Check if GmsCore is whitelisted from battery optimizations.
|
||||
if (batteryOptimizationsEnabled(mActivity)) {
|
||||
if (isAndroidAutomotive(mActivity)) {
|
||||
// Ignore Android Automotive devices (Google built-in),
|
||||
// as there is no way to disable battery optimizations.
|
||||
Logger.printDebug(() -> "Device is Android Automotive");
|
||||
} else if (batteryOptimizationsEnabled(mActivity)) {
|
||||
Logger.printInfo(() -> "GmsCore is not whitelisted from battery optimizations");
|
||||
showBatteryOptimizationDialog(mActivity,
|
||||
"gms_core_dialog_not_whitelisted_using_battery_optimizations_message",
|
||||
@ -220,6 +224,10 @@ public class GmsCoreSupport {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
private static boolean isAndroidAutomotive(Context context) {
|
||||
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
|
||||
}
|
||||
|
||||
private static String getGmsCoreDownload() {
|
||||
final String vendorGroupId = getGmsCoreVendorGroupId();
|
||||
return switch (vendorGroupId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user