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

Commit 995757e3 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "Remove dead TrustListeners"

parents aa7707dd a4ba56ba
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
@@ -326,8 +327,12 @@ public class TrustManagerService extends SystemService {
        for (int i = 0; i < mTrustListeners.size(); i++) {
            try {
                mTrustListeners.get(i).onTrustChanged(enabled, userId);
            } catch (DeadObjectException e) {
                if (DEBUG) Slog.d(TAG, "Removing dead TrustListener.");
                mTrustListeners.remove(i);
                i--;
            } catch (RemoteException e) {
                Slog.e(TAG, "Exception while notifying TrustListener. Removing listener.", e);
                Slog.e(TAG, "Exception while notifying TrustListener.", e);
            }
        }
    }