Disable APF memory clear on pre-APFv4 devices

Fixes a system crash on HU when connecting to a wifi AP.

Change-Id: I8b71323985b6c5fc8a75f99470c9f86343d57f90
Bug: 78905546
Test: manually on android auto device
This commit is contained in:
Bernie Innocenti
2018-05-09 17:58:50 +09:00
parent f687efc455
commit 8d65db32eb

View File

@@ -429,9 +429,13 @@ public class ApfFilter {
try {
mHardwareAddress = mInterfaceParams.macAddr.toByteArray();
synchronized(this) {
// Clear APF memory.
byte[] zeroes = new byte[mApfCapabilities.maximumApfProgramSize];
mIpClientCallback.installPacketFilter(zeroes);
// Clear the APF memory to reset all counters upon connecting to the first AP
// in an SSID. This is limited to APFv4 devices because this large write triggers
// a crash on some older devices (b/78905546).
if (mApfCapabilities.hasDataAccess()) {
byte[] zeroes = new byte[mApfCapabilities.maximumApfProgramSize];
mIpClientCallback.installPacketFilter(zeroes);
}
// Install basic filters
installNewProgramLocked();