Loading api/current.txt +156 −152 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/app/Activity.java +18 −3 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ public class Activity extends ContextThemeWrapper HashMap<String, Object> children; ArrayList<Fragment> fragments; ArrayMap<String, LoaderManagerImpl> loaders; VoiceInteractor voiceInteractor; } /* package */ NonConfigurationInstances mLastNonConfigurationInstances; Loading Loading @@ -920,6 +921,9 @@ public class Activity extends ContextThemeWrapper } mFragments.dispatchCreate(); getApplication().dispatchActivityCreated(this, savedInstanceState); if (mVoiceInteractor != null) { mVoiceInteractor.attachActivity(this); } mCalled = true; } Loading Loading @@ -1830,7 +1834,8 @@ public class Activity extends ContextThemeWrapper } } } if (activity == null && children == null && fragments == null && !retainLoaders) { if (activity == null && children == null && fragments == null && !retainLoaders && mVoiceInteractor == null) { return null; } Loading @@ -1839,6 +1844,7 @@ public class Activity extends ContextThemeWrapper nci.children = children; nci.fragments = fragments; nci.loaders = mAllLoaderManagers; nci.voiceInteractor = mVoiceInteractor; return nci; } Loading Loading @@ -5632,8 +5638,14 @@ public class Activity extends ContextThemeWrapper mParent = parent; mEmbeddedID = id; mLastNonConfigurationInstances = lastNonConfigurationInstances; mVoiceInteractor = voiceInteractor != null ? new VoiceInteractor(this, this, voiceInteractor, Looper.myLooper()) : null; if (voiceInteractor != null) { if (lastNonConfigurationInstances != null) { mVoiceInteractor = lastNonConfigurationInstances.voiceInteractor; } else { mVoiceInteractor = new VoiceInteractor(voiceInteractor, this, this, Looper.myLooper()); } } mWindow.setWindowManager( (WindowManager)context.getSystemService(Context.WINDOW_SERVICE), Loading Loading @@ -5842,6 +5854,9 @@ public class Activity extends ContextThemeWrapper if (mLoaderManager != null) { mLoaderManager.doDestroy(); } if (mVoiceInteractor != null) { mVoiceInteractor.detachActivity(); } } /** Loading core/java/android/app/VoiceInteractor.java +56 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import com.android.internal.app.IVoiceInteractorRequest; import com.android.internal.os.HandlerCaller; import com.android.internal.os.SomeArgs; import java.util.WeakHashMap; import java.util.ArrayList; /** * Interface for an {@link Activity} to interact with the user through voice. Loading @@ -39,9 +39,11 @@ public class VoiceInteractor { static final String TAG = "VoiceInteractor"; static final boolean DEBUG = true; final Context mContext; final Activity mActivity; final IVoiceInteractor mInteractor; Context mContext; Activity mActivity; final HandlerCaller mHandlerCaller; final HandlerCaller.Callback mHandlerCallerCallback = new HandlerCaller.Callback() { @Override Loading Loading @@ -140,6 +142,12 @@ public class VoiceInteractor { public void onCancel() { } public void onAttached(Activity activity) { } public void onDetached() { } void clear() { mRequestInterface = null; mContext = null; Loading Loading @@ -220,11 +228,11 @@ public class VoiceInteractor { } } VoiceInteractor(Context context, Activity activity, IVoiceInteractor interactor, VoiceInteractor(IVoiceInteractor interactor, Context context, Activity activity, Looper looper) { mInteractor = interactor; mContext = context; mActivity = activity; mInteractor = interactor; mHandlerCaller = new HandlerCaller(context, looper, mHandlerCallerCallback, true); } Loading @@ -238,6 +246,49 @@ public class VoiceInteractor { } } private ArrayList<Request> makeRequestList() { final int N = mActiveRequests.size(); if (N < 1) { return null; } ArrayList<Request> list = new ArrayList<Request>(N); for (int i=0; i<N; i++) { list.add(mActiveRequests.valueAt(i)); } return list; } void attachActivity(Activity activity) { if (mActivity == activity) { return; } mContext = activity; mActivity = activity; ArrayList<Request> reqs = makeRequestList(); if (reqs != null) { for (int i=0; i<reqs.size(); i++) { Request req = reqs.get(i); req.mContext = activity; req.mActivity = activity; req.onAttached(activity); } } } void detachActivity() { ArrayList<Request> reqs = makeRequestList(); if (reqs != null) { for (int i=0; i<reqs.size(); i++) { Request req = reqs.get(i); req.onDetached(); req.mActivity = null; req.mContext = null; } } mContext = null; mActivity = null; } public boolean submitRequest(Request request) { try { IVoiceInteractorRequest ireq = request.submit(mInteractor, Loading core/java/android/inputmethodservice/IInputMethodWrapper.java +4 −3 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_CHANGE_INPUTMETHOD_SUBTYPE = 80; final WeakReference<AbstractInputMethodService> mTarget; final Context mContext; final HandlerCaller mCaller; final WeakReference<InputMethod> mInputMethod; final int mTargetSdkVersion; Loading Loading @@ -111,8 +112,8 @@ class IInputMethodWrapper extends IInputMethod.Stub public IInputMethodWrapper(AbstractInputMethodService context, InputMethod inputMethod) { mTarget = new WeakReference<AbstractInputMethodService>(context); mCaller = new HandlerCaller(context.getApplicationContext(), null, this, true /*asyncHandler*/); mContext = context.getApplicationContext(); mCaller = new HandlerCaller(mContext, null, this, true /*asyncHandler*/); mInputMethod = new WeakReference<InputMethod>(inputMethod); mTargetSdkVersion = context.getApplicationInfo().targetSdkVersion; } Loading Loading @@ -186,7 +187,7 @@ class IInputMethodWrapper extends IInputMethod.Stub case DO_CREATE_SESSION: { SomeArgs args = (SomeArgs)msg.obj; inputMethod.createSession(new InputMethodSessionCallbackWrapper( mCaller.mContext, (InputChannel)args.arg1, mContext, (InputChannel)args.arg1, (IInputSessionCallback)args.arg2)); args.recycle(); return; Loading core/java/android/inputmethodservice/SoftInputWindow.java +4 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,10 @@ public class SoftInputWindow extends Dialog { getWindow().setAttributes(lp); } public int getGravity() { return getWindow().getAttributes().gravity; } private void updateWidthHeight(WindowManager.LayoutParams lp) { if (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM) { lp.width = WindowManager.LayoutParams.MATCH_PARENT; Loading Loading
core/java/android/app/Activity.java +18 −3 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ public class Activity extends ContextThemeWrapper HashMap<String, Object> children; ArrayList<Fragment> fragments; ArrayMap<String, LoaderManagerImpl> loaders; VoiceInteractor voiceInteractor; } /* package */ NonConfigurationInstances mLastNonConfigurationInstances; Loading Loading @@ -920,6 +921,9 @@ public class Activity extends ContextThemeWrapper } mFragments.dispatchCreate(); getApplication().dispatchActivityCreated(this, savedInstanceState); if (mVoiceInteractor != null) { mVoiceInteractor.attachActivity(this); } mCalled = true; } Loading Loading @@ -1830,7 +1834,8 @@ public class Activity extends ContextThemeWrapper } } } if (activity == null && children == null && fragments == null && !retainLoaders) { if (activity == null && children == null && fragments == null && !retainLoaders && mVoiceInteractor == null) { return null; } Loading @@ -1839,6 +1844,7 @@ public class Activity extends ContextThemeWrapper nci.children = children; nci.fragments = fragments; nci.loaders = mAllLoaderManagers; nci.voiceInteractor = mVoiceInteractor; return nci; } Loading Loading @@ -5632,8 +5638,14 @@ public class Activity extends ContextThemeWrapper mParent = parent; mEmbeddedID = id; mLastNonConfigurationInstances = lastNonConfigurationInstances; mVoiceInteractor = voiceInteractor != null ? new VoiceInteractor(this, this, voiceInteractor, Looper.myLooper()) : null; if (voiceInteractor != null) { if (lastNonConfigurationInstances != null) { mVoiceInteractor = lastNonConfigurationInstances.voiceInteractor; } else { mVoiceInteractor = new VoiceInteractor(voiceInteractor, this, this, Looper.myLooper()); } } mWindow.setWindowManager( (WindowManager)context.getSystemService(Context.WINDOW_SERVICE), Loading Loading @@ -5842,6 +5854,9 @@ public class Activity extends ContextThemeWrapper if (mLoaderManager != null) { mLoaderManager.doDestroy(); } if (mVoiceInteractor != null) { mVoiceInteractor.detachActivity(); } } /** Loading
core/java/android/app/VoiceInteractor.java +56 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import com.android.internal.app.IVoiceInteractorRequest; import com.android.internal.os.HandlerCaller; import com.android.internal.os.SomeArgs; import java.util.WeakHashMap; import java.util.ArrayList; /** * Interface for an {@link Activity} to interact with the user through voice. Loading @@ -39,9 +39,11 @@ public class VoiceInteractor { static final String TAG = "VoiceInteractor"; static final boolean DEBUG = true; final Context mContext; final Activity mActivity; final IVoiceInteractor mInteractor; Context mContext; Activity mActivity; final HandlerCaller mHandlerCaller; final HandlerCaller.Callback mHandlerCallerCallback = new HandlerCaller.Callback() { @Override Loading Loading @@ -140,6 +142,12 @@ public class VoiceInteractor { public void onCancel() { } public void onAttached(Activity activity) { } public void onDetached() { } void clear() { mRequestInterface = null; mContext = null; Loading Loading @@ -220,11 +228,11 @@ public class VoiceInteractor { } } VoiceInteractor(Context context, Activity activity, IVoiceInteractor interactor, VoiceInteractor(IVoiceInteractor interactor, Context context, Activity activity, Looper looper) { mInteractor = interactor; mContext = context; mActivity = activity; mInteractor = interactor; mHandlerCaller = new HandlerCaller(context, looper, mHandlerCallerCallback, true); } Loading @@ -238,6 +246,49 @@ public class VoiceInteractor { } } private ArrayList<Request> makeRequestList() { final int N = mActiveRequests.size(); if (N < 1) { return null; } ArrayList<Request> list = new ArrayList<Request>(N); for (int i=0; i<N; i++) { list.add(mActiveRequests.valueAt(i)); } return list; } void attachActivity(Activity activity) { if (mActivity == activity) { return; } mContext = activity; mActivity = activity; ArrayList<Request> reqs = makeRequestList(); if (reqs != null) { for (int i=0; i<reqs.size(); i++) { Request req = reqs.get(i); req.mContext = activity; req.mActivity = activity; req.onAttached(activity); } } } void detachActivity() { ArrayList<Request> reqs = makeRequestList(); if (reqs != null) { for (int i=0; i<reqs.size(); i++) { Request req = reqs.get(i); req.onDetached(); req.mActivity = null; req.mContext = null; } } mContext = null; mActivity = null; } public boolean submitRequest(Request request) { try { IVoiceInteractorRequest ireq = request.submit(mInteractor, Loading
core/java/android/inputmethodservice/IInputMethodWrapper.java +4 −3 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_CHANGE_INPUTMETHOD_SUBTYPE = 80; final WeakReference<AbstractInputMethodService> mTarget; final Context mContext; final HandlerCaller mCaller; final WeakReference<InputMethod> mInputMethod; final int mTargetSdkVersion; Loading Loading @@ -111,8 +112,8 @@ class IInputMethodWrapper extends IInputMethod.Stub public IInputMethodWrapper(AbstractInputMethodService context, InputMethod inputMethod) { mTarget = new WeakReference<AbstractInputMethodService>(context); mCaller = new HandlerCaller(context.getApplicationContext(), null, this, true /*asyncHandler*/); mContext = context.getApplicationContext(); mCaller = new HandlerCaller(mContext, null, this, true /*asyncHandler*/); mInputMethod = new WeakReference<InputMethod>(inputMethod); mTargetSdkVersion = context.getApplicationInfo().targetSdkVersion; } Loading Loading @@ -186,7 +187,7 @@ class IInputMethodWrapper extends IInputMethod.Stub case DO_CREATE_SESSION: { SomeArgs args = (SomeArgs)msg.obj; inputMethod.createSession(new InputMethodSessionCallbackWrapper( mCaller.mContext, (InputChannel)args.arg1, mContext, (InputChannel)args.arg1, (IInputSessionCallback)args.arg2)); args.recycle(); return; Loading
core/java/android/inputmethodservice/SoftInputWindow.java +4 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,10 @@ public class SoftInputWindow extends Dialog { getWindow().setAttributes(lp); } public int getGravity() { return getWindow().getAttributes().gravity; } private void updateWidthHeight(WindowManager.LayoutParams lp) { if (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM) { lp.width = WindowManager.LayoutParams.MATCH_PARENT; Loading