code: public static void turnScreenOn(Activity context) {
          try {
              Window window = context.getWindow();
              window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
              window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
              window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
          } catch (Exception ex) {
              Log.e("Caffeine", "Unable to turn on screen for activity " + context);
          }
      }
docs: Force screen to turn on if the phone is asleep.
  
  @param context The current Context or Activity that this method is called from