OSDN Git Service

Fix memory leak of page "Languages & input"
authorJin Dong <jin.x.dong@sony.com>
Fri, 22 Dec 2017 10:25:03 +0000 (18:25 +0800)
committerTakamasa Kuramitsu <takamasa.kuramitsu@sony.com>
Tue, 30 Jan 2018 10:54:00 +0000 (10:54 +0000)
commitd39c52f99e26b9d5de18f1115862a93241173549
tree7cbb10e3f08d0e9dfa4ac92de3b5c8932ef4a03a
parent7a65c7f27938b98de95f77e285884551080fb7af
Fix memory leak of page "Languages & input"

When enter/exit from "Languages & input" screen repeatedly, memory
leak happens since InputDeviceListener is not unregistered.

Listener registration is called in onPause() when exiting from the
screen, but new activity is created when enter the screen and the
listener registered by previous activity is not unregistered in
onResume().

Bug: 72675680
Test: Manual - Repeat enter and exit "Language & input" page for
several times and check if the count of activity doesn't increase.
Change-Id: I8e0be0ab4b1d13d53c3868b10f409d1e06387c2f
src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceController.java