Search in sources :

Example 61 with SomeArgs

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

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)

Example 62 with SomeArgs

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

the class AppWidgetServiceImpl method scheduleNotifyUpdateAppWidgetLocked.

private void scheduleNotifyUpdateAppWidgetLocked(Widget widget, RemoteViews updateViews) {
    long requestId = REQUEST_COUNTER.incrementAndGet();
    if (widget != null) {
        widget.updateRequestIds.put(ID_VIEWS_UPDATE, 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 = (updateViews != null) ? updateViews.clone() : null;
    args.arg4 = requestId;
    args.argi1 = widget.appWidgetId;
    mCallbackHandler.obtainMessage(CallbackHandler.MSG_NOTIFY_UPDATE_APP_WIDGET, args).sendToTarget();
}
Also used : SomeArgs(com.android.internal.os.SomeArgs)

Example 63 with SomeArgs

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

the class AppWidgetServiceImpl method scheduleNotifyAppWidgetViewDataChanged.

private void scheduleNotifyAppWidgetViewDataChanged(Widget widget, int viewId) {
    if (viewId == ID_VIEWS_UPDATE || viewId == ID_PROVIDER_CHANGED) {
        // method with a wrong id. In that case, ignore the call.
        return;
    }
    long requestId = REQUEST_COUNTER.incrementAndGet();
    if (widget != null) {
        widget.updateRequestIds.put(viewId, requestId);
    }
    if (widget == null || widget.host == null || widget.host.zombie || widget.host.callbacks == null || widget.provider == null || widget.provider.zombie) {
        return;
    }
    SomeArgs args = SomeArgs.obtain();
    args.arg1 = widget.host;
    args.arg2 = widget.host.callbacks;
    args.arg3 = requestId;
    args.argi1 = widget.appWidgetId;
    args.argi2 = viewId;
    mCallbackHandler.obtainMessage(CallbackHandler.MSG_NOTIFY_VIEW_DATA_CHANGED, args).sendToTarget();
}
Also used : SomeArgs(com.android.internal.os.SomeArgs)

Example 64 with SomeArgs

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

the class InputManagerService method setKeyboardLayoutForInputDeviceInner.

private void setKeyboardLayoutForInputDeviceInner(InputDeviceIdentifier identifier, InputMethodSubtypeHandle imeHandle, String keyboardLayoutDescriptor) {
    String key = getLayoutDescriptor(identifier);
    synchronized (mDataStore) {
        try {
            if (mDataStore.setKeyboardLayout(key, imeHandle, keyboardLayoutDescriptor)) {
                if (DEBUG) {
                    Slog.d(TAG, "Set keyboard layout " + keyboardLayoutDescriptor + " for subtype " + imeHandle + " and device " + identifier + " using key " + key);
                }
                if (imeHandle.equals(mCurrentImeHandle)) {
                    if (DEBUG) {
                        Slog.d(TAG, "Layout for current subtype changed, switching layout");
                    }
                    SomeArgs args = SomeArgs.obtain();
                    args.arg1 = identifier;
                    args.arg2 = imeHandle;
                    mHandler.obtainMessage(MSG_SWITCH_KEYBOARD_LAYOUT, args).sendToTarget();
                }
                mHandler.sendEmptyMessage(MSG_RELOAD_KEYBOARD_LAYOUTS);
            }
        } finally {
            mDataStore.saveIfNeeded();
        }
    }
}
Also used : SomeArgs(com.android.internal.os.SomeArgs)

Example 65 with SomeArgs

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

the class InputManagerService method notifySwitch.

// Native callback.
private void notifySwitch(long whenNanos, int switchValues, int switchMask) {
    if (DEBUG) {
        Slog.d(TAG, "notifySwitch: values=" + Integer.toHexString(switchValues) + ", mask=" + Integer.toHexString(switchMask));
    }
    if ((switchMask & SW_LID_BIT) != 0) {
        final boolean lidOpen = ((switchValues & SW_LID_BIT) == 0);
        mWindowManagerCallbacks.notifyLidSwitchChanged(whenNanos, lidOpen);
    }
    if ((switchMask & SW_CAMERA_LENS_COVER_BIT) != 0) {
        final boolean lensCovered = ((switchValues & SW_CAMERA_LENS_COVER_BIT) != 0);
        mWindowManagerCallbacks.notifyCameraLensCoverSwitchChanged(whenNanos, lensCovered);
    }
    if (mUseDevInputEventForAudioJack && (switchMask & SW_JACK_BITS) != 0) {
        mWiredAccessoryCallbacks.notifyWiredAccessoryChanged(whenNanos, switchValues, switchMask);
    }
    if ((switchMask & SW_TABLET_MODE_BIT) != 0) {
        SomeArgs args = SomeArgs.obtain();
        args.argi1 = (int) (whenNanos & 0xFFFFFFFF);
        args.argi2 = (int) (whenNanos >> 32);
        args.arg1 = Boolean.valueOf((switchValues & SW_TABLET_MODE_BIT) != 0);
        mHandler.obtainMessage(MSG_DELIVER_TABLET_MODE_CHANGED, args).sendToTarget();
    }
}
Also used : 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