public void handleMessage(Message m) {
   final InputManager inputManager = InputManager.getInstance();
   switch (m.what) {
     case MSG_PIE_GAIN_FOCUS:
       if (mPieContainer != null) {
         if (!mPieActivationListener.gainTouchFocus(mPieContainer.getWindowToken())) {
           mPieContainer.exit();
         }
       } else {
         mPieActivationListener.restoreListenerState();
       }
       break;
   }
 }
 @Override
 public void onExit() {
   mWindowManager.removeView(mPieContainer);
   mPieActivationListener.restoreListenerState();
   if (mIsDetaching) {
     detachContainer(true);
   }
 }
 @Override
 public void onEdgeGestureActivation(
     int touchX, int touchY, EdgeGesturePosition position, int flags) {
   if (mPieContainer != null && activateFromListener(touchX, touchY, position)) {
     // give the main thread some time to do the bookkeeping
     mHandler.obtainMessage(MSG_PIE_GAIN_FOCUS).sendToTarget();
   } else {
     mPieActivationListener.restoreListenerState();
   }
 }