Mdm Api Example
Aurora OS application to demonstrate the MDM API.
Terms of Use and Participation
The source code of the project is provided under the license, which allows its use in third-party applications.
The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.
Information about the contributors is specified in the AUTHORS file.
Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.
Project Structure
The project has a standard structure of an application based on C++ and QML for Aurora OS.
-
ru.auroraos.MdmApiExample subproject contains an application source code.
- ru.auroraos.MdmApiExample.pro file describes the ru.auroraos.MdmApiExample subproject structure for the qmake build system.
- icons directory contains the application icons for different screen resolutions.
-
qml directory contains the QML source code and the UI resources.
- cover directory contains the application cover implementations.
- icons directory contains the additional custom UI icons.
- pages directory contains the application pages.
- MdmApiExample.qml file provides the application window implementation.
-
src directory contains the C++ source code.
- main.cpp file is the application entry point.
- mdmapiexampledbusinterface.h and mdmapiexampledbusinterface.cpp files are source code of the MdmApiExampleDBusInterface class is a proxy-class to use the ru.auroraos.MdmApiExample DBus-service.
- translations directory contains the UI translation files.
- ru.auroraos.MdmApiExample.desktop file defines the display and parameters for launching the application.
-
ru.auroraos.MdmApiExampleDaemon subproject contains the systemd-service source code that uses MDM API.
- ru.auroraos.MdmApiExampleDaemon.pro file describes the ru.auroraos.MdmApiExampleDaemon subproject structure for the qmake build system.
-
src directory contains the C++ source code.
- main.cpp file is the service entry point.
- mdmapiexampledbusadaptor.h and mdmapiexampledbusadaptor.cpp files are source code of the MdmApiExampleDBusAdaptor class that describes the ru.auroraos.MdmApiExample DBus-interface to manage the device features.
- featureslocker.h and featureslocker.cpp files are source code of the FeaturesLocker class that provides the ability to to lock and unlock the device features.
- featureslockerrunner.h and featureslockerrunner.cpp files are source code of the FeaturesLockerRunner class that determines a thread to handle the user input events from the command line interface.
- filedownloader.h and filedownloader.cpp files are source code of the FileDownloader class that provides a method to download a file via network.
- locationservice.h and locationservice.cpp files are source code of the LocationService class that provides methods to start and stop retrieving the current location info.
- dbus directory contains the configuration files for the DBus-service.
- systemd directory contains the configuration file for the systemd-service.
-
rpm directory contains the rpm-package build settings.
- ru.auroraos.MdmApiExample.spec file is used by rpmbuild tool.
Compatibility
The project is compatible with all the supported versions of the Aurora OS.
Architecture schema
┌──────────────────┐
│ Aurora OS │
┌───────────────────┐ └────────▲─────────┘
│ RPM-package │ │
User ├───────────────────┴────────────────────────┼──────────────────────┐
│ │MDM API │
│ @ │ │ ┌────────────────┐ ┌──────────┴──────────┐ │
└─┬─┘ │ │ GUI │ DBus │ systemd-service │ │
│ ◄────┼───►│ MdmApiExample │◄─────────►│ MdmApiExampleDaemon │ │
┌─┴─┐ │ └────────────────┘ └──────────▲──────────┘ │
│ │ │ │ │
└────────────────────────────────────────────┼──────────────────────┘
│
┌─────▼─────┐
│ TCP │
└─────▲─────┘
│
│
┌──────▼───────┐
│ MDM Server │
└──────────────┘
Features
The application has been tested for the following features:
- The application allows to lock and unlock the device features (Camera, Microphone and WLAN).
- The application allows to download a file from via the network.
- The application allows to start and stop retrieving the location info.
Notes
Unfortunately, it is impossible to implement the launch of the systemd-service immediately after installing the RPM-package: the validator will print an error about the impossibility of describing scripts in the spec file. Therefore, to start it needs to either reboot the device or connect to it via SSH and run the following commands:
devel-su systemctl daemon-reload
devel-su systemctl restart ru.auroraos.MdmApiExampleDaemon
In order to make an interaction via DBus between the UI application and the systemd-service possible, it was necessary to name the DBus-service and the DBus-interface same as the executable file of the UI application, i.e. ru.auroraos.MdmApiExample
. Otherwise, the application could not access the DBus-service with the ServiceUnknown
error.
Issues
File downloading. There is a problem of downloading files within the background MDM-service. The downloaded file cannot be written to the file system with an error "Permission denied". Now, only one path is found where the MDM-service can write a file: /var/lib/sailfish-mdm
.