Check for initialization of mUpdateEngine

Bug: 207768409
Test: th

Change-Id: Idc702658ab542566d775b296f1e82b63b0c1c2a4
This commit is contained in:
Kelvin Zhang
2021-12-01 10:50:50 -08:00
parent f7a480d824
commit 8af2abfcc7

View File

@@ -238,7 +238,7 @@ public class UpdateEngine {
public static final int DISABLED = 9;
}
private IUpdateEngine mUpdateEngine;
private final IUpdateEngine mUpdateEngine;
private IUpdateEngineCallback mUpdateEngineCallback = null;
private final Object mUpdateEngineCallbackLock = new Object();
@@ -248,6 +248,9 @@ public class UpdateEngine {
public UpdateEngine() {
mUpdateEngine = IUpdateEngine.Stub.asInterface(
ServiceManager.getService(UPDATE_ENGINE_SERVICE));
if (mUpdateEngine == null) {
throw new IllegalStateException("Failed to find update_engine");
}
}
/**