From 93c8c0a09a03c40b14da27597e032e490a829d26 Mon Sep 17 00:00:00 2001 From: Abodunrinwa Toki Date: Tue, 19 Apr 2016 17:18:51 +0100 Subject: [PATCH] InputSettings: Fix incorrect keyboard list on rotation. In this situation onLoadFinished callback is triggered before the loader ids list is updated. Updated the loader ids list before triggering the loader. Bug: 28182232 Change-Id: I1e4035f4dcff33e6b9a42d448303e962bd87c14b --- .../android/settings/inputmethod/PhysicalKeyboardFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java index cf8db7a8243..70d5c7b63b0 100644 --- a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java +++ b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java @@ -206,9 +206,9 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment clearLoader(); mLastHardKeyboards.clear(); mLastHardKeyboards.addAll(newHardKeyboards); + mLoaderIDs.add(mNextLoaderId); getLoaderManager().initLoader(mNextLoaderId, null, new Callbacks(getContext(), this, mLastHardKeyboards)); - mLoaderIDs.add(mNextLoaderId); ++mNextLoaderId; } }