com.android.internal.os.SomeArgs Java Examples
The following examples show how to use
com.android.internal.os.SomeArgs.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InputManagerService.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_DELIVER_INPUT_DEVICES_CHANGED: deliverInputDevicesChanged((InputDevice[])msg.obj); break; case MSG_SWITCH_KEYBOARD_LAYOUT: handleSwitchKeyboardLayout(msg.arg1, msg.arg2); break; case MSG_RELOAD_KEYBOARD_LAYOUTS: reloadKeyboardLayouts(); break; case MSG_UPDATE_KEYBOARD_LAYOUTS: updateKeyboardLayouts(); break; case MSG_RELOAD_DEVICE_ALIASES: reloadDeviceAliases(); break; case MSG_DELIVER_TABLET_MODE_CHANGED: SomeArgs args = (SomeArgs) msg.obj; long whenNanos = (args.argi1 & 0xFFFFFFFFl) | ((long) args.argi2 << 32); boolean inTabletMode = (boolean) args.arg1; deliverTabletModeChanged(whenNanos, inTabletMode); break; } }
Example #2
Source File: PrintManager.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
/** * Creates a new instance. * * @param context The current context in which to operate. * @param service The backing system service. * @param userId The user id in which to operate. * @param appId The application id in which to operate. * @hide */ public PrintManager(Context context, IPrintManager service, int userId, int appId) { mContext = context; mService = service; mUserId = userId; mAppId = appId; mHandler = new Handler(context.getMainLooper(), null, false) { @Override public void handleMessage(Message message) { switch (message.what) { case MSG_NOTIFY_PRINT_JOB_STATE_CHANGED: { SomeArgs args = (SomeArgs) message.obj; PrintJobStateChangeListenerWrapper wrapper = (PrintJobStateChangeListenerWrapper) args.arg1; PrintJobStateChangeListener listener = wrapper.getListener(); if (listener != null) { PrintJobId printJobId = (PrintJobId) args.arg2; listener.onPrintJobStateChanged(printJobId); } args.recycle(); } break; } } }; }
Example #3
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void performAccessibilityActionClientThread(long accessibilityNodeId, int action, Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, 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; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #4
Source File: AccessibilityController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void onRectangleOnScreenRequestedLocked(Rect rectangle) { if (DEBUG_RECTANGLE_REQUESTED) { Slog.i(LOG_TAG, "Rectangle on screen requested: " + rectangle); } if (!mMagnifedViewport.isMagnifyingLocked()) { return; } Rect magnifiedRegionBounds = mTempRect2; mMagnifedViewport.getMagnifiedFrameInContentCoordsLocked(magnifiedRegionBounds); if (magnifiedRegionBounds.contains(rectangle)) { return; } SomeArgs args = SomeArgs.obtain(); args.argi1 = rectangle.left; args.argi2 = rectangle.top; args.argi3 = rectangle.right; args.argi4 = rectangle.bottom; mHandler.obtainMessage(MyHandler.MESSAGE_NOTIFY_RECTANGLE_ON_SCREEN_REQUESTED, args).sendToTarget(); }
Example #5
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void focusSearchClientThread(long accessibilityNodeId, int direction, Region interactiveRegion, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, 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; args.arg3 = interactiveRegion; message.obj = args; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #6
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void findFocusClientThread(long accessibilityNodeId, int focusType, Region interactiveRegion, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec) { Message message = mHandler.obtainMessage(); message.what = PrivateHandler.MSG_FIND_FOCUS; message.arg1 = flags; message.arg2 = focusType; SomeArgs args = SomeArgs.obtain(); args.argi1 = interactionId; args.argi2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId); args.argi3 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId); args.arg1 = callback; args.arg2 = spec; args.arg3 = interactiveRegion; message.obj = args; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #7
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void findAccessibilityNodeInfosByTextClientThread(long accessibilityNodeId, String text, Region interactiveRegion, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec) { Message message = mHandler.obtainMessage(); message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT; message.arg1 = flags; SomeArgs args = SomeArgs.obtain(); args.arg1 = text; args.arg2 = callback; args.arg3 = spec; args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId); args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId); args.argi3 = interactionId; args.arg4 = interactiveRegion; message.obj = args; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #8
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void findAccessibilityNodeInfosByViewIdClientThread(long accessibilityNodeId, String viewId, Region interactiveRegion, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec) { Message message = mHandler.obtainMessage(); message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_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; args.arg4 = interactiveRegion; message.obj = args; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #9
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public void findAccessibilityNodeInfoByAccessibilityIdClientThread( long accessibilityNodeId, Region interactiveRegion, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid, MagnificationSpec spec, Bundle arguments) { final Message message = mHandler.obtainMessage(); message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID; message.arg1 = flags; final SomeArgs args = SomeArgs.obtain(); args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId); args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId); args.argi3 = interactionId; args.arg1 = callback; args.arg2 = spec; args.arg3 = interactiveRegion; args.arg4 = arguments; message.obj = args; scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS); }
Example #10
Source File: NotificationAssistantService.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@Override public void onNotificationSnoozedUntilContext( IStatusBarNotificationHolder sbnHolder, String snoozeCriterionId) throws RemoteException { StatusBarNotification sbn; try { sbn = sbnHolder.get(); } catch (RemoteException e) { Log.w(TAG, "onNotificationSnoozed: Error receiving StatusBarNotification", e); return; } SomeArgs args = SomeArgs.obtain(); args.arg1 = sbn; args.arg2 = snoozeCriterionId; mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_SNOOZED, args).sendToTarget(); }
Example #11
Source File: InputMethodManager.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { // No need to check for dump permission, since we only give this // interface to the system. CountDownLatch latch = new CountDownLatch(1); SomeArgs sargs = SomeArgs.obtain(); sargs.arg1 = fd; sargs.arg2 = fout; sargs.arg3 = args; sargs.arg4 = latch; mH.sendMessage(mH.obtainMessage(MSG_DUMP, sargs)); try { if (!latch.await(5, TimeUnit.SECONDS)) { fout.println("Timeout waiting for dump"); } } catch (InterruptedException e) { fout.println("Interrupted waiting for dump"); } }
Example #12
Source File: ActivityMetricsLogger.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
/** * Notifies the tracker that the visibility of an app is changing. * * @param activityRecord the app that is changing its visibility */ void notifyVisibilityChanged(ActivityRecord activityRecord) { final WindowingModeTransitionInfo info = mWindowingModeTransitionInfo.get( activityRecord.getWindowingMode()); if (info == null) { return; } if (info.launchedActivity != activityRecord) { return; } final TaskRecord t = activityRecord.getTask(); final SomeArgs args = SomeArgs.obtain(); args.arg1 = t; args.arg2 = activityRecord; mHandler.obtainMessage(MSG_CHECK_VISIBILITY, args).sendToTarget(); }
Example #13
Source File: NotificationListenerService.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@Override public void onNotificationRemoved(IStatusBarNotificationHolder sbnHolder, NotificationRankingUpdate update, NotificationStats stats, int reason) { StatusBarNotification sbn; try { sbn = sbnHolder.get(); } catch (RemoteException e) { Log.w(TAG, "onNotificationRemoved: Error receiving StatusBarNotification", e); return; } // protect subclass from concurrent modifications of (@link mNotificationKeys}. synchronized (mLock) { applyUpdateLocked(update); SomeArgs args = SomeArgs.obtain(); args.arg1 = sbn; args.arg2 = mRankingMap; args.arg3 = reason; args.arg4 = stats; mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_REMOVED, args).sendToTarget(); } }
Example #14
Source File: RuntimePermissionPresenter.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
/** * Revoke the permission {@code permissionName} for app {@code packageName} * * @param packageName The package for which to revoke * @param permissionName The permission to revoke */ public void revokeRuntimePermission(String packageName, String permissionName) { SomeArgs args = SomeArgs.obtain(); args.arg1 = packageName; args.arg2 = permissionName; Message message = mRemoteService.obtainMessage( RemoteService.MSG_REVOKE_APP_PERMISSIONS, args); mRemoteService.processMessage(message); }
Example #15
Source File: StorageManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) { final SomeArgs args = SomeArgs.obtain(); args.arg1 = vol; args.argi2 = oldState; args.argi3 = newState; mHandler.obtainMessage(MSG_VOLUME_STATE_CHANGED, args).sendToTarget(); }
Example #16
Source File: StorageManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onStorageStateChanged(String path, String oldState, String newState) { final SomeArgs args = SomeArgs.obtain(); args.arg1 = path; args.arg2 = oldState; args.arg3 = newState; mHandler.obtainMessage(MSG_STORAGE_STATE_CHANGED, args).sendToTarget(); }
Example #17
Source File: VoiceInteractionSessionService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void executeMessage(Message msg) { SomeArgs args = (SomeArgs)msg.obj; switch (msg.what) { case MSG_NEW_SESSION: doNewSession((IBinder)args.arg1, (Bundle)args.arg2, args.argi1); break; } }
Example #18
Source File: VoiceInteractionSession.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public boolean[] supportsCommands(String callingPackage, String[] commands) { Message msg = mHandlerCaller.obtainMessageIOO(MSG_SUPPORTS_COMMANDS, 0, commands, null); SomeArgs args = mHandlerCaller.sendMessageAndWait(msg); if (args != null) { boolean[] res = (boolean[])args.arg1; args.recycle(); return res; } return new boolean[commands.length]; }
Example #19
Source File: NotificationListenerService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onNotificationChannelModification(String pkgName, UserHandle user, NotificationChannel channel, @ChannelOrGroupModificationTypes int modificationType) { SomeArgs args = SomeArgs.obtain(); args.arg1 = pkgName; args.arg2 = user; args.arg3 = channel; args.arg4 = modificationType; mHandler.obtainMessage( MyHandler.MSG_ON_NOTIFICATION_CHANNEL_MODIFIED, args).sendToTarget(); }
Example #20
Source File: NotificationListenerService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onNotificationChannelGroupModification(String pkgName, UserHandle user, NotificationChannelGroup group, @ChannelOrGroupModificationTypes int modificationType) { SomeArgs args = SomeArgs.obtain(); args.arg1 = pkgName; args.arg2 = user; args.arg3 = group; args.arg4 = modificationType; mHandler.obtainMessage( MyHandler.MSG_ON_NOTIFICATION_CHANNEL_GROUP_MODIFIED, args).sendToTarget(); }
Example #21
Source File: NotificationAssistantService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onNotificationEnqueued(IStatusBarNotificationHolder sbnHolder) { StatusBarNotification sbn; try { sbn = sbnHolder.get(); } catch (RemoteException e) { Log.w(TAG, "onNotificationEnqueued: Error receiving StatusBarNotification", e); return; } SomeArgs args = SomeArgs.obtain(); args.arg1 = sbn; mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_ENQUEUED, args).sendToTarget(); }
Example #22
Source File: InputManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
public void sendTabletModeChanged(long whenNanos, boolean inTabletMode) { SomeArgs args = SomeArgs.obtain(); args.argi1 = (int) (whenNanos & 0xFFFFFFFF); args.argi2 = (int) (whenNanos >> 32); args.arg1 = (Boolean) inTabletMode; obtainMessage(MSG_TABLET_MODE_CHANGED, args).sendToTarget(); }
Example #23
Source File: InputManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_TABLET_MODE_CHANGED: SomeArgs args = (SomeArgs) msg.obj; long whenNanos = (args.argi1 & 0xFFFFFFFFl) | ((long) args.argi2 << 32); boolean inTabletMode = (boolean) args.arg1; mListener.onTabletModeChanged(whenNanos, inTabletMode); break; } }
Example #24
Source File: ApplicationPackageManager.java From AndroidComponentPlugin with Apache License 2.0 | 5 votes |
@Override public void onCreated(int moveId, Bundle extras) { final SomeArgs args = SomeArgs.obtain(); args.argi1 = moveId; args.arg2 = extras; mHandler.obtainMessage(MSG_CREATED, args).sendToTarget(); }
Example #25
Source File: PrintManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void write(PageRange[] pages, ParcelFileDescriptor fd, IWriteResultCallback callback, int sequence) { ICancellationSignal cancellationTransport = CancellationSignal.createTransport(); try { callback.onWriteStarted(cancellationTransport, sequence); } catch (RemoteException re) { // The spooler is dead - can't recover. Log.e(LOG_TAG, "Error notifying for write start", re); return; } synchronized (mLock) { // If destroyed the handler is null. if (isDestroyedLocked()) { return; } CancellationSignal cancellationSignal = CancellationSignal.fromTransport( cancellationTransport); SomeArgs args = SomeArgs.obtain(); args.arg1 = mDocumentAdapter; args.arg2 = pages; args.arg3 = fd; args.arg4 = cancellationSignal; args.arg5 = new MyWriteResultCallback(callback, fd, sequence); mHandler.obtainMessage(MyHandler.MSG_ON_WRITE, args).sendToTarget(); } }
Example #26
Source File: PrintManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void layout(PrintAttributes oldAttributes, PrintAttributes newAttributes, ILayoutResultCallback callback, Bundle metadata, int sequence) { ICancellationSignal cancellationTransport = CancellationSignal.createTransport(); try { callback.onLayoutStarted(cancellationTransport, sequence); } catch (RemoteException re) { // The spooler is dead - can't recover. Log.e(LOG_TAG, "Error notifying for layout start", re); return; } synchronized (mLock) { // If destroyed the handler is null. if (isDestroyedLocked()) { return; } CancellationSignal cancellationSignal = CancellationSignal.fromTransport( cancellationTransport); SomeArgs args = SomeArgs.obtain(); args.arg1 = mDocumentAdapter; args.arg2 = oldAttributes; args.arg3 = newAttributes; args.arg4 = cancellationSignal; args.arg5 = new MyLayoutResultCallback(callback, sequence); args.arg6 = metadata; mHandler.obtainMessage(MyHandler.MSG_ON_LAYOUT, args).sendToTarget(); } }
Example #27
Source File: StorageManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public boolean handleMessage(Message msg) { final SomeArgs args = (SomeArgs) msg.obj; switch (msg.what) { case MSG_STORAGE_STATE_CHANGED: mCallback.onStorageStateChanged((String) args.arg1, (String) args.arg2, (String) args.arg3); args.recycle(); return true; case MSG_VOLUME_STATE_CHANGED: mCallback.onVolumeStateChanged((VolumeInfo) args.arg1, args.argi2, args.argi3); args.recycle(); return true; case MSG_VOLUME_RECORD_CHANGED: mCallback.onVolumeRecordChanged((VolumeRecord) args.arg1); args.recycle(); return true; case MSG_VOLUME_FORGOTTEN: mCallback.onVolumeForgotten((String) args.arg1); args.recycle(); return true; case MSG_DISK_SCANNED: mCallback.onDiskScanned((DiskInfo) args.arg1, args.argi2); args.recycle(); return true; case MSG_DISK_DESTROYED: mCallback.onDiskDestroyed((DiskInfo) args.arg1); args.recycle(); return true; } args.recycle(); return false; }
Example #28
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
private void focusSearchUiThread(Message message) { final int flags = message.arg1; final int accessibilityViewId = message.arg2; SomeArgs args = (SomeArgs) message.obj; final int direction = args.argi2; final int interactionId = args.argi3; final IAccessibilityInteractionConnectionCallback callback = (IAccessibilityInteractionConnectionCallback) args.arg1; final MagnificationSpec spec = (MagnificationSpec) args.arg2; final Region interactiveRegion = (Region) args.arg3; args.recycle(); AccessibilityNodeInfo next = null; try { if (mViewRootImpl.mView == null || mViewRootImpl.mAttachInfo == null) { return; } mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = flags; View root = null; if (accessibilityViewId != AccessibilityNodeInfo.ROOT_ITEM_ID) { root = findViewByAccessibilityId(accessibilityViewId); } else { root = mViewRootImpl.mView; } if (root != null && isShown(root)) { View nextView = root.focusSearch(direction); if (nextView != null) { next = nextView.createAccessibilityNodeInfo(); } } } finally { updateInfoForViewportAndReturnFindNodeResult( next, callback, interactionId, spec, interactiveRegion); } }
Example #29
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
private void prepareForExtraDataRequestUiThread(Message message) { SomeArgs args = (SomeArgs) message.obj; final int virtualDescendantId = args.argi1; final AccessibilityRequestPreparer preparer = (AccessibilityRequestPreparer) args.arg1; final String extraDataKey = (String) args.arg2; final Bundle requestArguments = (Bundle) args.arg3; final Message preparationFinishedMessage = (Message) args.arg4; preparer.onPrepareExtraData(virtualDescendantId, extraDataKey, requestArguments, preparationFinishedMessage); }
Example #30
Source File: AccessibilityInteractionController.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
private void findAccessibilityNodeInfoByAccessibilityIdUiThread(Message message) { final int flags = message.arg1; SomeArgs args = (SomeArgs) message.obj; final int accessibilityViewId = args.argi1; final int virtualDescendantId = args.argi2; final int interactionId = args.argi3; final IAccessibilityInteractionConnectionCallback callback = (IAccessibilityInteractionConnectionCallback) args.arg1; final MagnificationSpec spec = (MagnificationSpec) args.arg2; final Region interactiveRegion = (Region) args.arg3; final Bundle arguments = (Bundle) args.arg4; args.recycle(); 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.ROOT_ITEM_ID) { root = mViewRootImpl.mView; } else { root = findViewByAccessibilityId(accessibilityViewId); } if (root != null && isShown(root)) { mPrefetcher.prefetchAccessibilityNodeInfos( root, virtualDescendantId, flags, infos, arguments); } } finally { updateInfosForViewportAndReturnFindNodeResult( infos, callback, interactionId, spec, interactiveRegion); } }