コード例 #1
0
 @Override
 public void dispatchAppVisibility(boolean visible) {
   // We don't do this in preview mode; we'll let the preview
   // activity tell us when to run.
   if (!mIWallpaperEngine.mIsPreview) {
     Message msg = mCaller.obtainMessageI(MSG_VISIBILITY_CHANGED, visible ? 1 : 0);
     mCaller.sendMessage(msg);
   }
 }
コード例 #2
0
 @Override
 public void resized(
     Rect frame,
     Rect contentInsets,
     Rect visibleInsets,
     boolean reportDraw,
     Configuration newConfig) {
   Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0);
   mCaller.sendMessage(msg);
 }
コード例 #3
0
 private void dispatchPointer(MotionEvent event) {
   if (event.isTouchEvent()) {
     synchronized (mLock) {
       if (event.getAction() == MotionEvent.ACTION_MOVE) {
         mPendingMove = event;
       } else {
         mPendingMove = null;
       }
     }
     Message msg = mCaller.obtainMessageO(MSG_TOUCH_EVENT, event);
     mCaller.sendMessage(msg);
   } else {
     event.recycle();
   }
 }
コード例 #4
0
 @Override
 public IVoiceInteractorRequest startConfirmation(
     String callingPackage,
     IVoiceInteractorCallback callback,
     CharSequence prompt,
     Bundle extras) {
   Request request = newRequest(callback);
   mHandlerCaller.sendMessage(
       mHandlerCaller.obtainMessageOOOO(
           MSG_START_CONFIRMATION,
           new Caller(callingPackage, Binder.getCallingUid()),
           request,
           prompt,
           extras));
   return request.mInterface;
 }
コード例 #5
0
 @Override
 public IVoiceInteractorRequest startAbortVoice(
     String callingPackage,
     IVoiceInteractorCallback callback,
     CharSequence message,
     Bundle extras) {
   Request request = newRequest(callback);
   mHandlerCaller.sendMessage(
       mHandlerCaller.obtainMessageOOOO(
           MSG_START_ABORT_VOICE,
           new Caller(callingPackage, Binder.getCallingUid()),
           request,
           message,
           extras));
   return request.mInterface;
 }
コード例 #6
0
 @Override
 public IVoiceInteractorRequest startCommand(
     String callingPackage,
     IVoiceInteractorCallback callback,
     String command,
     Bundle extras) {
   Request request = newRequest(callback);
   mHandlerCaller.sendMessage(
       mHandlerCaller.obtainMessageOOOO(
           MSG_START_COMMAND,
           new Caller(callingPackage, Binder.getCallingUid()),
           request,
           command,
           extras));
   return request.mInterface;
 }
コード例 #7
0
 @Override
 public void dispatchWallpaperCommand(
     String action, int x, int y, int z, Bundle extras, boolean sync) {
   synchronized (mLock) {
     if (DEBUG) Log.v(TAG, "Dispatch wallpaper command: " + x + ", " + y);
     WallpaperCommand cmd = new WallpaperCommand();
     cmd.action = action;
     cmd.x = x;
     cmd.y = y;
     cmd.z = z;
     cmd.extras = extras;
     cmd.sync = sync;
     Message msg = mCaller.obtainMessage(MSG_WALLPAPER_COMMAND);
     msg.obj = cmd;
     mCaller.sendMessage(msg);
   }
 }
コード例 #8
0
 @Override
 public void dispatchWallpaperOffsets(
     float x, float y, float xStep, float yStep, boolean sync) {
   synchronized (mLock) {
     if (DEBUG) Log.v(TAG, "Dispatch wallpaper offsets: " + x + ", " + y);
     mPendingXOffset = x;
     mPendingYOffset = y;
     mPendingXOffsetStep = xStep;
     mPendingYOffsetStep = yStep;
     if (sync) {
       mPendingSync = true;
     }
     if (!mOffsetMessageEnqueued) {
       mOffsetMessageEnqueued = true;
       Message msg = mCaller.obtainMessage(MSG_WALLPAPER_OFFSETS);
       mCaller.sendMessage(msg);
     }
   }
 }
コード例 #9
0
    IWallpaperEngineWrapper(
        WallpaperService context,
        IWallpaperConnection conn,
        IBinder windowToken,
        int windowType,
        boolean isPreview,
        int reqWidth,
        int reqHeight) {
      if (DEBUG && mCallbackLooper != null) {
        mCallbackLooper.setMessageLogging(new LogPrinter(Log.VERBOSE, TAG));
      }
      mCaller =
          new HandlerCaller(
              context, mCallbackLooper != null ? mCallbackLooper : context.getMainLooper(), this);
      mConnection = conn;
      mWindowToken = windowToken;
      mWindowType = windowType;
      mIsPreview = isPreview;
      mReqWidth = reqWidth;
      mReqHeight = reqHeight;

      Message msg = mCaller.obtainMessage(DO_ATTACH);
      mCaller.sendMessage(msg);
    }
コード例 #10
0
 @Override
 public void closeSystemDialogs() {
   mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_CLOSE_SYSTEM_DIALOGS));
 }
コード例 #11
0
 @Override
 public void taskFinished(Intent intent, int taskId) {
   mHandlerCaller.sendMessage(
       mHandlerCaller.obtainMessageIO(MSG_TASK_FINISHED, taskId, intent));
 }
コード例 #12
0
 @Override
 public void taskStarted(Intent intent, int taskId) {
   mHandlerCaller.sendMessage(
       mHandlerCaller.obtainMessageIO(MSG_TASK_STARTED, taskId, intent));
 }
コード例 #13
0
 public void onAccessibilityEvent(AccessibilityEvent event) {
   Message message = mCaller.obtainMessageO(DO_ON_ACCESSIBILITY_EVENT, event);
   mCaller.sendMessage(message);
 }
コード例 #14
0
 public void setVisibility(boolean visible) {
   Message msg = mCaller.obtainMessageI(MSG_VISIBILITY_CHANGED, visible ? 1 : 0);
   mCaller.sendMessage(msg);
 }
コード例 #15
0
 public void onInterrupt() {
   Message message = mCaller.obtainMessage(DO_ON_INTERRUPT);
   mCaller.sendMessage(message);
 }
コード例 #16
0
 @Override
 public void moved(int newX, int newY) {
   Message msg = mCaller.obtainMessageII(MSG_WINDOW_MOVED, newX, newY);
   mCaller.sendMessage(msg);
 }
コード例 #17
0
 @Override
 public void onUpdateSurface() {
   Message msg = mCaller.obtainMessage(MSG_UPDATE_SURFACE);
   mCaller.sendMessage(msg);
 }
コード例 #18
0
 @Override
 public void onRelayoutContainer() {
   Message msg = mCaller.obtainMessage(MSG_UPDATE_SURFACE);
   mCaller.sendMessage(msg);
 }
コード例 #19
0
 public void destroy() {
   Message msg = mCaller.obtainMessage(DO_DETACH);
   mCaller.sendMessage(msg);
 }
コード例 #20
0
 @Override
 public void destroy() {
   mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_DESTROY));
 }
コード例 #21
0
 public void setConnection(IAccessibilityServiceConnection connection) {
   Message message = mCaller.obtainMessageO(DO_SET_SET_CONNECTION, connection);
   mCaller.sendMessage(message);
 }
コード例 #22
0
 public void setDesiredSize(int width, int height) {
   Message msg = mCaller.obtainMessageII(DO_SET_DESIRED_SIZE, width, height);
   mCaller.sendMessage(msg);
 }