Search in sources :

Example 41 with SomeArgs

use of com.android.internal.os.SomeArgs in project android_frameworks_base by ResurrectionRemix.

the class AppWidgetServiceImpl method scheduleNotifyProviderChangedLocked.

private void scheduleNotifyProviderChangedLocked(Widget widget) {
    long requestId = REQUEST_COUNTER.incrementAndGet();
    if (widget != null) {
        // When the provider changes, reset everything else.
        widget.updateRequestIds.clear();
        widget.updateRequestIds.append(ID_PROVIDER_CHANGED, requestId);
    }
    if (widget == null || widget.provider == null || widget.provider.zombie || widget.host.callbacks == null || widget.host.zombie) {
        return;
    }
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = widget.host;
    args.arg2 = widget.host.callbacks;
    args.arg3 = widget.provider.info;
    args.arg4 = requestId;
    args.argi1 = widget.appWidgetId;
    mCallbackHandler.obtainMessage(CallbackHandler.MSG_NOTIFY_PROVIDER_CHANGED, args).sendToTarget();
}
Also used : SomeArgs(com.android.internal.os.SomeArgs)

Example 42 with SomeArgs

use of com.android.internal.os.SomeArgs in project android_frameworks_base by DirtyUnicorns.

the class RuntimePermissionPresenter method getAppPermissions.

/**
     * Gets the runtime permissions for an app.
     *
     * @param packageName The package for which to query.
     * @param callback Callback to receive the result.
     * @param handler Handler on which to invoke the callback.
     */
public void getAppPermissions(@NonNull String packageName, @NonNull OnResultCallback callback, @Nullable Handler handler) {
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = packageName;
    args.arg2 = callback;
    args.arg3 = handler;
    Message message = mRemoteService.obtainMessage(RemoteService.MSG_GET_APP_PERMISSIONS, args);
    mRemoteService.processMessage(message);
}
Also used : Message(android.os.Message) SomeArgs(com.android.internal.os.SomeArgs)

Example 43 with SomeArgs

use of com.android.internal.os.SomeArgs in project android_frameworks_base by DirtyUnicorns.

the class RuntimePermissionPresenter method getAppsUsingPermissions.

/**
     * Gets the system apps that use runtime permissions. System apps are ones
     * that are considered system for presentation purposes instead of ones
     * that are preinstalled on the system image. System apps are ones that
     * are on the system image, haven't been updated (a.k.a factory apps)
     * that do not have a launcher icon.
     *
     * @param system If true only system apps are returned otherwise only
     *        non-system ones are returned.
     * @param callback Callback to receive the result.
     * @param handler Handler on which to invoke the callback.
     */
public void getAppsUsingPermissions(boolean system, @NonNull OnResultCallback callback, @Nullable Handler handler) {
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = callback;
    args.arg2 = handler;
    args.argi1 = system ? 1 : 0;
    Message message = mRemoteService.obtainMessage(RemoteService.MSG_GET_APPS_USING_PERMISSIONS, args);
    mRemoteService.processMessage(message);
}
Also used : Message(android.os.Message) SomeArgs(com.android.internal.os.SomeArgs)

Example 44 with SomeArgs

use of com.android.internal.os.SomeArgs in project android_frameworks_base by DirtyUnicorns.

the class ViewRootImpl method dispatchInputEvent.

public void dispatchInputEvent(InputEvent event, InputEventReceiver receiver) {
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = event;
    args.arg2 = receiver;
    Message msg = mHandler.obtainMessage(MSG_DISPATCH_INPUT_EVENT, args);
    msg.setAsynchronous(true);
    mHandler.sendMessage(msg);
}
Also used : Message(android.os.Message) SomeArgs(com.android.internal.os.SomeArgs)

Example 45 with SomeArgs

use of com.android.internal.os.SomeArgs in project android_frameworks_base by DirtyUnicorns.

the class PrintPreviewController method onContentUpdated.

public void onContentUpdated(boolean documentChanged, int documentPageCount, PageRange[] writtenPages, PageRange[] selectedPages, MediaSize mediaSize, Margins minMargins) {
    boolean contentChanged = false;
    if (documentChanged) {
        contentChanged = true;
    }
    if (documentPageCount != mDocumentPageCount) {
        mDocumentPageCount = documentPageCount;
        contentChanged = true;
    }
    if (contentChanged) {
        // If not closed, close as we start over.
        if (mPageAdapter.isOpened()) {
            Message operation = mHandler.obtainMessage(MyHandler.MSG_CLOSE);
            mHandler.enqueueOperation(operation);
        }
    }
    // all rendered pages and reopen the file...
    if ((contentChanged || !mPageAdapter.isOpened()) && writtenPages != null) {
        Message operation = mHandler.obtainMessage(MyHandler.MSG_OPEN);
        mHandler.enqueueOperation(operation);
    }
    // Update the attributes before after closed to avoid flicker.
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = writtenPages;
    args.arg2 = selectedPages;
    args.arg3 = mediaSize;
    args.arg4 = minMargins;
    args.argi1 = documentPageCount;
    Message operation = mHandler.obtainMessage(MyHandler.MSG_UPDATE, args);
    mHandler.enqueueOperation(operation);
    // If document changed and has pages we want to start preloading.
    if (contentChanged && writtenPages != null) {
        operation = mHandler.obtainMessage(MyHandler.MSG_START_PRELOAD);
        mHandler.enqueueOperation(operation);
    }
}
Also used : Message(android.os.Message) SomeArgs(com.android.internal.os.SomeArgs)

Aggregations

SomeArgs (com.android.internal.os.SomeArgs)187 Message (android.os.Message)67 Point (android.graphics.Point)46 RemoteException (android.os.RemoteException)42 IAccessibilityInteractionConnectionCallback (android.view.accessibility.IAccessibilityInteractionConnectionCallback)36 AccessibilityNodeInfo (android.view.accessibility.AccessibilityNodeInfo)30 Region (android.graphics.Region)25 AccessibilityNodeProvider (android.view.accessibility.AccessibilityNodeProvider)18 IInputMethod (com.android.internal.view.IInputMethod)12 InputChannel (android.view.InputChannel)11 EditorInfo (android.view.inputmethod.EditorInfo)11 IInputContext (com.android.internal.view.IInputContext)11 Rect (android.graphics.Rect)7 Configuration (android.content.res.Configuration)6 Bundle (android.os.Bundle)6 IBinder (android.os.IBinder)6 InputBinding (android.view.inputmethod.InputBinding)6 InputConnection (android.view.inputmethod.InputConnection)6 InputMethod (android.view.inputmethod.InputMethod)6 IInputMethodClient (com.android.internal.view.IInputMethodClient)6