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

Commit ee37b7d6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix CDM logcat spam when device is nearby" into sc-dev am: 562ed3ad

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

Change-Id: Id90f9a8a6234b254c8f7cb0ca81bd6596080e5ec
parents d6579eb2 562ed3ad
Loading
Loading
Loading
Loading
+5 −15
Original line number Diff line number Diff line
@@ -1205,8 +1205,6 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
        }

        public void schedule() {
            Slog.d(LOG_TAG,
                    "TriggerDeviceDisappearedRunnable.schedule(address = " + mAddress + ")");
            mMainHandler.removeCallbacks(this);
            mMainHandler.postDelayed(this, this, DEVICE_DISAPPEARED_TIMEOUT_MS);
        }
@@ -1244,8 +1242,6 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
    }

    private void onDeviceNearby(String address) {
        Slog.i(LOG_TAG, "onDeviceNearby(address = " + address + ")");

        Date timestamp = new Date();
        Date oldTimestamp = mDevicesLastNearby.put(address, timestamp);

@@ -1259,13 +1255,11 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
        boolean justAppeared = oldTimestamp == null
                || timestamp.getTime() - oldTimestamp.getTime() >= DEVICE_DISAPPEARED_TIMEOUT_MS;
        if (justAppeared) {
            Slog.i(LOG_TAG, "onDeviceNearby(justAppeared, address = " + address + ")");
            for (Association association : getAllAssociations(address)) {
                if (association.isNotifyOnDeviceNearby()) {
                    if (DEBUG) {
                        Slog.i(LOG_TAG, "Device " + address
                                + " managed by " + association.getPackageName()
                                + " is nearby on " + timestamp);
                    }
                    Slog.i(LOG_TAG,
                            "Sending onDeviceAppeared to " + association.getPackageName() + ")");
                    getDeviceListenerServiceConnector(association).run(
                            service -> service.onDeviceAppeared(association.getDeviceMacAddress()));
                }
@@ -1279,12 +1273,8 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
        boolean hasDeviceListeners = false;
        for (Association association : getAllAssociations(address)) {
            if (association.isNotifyOnDeviceNearby()) {
                if (DEBUG) {
                    Slog.i(LOG_TAG, "Device " + address
                            + " managed by " + association.getPackageName()
                            + " disappeared; last seen on " + mDevicesLastNearby.get(address));
                }

                Slog.i(LOG_TAG,
                        "Sending onDeviceDisappeared to " + association.getPackageName() + ")");
                getDeviceListenerServiceConnector(association).run(
                        service -> service.onDeviceDisappeared(address));
                hasDeviceListeners = true;