added
  rest.post('/wd/hub/session/:sessionId?/appium/device/wait_for_activity_and_package', controller.waitForActivityAndPackage);
  rest.post('/wd/hub/session/:sessionId?/appium/device/wait_for_not_activity_and_package', controller.waitForNotActivityAndPackage);

parameters: 
  activity: "activity name"
  package: "package name"
  seconds: "seconds to wait"

These functions will check focused activity and package. 
If they match conditions, response is returned immediately. 
If not - adb.waitForActivity / adb.waitForNotActivity will be used from appium-adb package.

These commands are useful when working with external applications (for example, clicking links and opening them in browser or email client or other app).