Unregister receiver when destroying TrustAgentWrapper.
Make sure to unregister the receiver when TrustAgentWrapper gets detroyed. This will prevent over registering for the receiver and a potential crash if too many recievers are created. The unregistering and registering of this receiver now take place in the same location as the other receiver in the class. Fixes: 221506550 Test: Trivial Change-Id: Icfd12949d9edb2fa6fbb052db35c16f950328c9a
This commit is contained in:
@@ -671,6 +671,7 @@ public class TrustAgentWrapper {
|
||||
mContext.unbindService(mConnection);
|
||||
mBound = false;
|
||||
mContext.unregisterReceiver(mBroadcastReceiver);
|
||||
mContext.unregisterReceiver(mTrustableDowngradeReceiver);
|
||||
mTrustAgentService = null;
|
||||
mSetTrustAgentFeaturesToken = null;
|
||||
mHandler.sendEmptyMessage(MSG_REVOKE_TRUST);
|
||||
|
||||
Reference in New Issue
Block a user