mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
power: support automatic profile switching on battery change (#897)
This commit is contained in:
@@ -72,6 +72,17 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
const profileValue = BatteryService.isPluggedIn
|
||||
? SettingsData.acProfileName
|
||||
: SettingsData.batteryProfileName;
|
||||
|
||||
if (profileValue !== "") {
|
||||
const targetProfile = parseInt(profileValue);
|
||||
if (!isNaN(targetProfile) && PowerProfiles.profile !== targetProfile) {
|
||||
PowerProfiles.profile = targetProfile;
|
||||
}
|
||||
}
|
||||
|
||||
previousPluggedState = isPluggedIn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user