Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a908af9a authored by Eugene Susla's avatar Eugene Susla Committed by Automerger Merge Worker
Browse files

Merge "Re-connect to the CDM service if process gets killed" into sc-dev am: 4355ef95

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14113844

Change-Id: I15da8497afbb36b9a36901f04d8e40ebbb64071f
parents cfdef826 4355ef95
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -157,6 +157,8 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
    private static final long DEVICE_DISAPPEARED_TIMEOUT_MS = 10 * 1000;
    private static final long DEVICE_DISAPPEARED_UNBIND_TIMEOUT_MS = 10 * 60 * 1000;

    private static final long DEVICE_LISTENER_DIED_REBIND_TIMEOUT_MS = 10 * 1000;

    private static final boolean DEBUG = false;
    private static final String LOG_TAG = "CompanionDeviceManagerService";

@@ -1168,6 +1170,14 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
                // Service binding is managed manually based on corresponding device being nearby
                return Long.MAX_VALUE;
            }

            @Override
            public void binderDied() {
                super.binderDied();

                // Re-connect to the service if process gets killed
                mMainHandler.postDelayed(this::connect, DEVICE_LISTENER_DIED_REBIND_TIMEOUT_MS);
            }
        };
    }