Loading core/java/android/database/CursorToBulkCursorAdaptor.java +1 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,7 @@ public final class CursorToBulkCursorAdaptor extends BulkCursorNative public void close() { maybeUnregisterObserverProxy(); mCursor.deactivate(); mCursor.close(); } public int requery(IContentObserver observer, CursorWindow window) { Loading core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +12 −3 Original line number Diff line number Diff line Loading @@ -31,9 +31,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_UPDATE_CURSOR = 95; private static final int DO_APP_PRIVATE_COMMAND = 100; private static final int DO_TOGGLE_SOFT_INPUT = 105; private static final int DO_FINISH_SESSION = 110; final HandlerCaller mCaller; final InputMethodSession mInputMethodSession; HandlerCaller mCaller; InputMethodSession mInputMethodSession; // NOTE: we should have a cache of these. static class InputMethodEventCallbackWrapper implements InputMethodSession.EventCallback { Loading Loading @@ -111,6 +112,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.toggleSoftInput(msg.arg1, msg.arg2); return; } case DO_FINISH_SESSION: { mInputMethodSession = null; return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -158,4 +163,8 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub public void toggleSoftInput(int showFlags, int hideFlags) { mCaller.executeOrSendMessage(mCaller.obtainMessageII(DO_TOGGLE_SOFT_INPUT, showFlags, hideFlags)); } public void finishSession() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_SESSION)); } } core/java/android/inputmethodservice/IInputMethodWrapper.java +34 −18 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.inputmethod.InputMethodSession; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; Loading @@ -48,9 +49,9 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_SHOW_SOFT_INPUT = 60; private static final int DO_HIDE_SOFT_INPUT = 70; final AbstractInputMethodService mTarget; final WeakReference<AbstractInputMethodService> mTarget; final HandlerCaller mCaller; final InputMethod mInputMethod; final WeakReference<InputMethod> mInputMethod; static class Notifier { boolean notified; Loading Loading @@ -80,21 +81,32 @@ class IInputMethodWrapper extends IInputMethod.Stub public IInputMethodWrapper(AbstractInputMethodService context, InputMethod inputMethod) { mTarget = context; mCaller = new HandlerCaller(context, this); mInputMethod = inputMethod; mTarget = new WeakReference<AbstractInputMethodService>(context); mCaller = new HandlerCaller(context.getApplicationContext(), this); mInputMethod = new WeakReference<InputMethod>(inputMethod); } public InputMethod getInternalInputMethod() { return mInputMethod; return mInputMethod.get(); } public void executeMessage(Message msg) { InputMethod inputMethod = mInputMethod.get(); // Need a valid reference to the inputMethod for everything except a dump. if (inputMethod == null && msg.what != DO_DUMP) { Log.w(TAG, "Input method reference was null, ignoring message: " + msg.what); return; } switch (msg.what) { case DO_DUMP: { AbstractInputMethodService target = mTarget.get(); if (target == null) { return; } HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj; try { mTarget.dump((FileDescriptor)args.arg1, target.dump((FileDescriptor)args.arg1, (PrintWriter)args.arg2, (String[])args.arg3); } catch (RuntimeException e) { ((PrintWriter)args.arg2).println("Exception: " + e); Loading @@ -106,22 +118,22 @@ class IInputMethodWrapper extends IInputMethod.Stub } case DO_ATTACH_TOKEN: { mInputMethod.attachToken((IBinder)msg.obj); inputMethod.attachToken((IBinder)msg.obj); return; } case DO_SET_INPUT_CONTEXT: { mInputMethod.bindInput((InputBinding)msg.obj); inputMethod.bindInput((InputBinding)msg.obj); return; } case DO_UNSET_INPUT_CONTEXT: mInputMethod.unbindInput(); inputMethod.unbindInput(); return; case DO_START_INPUT: { HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(inputContext) : null; mInputMethod.startInput(ic, (EditorInfo)args.arg2); inputMethod.startInput(ic, (EditorInfo)args.arg2); return; } case DO_RESTART_INPUT: { Loading @@ -129,33 +141,37 @@ class IInputMethodWrapper extends IInputMethod.Stub IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(inputContext) : null; mInputMethod.restartInput(ic, (EditorInfo)args.arg2); inputMethod.restartInput(ic, (EditorInfo)args.arg2); return; } case DO_CREATE_SESSION: { mInputMethod.createSession(new InputMethodSessionCallbackWrapper( inputMethod.createSession(new InputMethodSessionCallbackWrapper( mCaller.mContext, (IInputMethodCallback)msg.obj)); return; } case DO_SET_SESSION_ENABLED: mInputMethod.setSessionEnabled((InputMethodSession)msg.obj, inputMethod.setSessionEnabled((InputMethodSession)msg.obj, msg.arg1 != 0); return; case DO_REVOKE_SESSION: mInputMethod.revokeSession((InputMethodSession)msg.obj); inputMethod.revokeSession((InputMethodSession)msg.obj); return; case DO_SHOW_SOFT_INPUT: mInputMethod.showSoftInput(msg.arg1, (ResultReceiver)msg.obj); inputMethod.showSoftInput(msg.arg1, (ResultReceiver)msg.obj); return; case DO_HIDE_SOFT_INPUT: mInputMethod.hideSoftInput(msg.arg1, (ResultReceiver)msg.obj); inputMethod.hideSoftInput(msg.arg1, (ResultReceiver)msg.obj); return; } Log.w(TAG, "Unhandled message code: " + msg.what); } @Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { if (mTarget.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) AbstractInputMethodService target = mTarget.get(); if (target == null) { return; } if (target.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { fout.println("Permission Denial: can't dump InputMethodManager from from pid=" Loading core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading core/java/com/android/internal/view/IInputMethodSession.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -48,4 +48,6 @@ oneway interface IInputMethodSession { void appPrivateCommand(String action, in Bundle data); void toggleSoftInput(int showFlags, int hideFlags); void finishSession(); } Loading
core/java/android/database/CursorToBulkCursorAdaptor.java +1 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,7 @@ public final class CursorToBulkCursorAdaptor extends BulkCursorNative public void close() { maybeUnregisterObserverProxy(); mCursor.deactivate(); mCursor.close(); } public int requery(IContentObserver observer, CursorWindow window) { Loading
core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +12 −3 Original line number Diff line number Diff line Loading @@ -31,9 +31,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_UPDATE_CURSOR = 95; private static final int DO_APP_PRIVATE_COMMAND = 100; private static final int DO_TOGGLE_SOFT_INPUT = 105; private static final int DO_FINISH_SESSION = 110; final HandlerCaller mCaller; final InputMethodSession mInputMethodSession; HandlerCaller mCaller; InputMethodSession mInputMethodSession; // NOTE: we should have a cache of these. static class InputMethodEventCallbackWrapper implements InputMethodSession.EventCallback { Loading Loading @@ -111,6 +112,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.toggleSoftInput(msg.arg1, msg.arg2); return; } case DO_FINISH_SESSION: { mInputMethodSession = null; return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -158,4 +163,8 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub public void toggleSoftInput(int showFlags, int hideFlags) { mCaller.executeOrSendMessage(mCaller.obtainMessageII(DO_TOGGLE_SOFT_INPUT, showFlags, hideFlags)); } public void finishSession() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_SESSION)); } }
core/java/android/inputmethodservice/IInputMethodWrapper.java +34 −18 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.inputmethod.InputMethodSession; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; Loading @@ -48,9 +49,9 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_SHOW_SOFT_INPUT = 60; private static final int DO_HIDE_SOFT_INPUT = 70; final AbstractInputMethodService mTarget; final WeakReference<AbstractInputMethodService> mTarget; final HandlerCaller mCaller; final InputMethod mInputMethod; final WeakReference<InputMethod> mInputMethod; static class Notifier { boolean notified; Loading Loading @@ -80,21 +81,32 @@ class IInputMethodWrapper extends IInputMethod.Stub public IInputMethodWrapper(AbstractInputMethodService context, InputMethod inputMethod) { mTarget = context; mCaller = new HandlerCaller(context, this); mInputMethod = inputMethod; mTarget = new WeakReference<AbstractInputMethodService>(context); mCaller = new HandlerCaller(context.getApplicationContext(), this); mInputMethod = new WeakReference<InputMethod>(inputMethod); } public InputMethod getInternalInputMethod() { return mInputMethod; return mInputMethod.get(); } public void executeMessage(Message msg) { InputMethod inputMethod = mInputMethod.get(); // Need a valid reference to the inputMethod for everything except a dump. if (inputMethod == null && msg.what != DO_DUMP) { Log.w(TAG, "Input method reference was null, ignoring message: " + msg.what); return; } switch (msg.what) { case DO_DUMP: { AbstractInputMethodService target = mTarget.get(); if (target == null) { return; } HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj; try { mTarget.dump((FileDescriptor)args.arg1, target.dump((FileDescriptor)args.arg1, (PrintWriter)args.arg2, (String[])args.arg3); } catch (RuntimeException e) { ((PrintWriter)args.arg2).println("Exception: " + e); Loading @@ -106,22 +118,22 @@ class IInputMethodWrapper extends IInputMethod.Stub } case DO_ATTACH_TOKEN: { mInputMethod.attachToken((IBinder)msg.obj); inputMethod.attachToken((IBinder)msg.obj); return; } case DO_SET_INPUT_CONTEXT: { mInputMethod.bindInput((InputBinding)msg.obj); inputMethod.bindInput((InputBinding)msg.obj); return; } case DO_UNSET_INPUT_CONTEXT: mInputMethod.unbindInput(); inputMethod.unbindInput(); return; case DO_START_INPUT: { HandlerCaller.SomeArgs args = (HandlerCaller.SomeArgs)msg.obj; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(inputContext) : null; mInputMethod.startInput(ic, (EditorInfo)args.arg2); inputMethod.startInput(ic, (EditorInfo)args.arg2); return; } case DO_RESTART_INPUT: { Loading @@ -129,33 +141,37 @@ class IInputMethodWrapper extends IInputMethod.Stub IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(inputContext) : null; mInputMethod.restartInput(ic, (EditorInfo)args.arg2); inputMethod.restartInput(ic, (EditorInfo)args.arg2); return; } case DO_CREATE_SESSION: { mInputMethod.createSession(new InputMethodSessionCallbackWrapper( inputMethod.createSession(new InputMethodSessionCallbackWrapper( mCaller.mContext, (IInputMethodCallback)msg.obj)); return; } case DO_SET_SESSION_ENABLED: mInputMethod.setSessionEnabled((InputMethodSession)msg.obj, inputMethod.setSessionEnabled((InputMethodSession)msg.obj, msg.arg1 != 0); return; case DO_REVOKE_SESSION: mInputMethod.revokeSession((InputMethodSession)msg.obj); inputMethod.revokeSession((InputMethodSession)msg.obj); return; case DO_SHOW_SOFT_INPUT: mInputMethod.showSoftInput(msg.arg1, (ResultReceiver)msg.obj); inputMethod.showSoftInput(msg.arg1, (ResultReceiver)msg.obj); return; case DO_HIDE_SOFT_INPUT: mInputMethod.hideSoftInput(msg.arg1, (ResultReceiver)msg.obj); inputMethod.hideSoftInput(msg.arg1, (ResultReceiver)msg.obj); return; } Log.w(TAG, "Unhandled message code: " + msg.what); } @Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { if (mTarget.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) AbstractInputMethodService target = mTarget.get(); if (target == null) { return; } if (target.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { fout.println("Permission Denial: can't dump InputMethodManager from from pid=" Loading
core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading
core/java/com/android/internal/view/IInputMethodSession.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -48,4 +48,6 @@ oneway interface IInputMethodSession { void appPrivateCommand(String action, in Bundle data); void toggleSoftInput(int showFlags, int hideFlags); void finishSession(); }