use of com.android.internal.os.SomeArgs in project android_frameworks_base by ParanoidAndroid.
the class AccessibilityInteractionController method findAccessibilityNodeInfosByViewIdUiThread.
private void findAccessibilityNodeInfosByViewIdUiThread(Message message) {
final int flags = message.arg1;
final int accessibilityViewId = message.arg2;
SomeArgs args = (SomeArgs) message.obj;
final int interactionId = args.argi1;
final IAccessibilityInteractionConnectionCallback callback = (IAccessibilityInteractionConnectionCallback) args.arg1;
final MagnificationSpec spec = (MagnificationSpec) args.arg2;
final String viewId = (String) args.arg3;
args.recycle();
final List<AccessibilityNodeInfo> infos = mTempAccessibilityNodeInfoList;
infos.clear();
try {
if (mViewRootImpl.mView == null || mViewRootImpl.mAttachInfo == null) {
return;
}
mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = flags;
View root = null;
if (accessibilityViewId != AccessibilityNodeInfo.UNDEFINED) {
root = findViewByAccessibilityId(accessibilityViewId);
} else {
root = mViewRootImpl.mView;
}
if (root != null) {
final int resolvedViewId = root.getContext().getResources().getIdentifier(viewId, null, null);
if (resolvedViewId <= 0) {
return;
}
if (mAddNodeInfosForViewId == null) {
mAddNodeInfosForViewId = new AddNodeInfosForViewId();
}
mAddNodeInfosForViewId.init(resolvedViewId, infos);
root.findViewByPredicate(mAddNodeInfosForViewId);
mAddNodeInfosForViewId.reset();
}
} finally {
try {
mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
applyAppScaleAndMagnificationSpecIfNeeded(infos, spec);
if (spec != null) {
spec.recycle();
}
callback.setFindAccessibilityNodeInfosResult(infos, interactionId);
} catch (RemoteException re) {
/* ignore - the other side will time out */
}
}
}
use of com.android.internal.os.SomeArgs in project android_frameworks_base by ParanoidAndroid.
the class AccessibilityInteractionController method performAccessibilityActionClientThread.
public void performAccessibilityActionClientThread(long accessibilityNodeId, int action, Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interogatingPid, long interrogatingTid) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_PERFORM_ACCESSIBILITY_ACTION;
message.arg1 = flags;
message.arg2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
SomeArgs args = SomeArgs.obtain();
args.argi1 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
args.argi2 = action;
args.argi3 = interactionId;
args.arg1 = callback;
args.arg2 = arguments;
message.obj = args;
// client can handle the message to generate the result.
if (interogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId) {
AccessibilityInteractionClient.getInstanceForThread(interrogatingTid).setSameThreadMessage(message);
} else {
mHandler.sendMessage(message);
}
}
use of com.android.internal.os.SomeArgs in project android_frameworks_base by ParanoidAndroid.
the class AccessibilityInteractionController method findAccessibilityNodeInfoByAccessibilityIdClientThread.
public void findAccessibilityNodeInfoByAccessibilityIdClientThread(long accessibilityNodeId, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID;
message.arg1 = flags;
SomeArgs args = SomeArgs.obtain();
args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
args.argi3 = interactionId;
args.arg1 = callback;
args.arg2 = spec;
message.obj = args;
// client can handle the message to generate the result.
if (interrogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId) {
AccessibilityInteractionClient.getInstanceForThread(interrogatingTid).setSameThreadMessage(message);
} else {
mHandler.sendMessage(message);
}
}
use of com.android.internal.os.SomeArgs in project android_frameworks_base by ParanoidAndroid.
the class AccessibilityInteractionController method findAccessibilityNodeInfosByViewIdClientThread.
public void findAccessibilityNodeInfosByViewIdClientThread(long accessibilityNodeId, String viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID;
message.arg1 = flags;
message.arg2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
SomeArgs args = SomeArgs.obtain();
args.argi1 = interactionId;
args.arg1 = callback;
args.arg2 = spec;
args.arg3 = viewId;
message.obj = args;
// client can handle the message to generate the result.
if (interrogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId) {
AccessibilityInteractionClient.getInstanceForThread(interrogatingTid).setSameThreadMessage(message);
} else {
mHandler.sendMessage(message);
}
}
use of com.android.internal.os.SomeArgs in project android_frameworks_base by ParanoidAndroid.
the class AccessibilityInteractionController method focusSearchClientThread.
public void focusSearchClientThread(long accessibilityNodeId, int direction, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interogatingPid, long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FOCUS_SEARCH;
message.arg1 = flags;
message.arg2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
SomeArgs args = SomeArgs.obtain();
args.argi2 = direction;
args.argi3 = interactionId;
args.arg1 = callback;
args.arg2 = spec;
message.obj = args;
// client can handle the message to generate the result.
if (interogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId) {
AccessibilityInteractionClient.getInstanceForThread(interrogatingTid).setSameThreadMessage(message);
} else {
mHandler.sendMessage(message);
}
}
Aggregations