title: OnePlus One - Touch gestures recognition while screen is off
body: <p><strong>OnePlue One</strong><br>
  The OnePlus One has the feature to detect gestures while the screen is off.<br>
  You can double tap the screen, while the phone is asleep, and the phone will wake up. Or drawing a circle (again, when the screen is off) will open the camera app. Demonstrations can be found <a href="https://www.youtube.com/watch?v=YNy8QC5TbTI" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I'm trying to understand how i can detect screen gestures, while the screen is off, when the app is directed to the OnePlus owners.  </p>
  
  <p>While investigation some related posts, none of them where asking about screen-off-gesture-detection at the OnePlus:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/23915624/touch-gestures-recognition-while-screen-is-off">Touch gestures recognition while screen is off?</a>  </li>
  <li><a href="https://stackoverflow.com/questions/21112375/detect-gesture-with-phone-sleeping">Detect Gesture with Phone sleeping</a> </li>
  <li><a href="https://stackoverflow.com/questions/5915604/is-it-possible-to-get-a-device-to-wake-up-from-sleep-screen-dark-by-detecting?rq=1">Is it possible to get a device to wake up from sleep (screen dark) by detecting a touch to the screen?</a> </li>
  </ul>
  
  <p><strong>Galaxy S5 or other OLED screen devices</strong><br>
  I found an app named <a href="https://play.google.com/store/apps/details?id=tecnology.angs.knockr&amp;hl=en" rel="nofollow noreferrer">knockr</a> which gives similar utility to the OnePlus. From the description of the app: </p>
  
  <blockquote>
    <p>Knockr Black Screen: With an OLED device, like the Samsung Galaxy S5 or Moto X, Knockr will listen for gestures while the screen is off. (Recommended only to be used with an OLED device).</p>
  </blockquote>
  
  <p>I tried the app on my Galaxy <strong>S2</strong>, while tracking the logcat.<br>
  As can be seen from the following log, after i manually turn off the screen, the Konckr app actually turn the screen on, and set the screen to be black.
  Again, i tested the app on a S2, maybe on Galaxy S5 things are different?  </p>
  
  <p><img src="https://i.stack.imgur.com/sStgy.png" alt="logcat">  </p>
  
  <p><strong>Summary</strong><br>
  I'm trying to understand two things:  </p>
  
  <ol>
  <li><p>How actually works the feature of screen-off-gesture-detection, on the OnePlus or OLED devices? Does it just keep the screen awake (and shows a black turn on screen instead)?   </p></li>
  <li><p>Is there any API for detecting gestures while screen is off?<br>
  Regarding Galaxy, i found nothing relevant in <a href="http://developer.samsung.com/galaxy" rel="nofollow noreferrer">Samsung Developers</a>.  </p></li>
  </ol>