MobileScreenMgr.cc 845 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

Don Gagne's avatar
Don Gagne committed
10 11 12 13 14 15

#include "MobileScreenMgr.h"

#include <QtAndroidExtras/QtAndroidExtras>
#include <QtAndroidExtras/QAndroidJniObject>

16
static const char* kJniClassName = "org/mavlink/qgroundcontrol/QGCActivity";
Don Gagne's avatar
Don Gagne committed
17

Don Gagne's avatar
Don Gagne committed
18 19 20 21 22 23 24 25
void MobileScreenMgr::setKeepScreenOn(bool keepScreenOn)
{
    if (keepScreenOn) {
        QAndroidJniObject::callStaticMethod<void>(kJniClassName, "keepScreenOn", "()V");
    } else {
        QAndroidJniObject::callStaticMethod<void>(kJniClassName, "restoreScreenOn", "()V");
    }
}