summaryrefslogtreecommitdiffstats
path: root/src/utils/qdroidutils.cpp
diff options
context:
space:
mode:
authoraavit <eirik.aavitsland@digia.com>2014-01-17 10:04:40 +0100
committeraavit <eirik.aavitsland@digia.com>2014-01-17 10:06:10 +0100
commit4e6b5d1c692bdcacdbf09955af67fc930c9a35a5 (patch)
tree3dc00ed63e88301f1c4ebeaeb353cca69f2103cb /src/utils/qdroidutils.cpp
parent5980f4bff613e109375d3d841b2891847011074d (diff)
parent59649939d06664d722046cd54e0933c5b402e9a9 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/doc/src/b2qt.qdoc Change-Id: I9d345dcc689e751b997df797ce12b6cd8a14ffb9
Diffstat (limited to 'src/utils/qdroidutils.cpp')
-rw-r--r--src/utils/qdroidutils.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/utils/qdroidutils.cpp b/src/utils/qdroidutils.cpp
index 81a50ed..67d8d29 100644
--- a/src/utils/qdroidutils.cpp
+++ b/src/utils/qdroidutils.cpp
@@ -1,3 +1,21 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of Qt Enterprise Embedded.
+**
+** Licensees holding valid Qt Enterprise licenses may use this file in
+** accordance with the Qt Enterprise License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** the contact form at http://qt.digia.com/
+**
+****************************************************************************/
#include "qdroidutils.h"
#include <unistd.h>
#include <QDebug>
@@ -46,6 +64,28 @@ void QDroidUtils::powerOffSystem()
qWarning("powerOff returned");
}
+void QDroidUtils::setOrientationForAudioSystem(AudioOrientation orientation)
+{
+#ifdef Q_OS_ANDROID_NO_SDK
+ QString orientationString = QStringLiteral("undefined");
+ switch (orientation) {
+ case LandscapeAudioOrientation:
+ orientationString = QStringLiteral("landscape");
+ break;
+ case PortraitAudioOrientation:
+ orientationString = QStringLiteral("portrait");
+ break;
+ case SquareAudioOrientation:
+ orientationString = QStringLiteral("square");
+ break;
+ default:
+ break;
+ }
+ android::AudioSystem::setParameters(0, android::String8(QStringLiteral("orientation=%2")
+ .arg(orientationString).toLatin1().constData()));
+#endif
+}
+
/*!
* Sets the master volume to \a volume.
* The volume can range from 0 to 100 and is linear.