NPE fix for SyncStorageEngine read authority
Add a null check after an authority is read from disk. Bug: 26513719 Change-Id: I18f01828141110e776cc96f3b3be3d80125e70c1
This commit is contained in:
@@ -41,6 +41,7 @@ import android.util.Log;
|
|||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
|
import android.util.EventLog;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
@@ -1746,9 +1747,14 @@ public class SyncStorageEngine extends Handler {
|
|||||||
if ("authority".equals(tagName)) {
|
if ("authority".equals(tagName)) {
|
||||||
authority = parseAuthority(parser, version);
|
authority = parseAuthority(parser, version);
|
||||||
periodicSync = null;
|
periodicSync = null;
|
||||||
|
if (authority != null) {
|
||||||
if (authority.ident > highestAuthorityId) {
|
if (authority.ident > highestAuthorityId) {
|
||||||
highestAuthorityId = authority.ident;
|
highestAuthorityId = authority.ident;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
EventLog.writeEvent(0x534e4554, "26513719", -1,
|
||||||
|
"Malformed authority");
|
||||||
|
}
|
||||||
} else if (XML_TAG_LISTEN_FOR_TICKLES.equals(tagName)) {
|
} else if (XML_TAG_LISTEN_FOR_TICKLES.equals(tagName)) {
|
||||||
parseListenForTickles(parser);
|
parseListenForTickles(parser);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user