Skip to content

Commit

Permalink
ChargingControl: Use ServiceManager.waitForDeclaredService()
Browse files Browse the repository at this point in the history
It might take a while until health HAL is up, thus let's just wait for
it.

Change-Id: Ie929a25a2a774aedb4559662e9ad0a47f1b154e6
Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
  • Loading branch information
luk1337 authored and bheatleyyy committed Sep 28, 2023
1 parent 7fbaf08 commit 89f6509
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -142,7 +142,8 @@ public ChargingControlController(Context context, Handler handler) {

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");
Expand Down

0 comments on commit 89f6509

Please sign in to comment.