simplify loading pinned clips

we don't need to read a file any more
also makes sure pinned clips are initially loaded before fetching the primary clip
This commit is contained in:
Helium314 2024-04-20 23:24:14 +02:00
parent a58a7cc932
commit 290944635f
2 changed files with 10 additions and 23 deletions

View file

@ -199,9 +199,8 @@ public class LatinIME extends InputMethodService implements
private static final int MSG_WAIT_FOR_DICTIONARY_LOAD = 8;
private static final int MSG_DEALLOCATE_MEMORY = 9;
private static final int MSG_SWITCH_LANGUAGE_AUTOMATICALLY = 10;
private static final int MSG_UPDATE_CLIPBOARD_PINNED_CLIPS = 11;
// Update this when adding new messages
private static final int MSG_LAST = MSG_UPDATE_CLIPBOARD_PINNED_CLIPS;
private static final int MSG_LAST = MSG_SWITCH_LANGUAGE_AUTOMATICALLY;
private static final int ARG1_NOT_GESTURE_INPUT = 0;
private static final int ARG1_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT = 1;
@ -292,11 +291,6 @@ public class LatinIME extends InputMethodService implements
case MSG_SWITCH_LANGUAGE_AUTOMATICALLY:
latinIme.switchToSubtype((InputMethodSubtype) msg.obj);
break;
case MSG_UPDATE_CLIPBOARD_PINNED_CLIPS:
@SuppressWarnings("unchecked")
List<ClipboardHistoryEntry> entries = (List<ClipboardHistoryEntry>) msg.obj;
latinIme.mClipboardHistoryManager.onPinnedClipsAvailable(entries);
break;
}
}
@ -411,10 +405,6 @@ public class LatinIME extends InputMethodService implements
obtainMessage(MSG_SWITCH_LANGUAGE_AUTOMATICALLY, subtype).sendToTarget();
}
public void postUpdateClipboardPinnedClips(final List<ClipboardHistoryEntry> clips) {
obtainMessage(MSG_UPDATE_CLIPBOARD_PINNED_CLIPS, clips).sendToTarget();
}
// Working variables for the following methods.
private boolean mIsOrientationChanging;
private boolean mPendingSuccessiveImsCallback;