Do not moisture detection when uart is enabled.
am: 9b4f79057d
Change-Id: I898c18f0861ca61847aa6132c5a13cebc71a2a06
This commit is contained in:
committed by
android-build-merger
commit
80a5100d8a
@@ -17,6 +17,7 @@
|
||||
#define LOG_TAG "android.hardware.usb@1.2-service.sunfish"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
#include <pthread.h>
|
||||
@@ -35,6 +36,8 @@
|
||||
|
||||
#include "Usb.h"
|
||||
|
||||
using android::base::GetProperty;
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace usb {
|
||||
@@ -129,7 +132,10 @@ Status queryMoistureDetectionStatus(hidl_vec<PortStatus> *currentPortStatus_1_2)
|
||||
|
||||
Return<void> Usb::enableContaminantPresenceDetection(const hidl_string & /*portName*/,
|
||||
bool enable) {
|
||||
writeFile(kEnabledPath, enable ? "1" : "0");
|
||||
std::string status = GetProperty("init.svc.console", "");
|
||||
if (status != "running")
|
||||
writeFile(kEnabledPath, enable ? "1" : "0");
|
||||
|
||||
hidl_vec<PortStatus> currentPortStatus_1_2;
|
||||
|
||||
queryVersionHelper(this, ¤tPortStatus_1_2);
|
||||
|
||||
Reference in New Issue
Block a user