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

Commit a4ba56ba authored by Adrian Roos's avatar Adrian Roos
Browse files

Remove dead TrustListeners

Follow-up to I972a9134aed18fc160c919eac93e9d488b5691f1
Bug: 15092272

Change-Id: I46d718edcbad0e46416263dd21507fa8abeb8d7b
parent 47c6514e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -39,6 +39,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;
@@ -322,8 +323,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);
            }
        }
    }