Skip to content

Commit 8ec45de

Browse files
committed
batteryservice: Remove remnants of CAF's HVDCP changes
Commit ce521ee removed the usage of isHvdcpPresent(), but did not remove the function itself. Remove isHvdcpPresent() as clean-up. This essentially reverts the rest of the following commits: 64deb44 batteryservice: Avoid exception if device doesn't support HVDCP 4df4f53 batteryservice: add support for charger led blinking Change-Id: Ie39c11ee9811f6af84a55ed85b72123cc449c735
1 parent d84227c commit 8ec45de

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

services/core/java/com/android/server/BatteryService.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@
5858
import java.io.File;
5959
import java.io.FileDescriptor;
6060
import java.io.FileOutputStream;
61-
import java.io.FileReader;
62-
import java.io.BufferedInputStream;
63-
import java.io.BufferedReader;
64-
import java.io.FileInputStream;
6561
import java.io.IOException;
6662
import java.io.PrintWriter;
6763

@@ -1056,33 +1052,6 @@ public Led(Context context, LightsManager lights) {
10561052
org.cyanogenmod.platform.internal.R.bool.config_useSegmentedBatteryLed);
10571053
}
10581054

1059-
private boolean isHvdcpPresent() {
1060-
File mChargerTypeFile = new File("/sys/class/power_supply/usb/type");
1061-
FileReader fileReader;
1062-
BufferedReader br;
1063-
String type;
1064-
boolean ret = false;
1065-
1066-
if (!mChargerTypeFile.exists()) {
1067-
// Device does not support HVDCP
1068-
return ret;
1069-
}
1070-
1071-
try {
1072-
fileReader = new FileReader(mChargerTypeFile);
1073-
br = new BufferedReader(fileReader);
1074-
type = br.readLine();
1075-
if (type.regionMatches(true, 0, "USB_HVDCP", 0, 9))
1076-
ret = true;
1077-
br.close();
1078-
fileReader.close();
1079-
} catch (IOException e) {
1080-
Slog.e(TAG, "Failure in reading charger type", e);
1081-
}
1082-
1083-
return ret;
1084-
}
1085-
10861055
/**
10871056
* Synchronize on BatteryService.
10881057
*/

0 commit comments

Comments
 (0)