forked from zhujiong/android_device_samsung_aries-common
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AriesParts: add controls for fast USB charging
Change-Id: I0e033199775461d685fcb02877f0fdf707f1b4fe
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
AriesParts/src/com/cyanogenmod/settings/device/ForceFastCharge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.cyanogenmod.settings.device; | ||
|
||
import android.preference.Preference; | ||
import android.preference.Preference.OnPreferenceChangeListener; | ||
|
||
public class ForceFastCharge implements OnPreferenceChangeListener { | ||
|
||
private static final String FILE = "/sys/kernel/fast_charge/force_fast_charge"; | ||
|
||
public static boolean isSupported() { | ||
return Utils.fileExists(FILE); | ||
} | ||
|
||
@Override | ||
public boolean onPreferenceChange(Preference preference, Object newValue) { | ||
Utils.writeValue(FILE, ((Boolean) newValue) ? "1" : "0"); | ||
return true; | ||
} | ||
|
||
} |