Fix logspam when battery sysfs file not available.
This was a regression caused by a recent change to use String8 instead of char*. We missed the implicit null check here. Bug: 9377604 Change-Id: I7eff138096622c47b5d45678010373dc82138384
This commit is contained in:
committed by
The Android Automerger
parent
5ac124384f
commit
aab3453965
@@ -144,7 +144,7 @@ static jint getBatteryHealth(const char* status)
|
||||
|
||||
static int readFromFile(const String8& path, char* buf, size_t size)
|
||||
{
|
||||
if (!path)
|
||||
if (path.isEmpty())
|
||||
return -1;
|
||||
int fd = open(path.string(), O_RDONLY, 0);
|
||||
if (fd == -1) {
|
||||
|
||||
Reference in New Issue
Block a user