Partial Fix for 2416967: Fix potential memory leak in PasswordUnlockScreen.

PasswordUnlockScreen was previously registering for multiple callbacks which *sometimes*
caused a memory leak because a reference stuck around in the callback list.  I wasn't able to
track down the cause, but it looks like an interaction between switching between various lockscreen
modes and ordering of CONFIGURATION_CHANGED events.

I found one instance where the callback was being registered twice (fixed).  However, I'm
still able to reproduce the bug but far less frequently.

As a workaround, I've added code to prevent adding additional callbacks and added logging to
detect when a callback is already registered.

Also fixed an instance where we'd recreate the password unlock screen in LockPatternKeyguardView.updateScreen()
so it should be quite a bit faster switching orientations now.

Renamed UnlockScreen.java to PatternUnlockScreen.java for consistency.
4 files changed
tree: b21a452133340ca601880c68bded3a8fa71b6461
  1. mid/
  2. phone/
  3. PolicyConfig.mk