ChargingControl: Use ServiceManager.waitForDeclaredService()
It might take a while until health HAL is up, thus let's just wait for it. Change-Id: Ie929a25a2a774aedb4559662e9ad0a47f1b154e6
This commit is contained in:
@@ -142,7 +142,8 @@ public class ChargingControlController extends LineageHealthFeature {
|
||||
|
||||
mContentResolver = mContext.getContentResolver();
|
||||
mChargingControl = IChargingControl.Stub.asInterface(
|
||||
ServiceManager.getService(IChargingControl.DESCRIPTOR + "/default"));
|
||||
ServiceManager.waitForDeclaredService(
|
||||
IChargingControl.DESCRIPTOR + "/default"));
|
||||
|
||||
if (mChargingControl == null) {
|
||||
Log.i(TAG, "Lineage Health HAL not found");
|
||||
|
||||
Reference in New Issue
Block a user