Merge "Check for IControllOffload.getServer() returning null"
This commit is contained in:
@@ -109,6 +109,10 @@ public class OffloadHardwareInterface {
|
|||||||
mLog.e("tethering offload control not supported: " + e);
|
mLog.e("tethering offload control not supported: " + e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (mOffloadControl == null) {
|
||||||
|
mLog.e("tethering IOffloadControl.getService() returned null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String logmsg = String.format("initOffloadControl(%s)",
|
final String logmsg = String.format("initOffloadControl(%s)",
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ static jboolean android_server_connectivity_tethering_OffloadHardwareInterface_c
|
|||||||
hidl_handle h1(handleFromFileDescriptor(std::move(fd1))),
|
hidl_handle h1(handleFromFileDescriptor(std::move(fd1))),
|
||||||
h2(handleFromFileDescriptor(std::move(fd2)));
|
h2(handleFromFileDescriptor(std::move(fd2)));
|
||||||
|
|
||||||
bool rval;
|
bool rval(false);
|
||||||
hidl_string msg;
|
hidl_string msg;
|
||||||
const auto status = configInterface->setHandles(h1, h2,
|
const auto status = configInterface->setHandles(h1, h2,
|
||||||
[&rval, &msg](bool success, const hidl_string& errMsg) {
|
[&rval, &msg](bool success, const hidl_string& errMsg) {
|
||||||
@@ -123,6 +123,8 @@ static jboolean android_server_connectivity_tethering_OffloadHardwareInterface_c
|
|||||||
if (!status.isOk() || !rval) {
|
if (!status.isOk() || !rval) {
|
||||||
ALOGE("IOffloadConfig::setHandles() error: '%s' / '%s'",
|
ALOGE("IOffloadConfig::setHandles() error: '%s' / '%s'",
|
||||||
status.description().c_str(), msg.c_str());
|
status.description().c_str(), msg.c_str());
|
||||||
|
// If status is somehow not ok, make sure rval captures this too.
|
||||||
|
rval = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
|
|||||||
Reference in New Issue
Block a user