Browse Source

[device_info_plus] Implement device_info_plus plugin. OMP#OS-17020

merge-requests/18/merge
Vitaliy Zarubin 2 years ago
parent
commit
ed5d88bd9b
  1. 30
      packages/device_info_plus/device_info_plus_aurora/.gitignore
  2. 55
      packages/device_info_plus/device_info_plus_aurora/README.md
  3. 4
      packages/device_info_plus/device_info_plus_aurora/analysis_options.yaml
  4. BIN
      packages/device_info_plus/device_info_plus_aurora/data/preview.png
  5. 59
      packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.Features.xml
  6. 21
      packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.SIM.xml
  7. 21
      packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.Storages.xml
  8. 47
      packages/device_info_plus/device_info_plus_aurora/example/.gitignore
  9. 21
      packages/device_info_plus/device_info_plus_aurora/example/README.md
  10. 4
      packages/device_info_plus/device_info_plus_aurora/example/analysis_options.yaml
  11. 1
      packages/device_info_plus/device_info_plus_aurora/example/aurora/.gitignore
  12. 50
      packages/device_info_plus/device_info_plus_aurora/example/aurora/CMakeLists.txt
  13. 12
      packages/device_info_plus/device_info_plus_aurora/example/aurora/desktop/com.example.device_info_plus_aurora_example.desktop
  14. BIN
      packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/108x108.png
  15. BIN
      packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/128x128.png
  16. BIN
      packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/172x172.png
  17. BIN
      packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/86x86.png
  18. 13
      packages/device_info_plus/device_info_plus_aurora/example/aurora/main.cpp
  19. 31
      packages/device_info_plus/device_info_plus_aurora/example/aurora/rpm/com.example.device_info_plus_aurora_example.spec
  20. 389
      packages/device_info_plus/device_info_plus_aurora/example/lib/main.dart
  21. 257
      packages/device_info_plus/device_info_plus_aurora/example/pubspec.lock
  22. 26
      packages/device_info_plus/device_info_plus_aurora/example/pubspec.yaml
  23. 110
      packages/device_info_plus/device_info_plus_aurora/lib/aurora_device_info.dart
  24. 98
      packages/device_info_plus/device_info_plus_aurora/lib/device_info_plus_aurora.dart
  25. 237
      packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_features.dart
  26. 105
      packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_sim.dart
  27. 72
      packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_storages.dart
  28. 29
      packages/device_info_plus/device_info_plus_aurora/pubspec.yaml

30
packages/device_info_plus/device_info_plus_aurora/.gitignore vendored

@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

55
packages/device_info_plus/device_info_plus_aurora/README.md

@ -0,0 +1,55 @@
# device_info_plus_aurora
The Aurora implementation of [`device_info_plus`](https://pub.dev/packages/device_info_plus).
Permission: `DeviceInfo`.
Information available:
- `id` - Target platform.
- `name` - Name OS.
- `version` - Versions OS.
- `prettyName` - Name and version OS.
- `hasGNSS` - The presence of GNSS in the device.
- `hasNFC` - The presence of NFC in the device.
- `hasBluetooth` - The presence of bluetooth in the device.
- `hasWlan` - The presence of wlan in the device.
- `maxCpuClockSpeed` - Max CPU clock speed.
- `numberCpuCores` - Number CPU cores.
- `batteryChargePercentage` - Device battery charge percentage.
- `mainCameraResolution` - Device main camera resolution.
- `frontalCameraResolution` - Device frontal camera resolution.
- `ramTotalSize` - Size total ram.
- `ramFreeSize` - Size free ram.
- `screenResolution` - Device screen resolution.
- `osVersion` - Name and version OS.
- `deviceModel` - Device name model.
- `internalStorage` - Map with information on internal storage.
- `internalStorage` - Map with information on internal storage.
- `simCards` - Array with information about SIM cards.
## Usage
This package is not an _endorsed_ implementation of `device_info_plus`.
Therefore, you have to include `device_info_plus_aurora` alongside `device_info_plus` as dependencies in your `pubspec.yaml` file.
**pubspec.yaml**
```yaml
dependencies:
device_info_plus: ^9.0.1
device_info_plus_aurora:
path: # path to folder with plugin
```
***.dart**
```dart
import 'package:device_info_plus/device_info_plus.dart';
final deviceInfoPlugin = DeviceInfoPlugin();
final deviceInfo = await deviceInfoPlugin.linuxInfo as AuroraDeviceInfo;
debutPrint(deviceInfo.data);
```

4
packages/device_info_plus/device_info_plus_aurora/analysis_options.yaml

@ -0,0 +1,4 @@
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
include: package:flutter_lints/flutter.yaml

BIN
packages/device_info_plus/device_info_plus_aurora/data/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

59
packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.Features.xml

@ -0,0 +1,59 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="ru.omp.deviceinfo.Features">
<signal name="cameraEnabledChanged">
<arg name="enabled" type="b" direction="out"/>
</signal>
<method name="hasGNSS">
<arg type="b" direction="out"/>
</method>
<method name="hasNFC">
<arg type="b" direction="out"/>
</method>
<method name="hasBluetooth">
<arg type="b" direction="out"/>
</method>
<method name="hasWlan">
<arg type="b" direction="out"/>
</method>
<method name="getMaxCpuClockSpeed">
<arg type="u" direction="out"/>
</method>
<method name="getNumberCpuCores">
<arg type="u" direction="out"/>
</method>
<method name="getCpuModel">
<arg type="s" direction="out"/>
</method>
<method name="getMaxCpuCoresClockSpeed">
<arg type="av" direction="out"/>
</method>
<method name="getBatteryChargePercentage">
<arg type="u" direction="out"/>
</method>
<method name="getMainCameraResolution">
<arg type="d" direction="out"/>
</method>
<method name="getFrontalCameraResolution">
<arg type="d" direction="out"/>
</method>
<method name="getRamTotalSize">
<arg type="t" direction="out"/>
</method>
<method name="getRamFreeSize">
<arg type="t" direction="out"/>
</method>
<method name="getScreenResolution">
<arg type="s" direction="out"/>
</method>
<method name="getOsVersion">
<arg type="s" direction="out"/>
</method>
<method name="getDeviceModel">
<arg type="s" direction="out"/>
</method>
<method name="getSerialNumber">
<arg type="s" direction="out"/>
</method>
</interface>
</node>

21
packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.SIM.xml

@ -0,0 +1,21 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="ru.omp.deviceinfo.SIM">
<signal name="simCardsEnabledChanged">
<arg name="updatedSimCards" type="aa{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/>
</signal>
<signal name="preferredDataTransferSimChanged">
<arg name="updatedSimCards" type="aa{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/>
</signal>
<signal name="preferredVoiceCallSimChanged">
<arg name="updatedSimCards" type="aa{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/>
</signal>
<method name="getSimCardsInfo">
<arg type="aa{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/>
</method>
</interface>
</node>

21
packages/device_info_plus/device_info_plus_aurora/data/ru.omp.deviceinfo.Storages.xml

@ -0,0 +1,21 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="ru.omp.deviceinfo.Storages">
<signal name="externalStorageChanged">
<arg name="updatedStorage" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</signal>
<method name="getInternalStorageInfo">
<arg type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
<method name="getInternalUserPartitionInfo">
<arg type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
<method name="getExternalStorageInfo">
<arg type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
</interface>
</node>

47
packages/device_info_plus/device_info_plus_aurora/example/.gitignore vendored

@ -0,0 +1,47 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
# Aurora generated
/aurora/flutter

21
packages/device_info_plus/device_info_plus_aurora/example/README.md

@ -0,0 +1,21 @@
# device_info_plus_aurora
Demonstrates how to use the device_info_plus plugin.
## Build
```shell
# Add an alias if it doesn't already exist
alias flutter-aurora=$HOME/.local/opt/flutter-sdk/bin/flutter
# Get dependencies
flutter-aurora pub get
# Run build
flutter-aurora build aurora --release # [--release|--debug|--profile]
```
You can collect, sign, run an example on the device with a script located in the `script/build_example.sh`
More information in `build_example.sh`.
### Preview example
![preview.png](../data/preview.png)

4
packages/device_info_plus/device_info_plus_aurora/example/analysis_options.yaml

@ -0,0 +1,4 @@
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
include: package:flutter_lints/flutter.yaml

1
packages/device_info_plus/device_info_plus_aurora/example/aurora/.gitignore vendored

@ -0,0 +1 @@
flutter/ephemeral

50
packages/device_info_plus/device_info_plus_aurora/example/aurora/CMakeLists.txt

@ -0,0 +1,50 @@
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
cmake_minimum_required(VERSION 3.10)
project(com.example.device_info_plus_aurora_example LANGUAGES CXX)
include(GNUInstallDirs)
set(BINARY_NAME ${CMAKE_PROJECT_NAME})
set(FLUTTER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flutter)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../share/${BINARY_NAME}/lib")
find_package(PkgConfig REQUIRED)
pkg_check_modules(FlutterEmbedder REQUIRED IMPORTED_TARGET flutter-embedder)
add_executable(${BINARY_NAME} main.cpp ${FLUTTER_DIR}/generated_plugin_registrant.cpp)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::FlutterEmbedder)
target_include_directories(${BINARY_NAME} PRIVATE ${FLUTTER_DIR})
include(flutter/generated_plugins.cmake)
set(PACKAGE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME})
set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/applications)
set(ICONS_INSTALL_ROOT_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor)
add_custom_command(TARGET ${BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libflutter-embedder.so
${PROJECT_BINARY_DIR}/bundle/lib/libflutter-embedder.so)
install(FILES ${PROJECT_BINARY_DIR}/bundle/icudtl.dat DESTINATION ${PACKAGE_INSTALL_DIR})
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/flutter_assets DESTINATION ${PACKAGE_INSTALL_DIR})
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/lib DESTINATION ${PACKAGE_INSTALL_DIR})
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES desktop/${BINARY_NAME}.desktop DESTINATION ${DESKTOP_INSTALL_DIR})
foreach(ICONS_SIZE 86x86 108x108 128x128 172x172)
install(FILES icons/${ICONS_SIZE}.png
RENAME ${BINARY_NAME}.png
DESTINATION ${ICONS_INSTALL_ROOT_DIR}/${ICONS_SIZE}/apps/)
endforeach(ICONS_SIZE)

12
packages/device_info_plus/device_info_plus_aurora/example/aurora/desktop/com.example.device_info_plus_aurora_example.desktop

@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=device_info_plus_aurora_example
Comment=Demonstrates how to use the device_info_plus_aurora plugin.
Icon=com.example.device_info_plus_aurora_example
Exec=/usr/bin/com.example.device_info_plus_aurora_example
X-Nemo-Application-Type=silica-qt5
[X-Application]
Permissions=DeviceInfo
OrganizationName=com.example
ApplicationName=device_info_plus_aurora_example

BIN
packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/108x108.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/128x128.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/172x172.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
packages/device_info_plus/device_info_plus_aurora/example/aurora/icons/86x86.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

13
packages/device_info_plus/device_info_plus_aurora/example/aurora/main.cpp

@ -0,0 +1,13 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
#include <flutter/application.h>
#include "generated_plugin_registrant.h"
int main(int argc, char *argv[]) {
Application::Initialize(argc, argv);
RegisterPlugins();
Application::Launch();
return 0;
}

31
packages/device_info_plus/device_info_plus_aurora/example/aurora/rpm/com.example.device_info_plus_aurora_example.spec

@ -0,0 +1,31 @@
%global __provides_exclude_from ^%{_datadir}/%{name}/lib/.*$
%global __requires_exclude ^lib(dconf|flutter-embedder|maliit-glib|appmanifest-.+|.+_platform_plugin)\\.so.*$
Name: com.example.device_info_plus_aurora_example
Summary: Demonstrates how to use the device_info_plus_aurora plugin.
Version: 0.1.0
Release: 1
License: Proprietary
Source0: %{name}-%{version}.tar.zst
BuildRequires: cmake
BuildRequires: pkgconfig(flutter-embedder)
%description
%{summary}.
%prep
%autosetup
%build
%cmake -DCMAKE_BUILD_TYPE=%{_flutter_build_type}
%make_build
%install
%make_install
%files
%{_bindir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png

389
packages/device_info_plus/device_info_plus_aurora/example/lib/main.dart

@ -0,0 +1,389 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:device_info_plus_aurora/aurora_device_info.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:device_info_plus/device_info_plus.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String? _error;
String? _id;
String? _name;
String? _version;
String? _prettyName;
bool? _hasGNSS;
bool? _hasNFC;
bool? _hasBluetooth;
bool? _hasWlan;
int? _maxCpuClockSpeed;
int? _numberCpuCores;
int? _batteryChargePercentage;
double? _mainCameraResolution;
double? _frontalCameraResolution;
int? _ramTotalSize;
int? _ramFreeSize;
String? _screenResolution;
String? _osVersion;
String? _deviceModel;
Map<String, dynamic>? _externalStorage;
Map<String, dynamic>? _internalStorage;
List<Map<String, dynamic>>? _simCards;
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
final deviceInfoPlugin = DeviceInfoPlugin();
try {
final deviceInfo = await deviceInfoPlugin.linuxInfo as AuroraDeviceInfo;
setState(() {
_id = deviceInfo.id;
_name = deviceInfo.name;
_version = deviceInfo.version;
_prettyName = deviceInfo.prettyName;
_hasGNSS = deviceInfo.hasGNSS;
_hasNFC = deviceInfo.hasNFC;
_hasBluetooth = deviceInfo.hasBluetooth;
_hasWlan = deviceInfo.hasWlan;
_maxCpuClockSpeed = deviceInfo.maxCpuClockSpeed;
_numberCpuCores = deviceInfo.numberCpuCores;
_batteryChargePercentage = deviceInfo.batteryChargePercentage;
_mainCameraResolution = deviceInfo.mainCameraResolution;
_frontalCameraResolution = deviceInfo.frontalCameraResolution;
_ramTotalSize = deviceInfo.ramTotalSize;
_ramFreeSize = deviceInfo.ramFreeSize;
_screenResolution = deviceInfo.screenResolution;
_osVersion = deviceInfo.osVersion;
_deviceModel = deviceInfo.deviceModel;
_externalStorage = deviceInfo.externalStorage;
_internalStorage = deviceInfo.internalStorage;
_simCards = deviceInfo.simCards;
});
} on Exception catch (e) {
setState(() {
_error = e.toString();
});
}
}
@override
Widget build(BuildContext context) {
const textStyleWhite = TextStyle(fontSize: 18, color: Colors.white);
const textStyleTitle = TextStyle(fontSize: 20, color: Colors.black);
const textStylePath = TextStyle(fontSize: 18, color: Colors.black54);
const spaceMedium = SizedBox(height: 20);
const spaceSmall = SizedBox(height: 10);
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Example device_info_plus'),
),
body: Stack(
children: [
// Error message
Visibility(
visible: _error != null,
child: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Container(
padding: const EdgeInsets.all(20),
decoration: const BoxDecoration(
color: Colors.redAccent,
borderRadius: BorderRadius.all(Radius.circular(10.0)),
),
child: Text(
_error ?? '',
style: textStyleWhite,
),
),
),
),
),
// List directories path
Visibility(
visible: _error == null,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Center(
child: Column(
children: [
// Info
Container(
padding: const EdgeInsets.all(20),
decoration: const BoxDecoration(
color: Colors.green,
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
),
child: const Text(
'Demo application demonstration implementation of device_info_plus',
style: textStyleWhite,
textAlign: TextAlign.center,
),
),
const SizedBox(height: 30),
const Text(
'ID',
style: textStyleTitle,
),
spaceSmall,
Text(
_id.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Name',
style: textStyleTitle,
),
spaceSmall,
Text(
_name.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Version',
style: textStyleTitle,
),
spaceSmall,
Text(
_version.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Pretty Name',
style: textStyleTitle,
),
spaceSmall,
Text(
_prettyName.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Has GNSS',
style: textStyleTitle,
),
spaceSmall,
Text(
_hasGNSS.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Has NFC',
style: textStyleTitle,
),
spaceSmall,
Text(
_hasNFC.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Has Bluetooth',
style: textStyleTitle,
),
spaceSmall,
Text(
_hasBluetooth.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Has Wlan',
style: textStyleTitle,
),
spaceSmall,
Text(
_hasWlan.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Max Cpu Clock Speed',
style: textStyleTitle,
),
spaceSmall,
Text(
_maxCpuClockSpeed.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Number Cpu Cores',
style: textStyleTitle,
),
spaceSmall,
Text(
_numberCpuCores.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Battery Charge Percentage',
style: textStyleTitle,
),
spaceSmall,
Text(
_batteryChargePercentage.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Main Camera Resolution',
style: textStyleTitle,
),
spaceSmall,
Text(
_mainCameraResolution.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Frontal Camera Resolution',
style: textStyleTitle,
),
spaceSmall,
Text(
_frontalCameraResolution.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Ram Total Size',
style: textStyleTitle,
),
spaceSmall,
Text(
_ramTotalSize.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Ram Free Size',
style: textStyleTitle,
),
spaceSmall,
Text(
_ramFreeSize.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Screen Resolution',
style: textStyleTitle,
),
spaceSmall,
Text(
_screenResolution.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'OS Version',
style: textStyleTitle,
),
spaceSmall,
Text(
_osVersion.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Device Model',
style: textStyleTitle,
),
spaceSmall,
Text(
_deviceModel.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'External Storage Info',
style: textStyleTitle,
),
spaceSmall,
Text(
_externalStorage.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'Internal Storage Info',
style: textStyleTitle,
),
spaceSmall,
Text(
_internalStorage.toString(),
style: textStylePath,
),
spaceMedium,
const Text(
'SIM Cards Info',
style: textStyleTitle,
),
spaceSmall,
Text(
_simCards.toString(),
style: textStylePath,
),
],
),
),
),
),
),
],
),
),
);
}
}

257
packages/device_info_plus/device_info_plus_aurora/example/pubspec.lock

@ -0,0 +1,257 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
dbus:
dependency: transitive
description:
name: dbus
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.8"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.2"
device_info_plus_aurora:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.1"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.4"
win32_registry:
dependency: transitive
description:
name: win32_registry
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
sdks:
dart: ">=2.18.6 <3.0.0"
flutter: ">=3.3.0"

26
packages/device_info_plus/device_info_plus_aurora/example/pubspec.yaml

@ -0,0 +1,26 @@
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
name: device_info_plus_aurora_example
description: Demonstrates how to use the device_info_plus_aurora plugin.
publish_to: 'none'
environment:
sdk: '>=2.18.6 <3.0.0'
dependencies:
flutter:
sdk: flutter
device_info_plus: ^9.0.1
device_info_plus_aurora:
path: ../
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true

110
packages/device_info_plus/device_info_plus_aurora/lib/aurora_device_info.dart

@ -0,0 +1,110 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:device_info_plus/device_info_plus.dart';
class AuroraDeviceInfo implements LinuxDeviceInfo {
/// Constructs a AuroraDeviceInfo.
AuroraDeviceInfo({
required this.hasGNSS,
required this.hasNFC,
required this.hasBluetooth,
required this.hasWlan,
required this.maxCpuClockSpeed,
required this.numberCpuCores,
required this.batteryChargePercentage,
required this.mainCameraResolution,
required this.frontalCameraResolution,
required this.ramTotalSize,
required this.ramFreeSize,
required this.screenResolution,
required this.osVersion,
required this.deviceModel,
required this.externalStorage,
required this.internalStorage,
required this.simCards,
});
@override
String get id => 'aurora';
@override
String get name => osVersion.split(' ').first;
@override
String? get version => osVersion.split(' ').last;
@override
String get prettyName => osVersion;
final bool hasGNSS;
final bool hasNFC;
final bool hasBluetooth;
final bool hasWlan;
final int maxCpuClockSpeed;
final int numberCpuCores;
final int batteryChargePercentage;
final double mainCameraResolution;
final double frontalCameraResolution;
final int ramTotalSize;
final int ramFreeSize;
final String screenResolution;
final String osVersion;
final String deviceModel;
final Map<String, dynamic> externalStorage;
final Map<String, dynamic> internalStorage;
final List<Map<String, dynamic>> simCards;
@override
Map<String, dynamic> get data => {
'id': id,
'name': name,
'version': version,
'prettyName': prettyName,
'hasGNSS': hasGNSS,
'hasNFC': hasNFC,
'hasBluetooth': hasBluetooth,
'hasWlan': hasWlan,
'maxCpuClockSpeed': maxCpuClockSpeed,
'numberCpuCores': numberCpuCores,
'batteryChargePercentage': batteryChargePercentage,
'mainCameraResolution': mainCameraResolution,
'frontalCameraResolution': frontalCameraResolution,
'ramTotalSize': ramTotalSize,
'ramFreeSize': ramFreeSize,
'screenResolution': screenResolution,
'osVersion': osVersion,
'deviceModel': deviceModel,
'externalStorage': externalStorage,
'internalStorage': internalStorage,
'simCards': simCards,
};
@override
String? get buildId => null;
@override
List<String>? get idLike => null;
@override
String? get machineId => null;
@override
String? get variant => null;
@override
String? get variantId => null;
@override
String? get versionCodename => null;
@override
String? get versionId => null;
@Deprecated('Use [data] getter instead')
@override
Map<String, dynamic> toMap() {
return data;
}
}

98
packages/device_info_plus/device_info_plus_aurora/lib/device_info_plus_aurora.dart

@ -0,0 +1,98 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:dbus/dbus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_features.dart';
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_sim.dart';
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_storages.dart';
import 'package:device_info_plus_platform_interface/device_info_plus_platform_interface.dart';
import 'package:flutter/foundation.dart';
import 'aurora_device_info.dart';
class DeviceInfoPlusAurora extends DeviceInfoPlatform {
/// Register this dart class as the platform implementation for aurora
static void registerWith() {
if (TargetPlatform.aurora == defaultTargetPlatform) {
DeviceInfoPlatform.instance = DeviceInfoPlusAurora();
} else {
DeviceInfoPlatform.instance = DeviceInfoPlusLinuxPlugin();
}
}
@override
Future<BaseDeviceInfo> deviceInfo() async {
final client = DBusClient.session();
// Features
final features = RuOmpDeviceinfoFeatures(client, 'ru.omp.deviceinfo',
DBusObjectPath('/ru/omp/deviceinfo/Features'));
final hasGNSS = await features.callhasGNSS();
final hasNFC = await features.callhasNFC();
final hasBluetooth = await features.callhasBluetooth();
final hasWlan = await features.callhasWlan();
final maxCpuClockSpeed = await features.callgetMaxCpuClockSpeed();
final numberCpuCores = await features.callgetNumberCpuCores();
final batteryChargePercentage =
await features.callgetBatteryChargePercentage();
final mainCameraResolution = await features.callgetMainCameraResolution();
final frontalCameraResolution =
await features.callgetFrontalCameraResolution();
final ramTotalSize = await features.callgetRamTotalSize();
final ramFreeSize = await features.callgetRamFreeSize();
final screenResolution = await features.callgetScreenResolution();
final osVersion = await features.callgetOsVersion();
final deviceModel = await features.callgetDeviceModel();
// Storages
final storages = RuOmpDeviceinfoStorages(client, 'ru.omp.deviceinfo',
DBusObjectPath('/ru/omp/deviceinfo/Storages'));
final Map<String, dynamic> internalStorage = {};
(await storages.callgetInternalStorageInfo()).forEach((key, value) {
internalStorage[key] = value.toNative();
});
final Map<String, dynamic> externalStorage = {};
(await storages.callgetExternalStorageInfo()).forEach((key, value) {
externalStorage[key] = value.toNative();
});
// SIM
final infoSIM = RuOmpDeviceinfoSIM(
client, 'ru.omp.deviceinfo', DBusObjectPath('/ru/omp/deviceinfo/SIM'));
final List<Map<String, dynamic>> simCards = [];
for (var element in await infoSIM.callgetSimCardsInfo()) {
final Map<String, dynamic> simCard = {};
element.forEach((key, value) {
simCard[key] = value.toNative();
});
simCards.add(simCard);
}
await client.close();
return AuroraDeviceInfo(
hasGNSS: hasGNSS,
hasNFC: hasNFC,
hasBluetooth: hasBluetooth,
hasWlan: hasWlan,
maxCpuClockSpeed: maxCpuClockSpeed,
numberCpuCores: numberCpuCores,
batteryChargePercentage: batteryChargePercentage,
mainCameraResolution: mainCameraResolution,
frontalCameraResolution: frontalCameraResolution,
ramTotalSize: ramTotalSize,
ramFreeSize: ramFreeSize,
screenResolution: screenResolution,
osVersion: osVersion,
deviceModel: deviceModel,
externalStorage: externalStorage,
internalStorage: internalStorage,
simCards: simCards,
);
}
}

237
packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_features.dart

@ -0,0 +1,237 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:dbus/dbus.dart';
/// Signal data for ru.omp.deviceinfo.Features.cameraEnabledChanged.
class RuOmpDeviceinfoFeaturescameraEnabledChanged extends DBusSignal {
bool get enabled => values[0].asBoolean();
RuOmpDeviceinfoFeaturescameraEnabledChanged(DBusSignal signal)
: super(
sender: signal.sender,
path: signal.path,
interface: signal.interface,
name: signal.name,
values: signal.values);
}
class RuOmpDeviceinfoFeatures extends DBusRemoteObject {
/// Stream of ru.omp.deviceinfo.Features.cameraEnabledChanged signals.
late final Stream<RuOmpDeviceinfoFeaturescameraEnabledChanged>
cameraEnabledChanged;
RuOmpDeviceinfoFeatures(
DBusClient client, String destination, DBusObjectPath path)
: super(client, name: destination, path: path) {
cameraEnabledChanged = DBusRemoteObjectSignalStream(
object: this,
interface: 'ru.omp.deviceinfo.Features',
name: 'cameraEnabledChanged',
signature: DBusSignature('b'))
.asBroadcastStream()
.map((signal) => RuOmpDeviceinfoFeaturescameraEnabledChanged(signal));
}
/// Invokes ru.omp.deviceinfo.Features.hasGNSS()
Future<bool> callhasGNSS(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasGNSS', [],
replySignature: DBusSignature('b'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asBoolean();
}
/// Invokes ru.omp.deviceinfo.Features.hasNFC()
Future<bool> callhasNFC(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasNFC', [],
replySignature: DBusSignature('b'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asBoolean();
}
/// Invokes ru.omp.deviceinfo.Features.hasBluetooth()
Future<bool> callhasBluetooth(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'hasBluetooth', [],
replySignature: DBusSignature('b'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asBoolean();
}
/// Invokes ru.omp.deviceinfo.Features.hasWlan()
Future<bool> callhasWlan(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasWlan', [],
replySignature: DBusSignature('b'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asBoolean();
}
/// Invokes ru.omp.deviceinfo.Features.getMaxCpuClockSpeed()
Future<int> callgetMaxCpuClockSpeed(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getMaxCpuClockSpeed', [],
replySignature: DBusSignature('u'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asUint32();
}
/// Invokes ru.omp.deviceinfo.Features.getNumberCpuCores()
Future<int> callgetNumberCpuCores(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getNumberCpuCores', [],
replySignature: DBusSignature('u'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asUint32();
}
/// Invokes ru.omp.deviceinfo.Features.getCpuModel()
Future<String> callgetCpuModel(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getCpuModel', [],
replySignature: DBusSignature('s'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asString();
}
/// Invokes ru.omp.deviceinfo.Features.getMaxCpuCoresClockSpeed()
Future<List<DBusValue>> callgetMaxCpuCoresClockSpeed(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getMaxCpuCoresClockSpeed', [],
replySignature: DBusSignature('av'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asVariantArray().toList();
}
/// Invokes ru.omp.deviceinfo.Features.getBatteryChargePercentage()
Future<int> callgetBatteryChargePercentage(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getBatteryChargePercentage', [],
replySignature: DBusSignature('u'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asUint32();
}
/// Invokes ru.omp.deviceinfo.Features.getMainCameraResolution()
Future<double> callgetMainCameraResolution(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getMainCameraResolution', [],
replySignature: DBusSignature('d'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asDouble();
}
/// Invokes ru.omp.deviceinfo.Features.getFrontalCameraResolution()
Future<double> callgetFrontalCameraResolution(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getFrontalCameraResolution', [],
replySignature: DBusSignature('d'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asDouble();
}
/// Invokes ru.omp.deviceinfo.Features.getRamTotalSize()
Future<int> callgetRamTotalSize(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getRamTotalSize', [],
replySignature: DBusSignature('t'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asUint64();
}
/// Invokes ru.omp.deviceinfo.Features.getRamFreeSize()
Future<int> callgetRamFreeSize(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getRamFreeSize', [],
replySignature: DBusSignature('t'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asUint64();
}
/// Invokes ru.omp.deviceinfo.Features.getScreenResolution()
Future<String> callgetScreenResolution(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getScreenResolution', [],
replySignature: DBusSignature('s'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asString();
}
/// Invokes ru.omp.deviceinfo.Features.getOsVersion()
Future<String> callgetOsVersion(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getOsVersion', [],
replySignature: DBusSignature('s'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asString();
}
/// Invokes ru.omp.deviceinfo.Features.getDeviceModel()
Future<String> callgetDeviceModel(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getDeviceModel', [],
replySignature: DBusSignature('s'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asString();
}
/// Invokes ru.omp.deviceinfo.Features.getSerialNumber()
Future<String> callgetSerialNumber(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Features', 'getSerialNumber', [],
replySignature: DBusSignature('s'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asString();
}
}

105
packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_sim.dart

@ -0,0 +1,105 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:dbus/dbus.dart';
/// Signal data for ru.omp.deviceinfo.SIM.simCardsEnabledChanged.
class RuOmpDeviceinfoSIMsimCardsEnabledChanged extends DBusSignal {
List<Map<String, DBusValue>> get updatedSimCards =>
values[0].asArray().map((child) => child.asStringVariantDict()).toList();
RuOmpDeviceinfoSIMsimCardsEnabledChanged(DBusSignal signal)
: super(
sender: signal.sender,
path: signal.path,
interface: signal.interface,
name: signal.name,
values: signal.values);
}
/// Signal data for ru.omp.deviceinfo.SIM.preferredDataTransferSimChanged.
class RuOmpDeviceinfoSIMpreferredDataTransferSimChanged extends DBusSignal {
List<Map<String, DBusValue>> get updatedSimCards =>
values[0].asArray().map((child) => child.asStringVariantDict()).toList();
RuOmpDeviceinfoSIMpreferredDataTransferSimChanged(DBusSignal signal)
: super(
sender: signal.sender,
path: signal.path,
interface: signal.interface,
name: signal.name,
values: signal.values);
}
/// Signal data for ru.omp.deviceinfo.SIM.preferredVoiceCallSimChanged.
class RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged extends DBusSignal {
List<Map<String, DBusValue>> get updatedSimCards =>
values[0].asArray().map((child) => child.asStringVariantDict()).toList();
RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged(DBusSignal signal)
: super(
sender: signal.sender,
path: signal.path,
interface: signal.interface,
name: signal.name,
values: signal.values);
}
class RuOmpDeviceinfoSIM extends DBusRemoteObject {
/// Stream of ru.omp.deviceinfo.SIM.simCardsEnabledChanged signals.
late final Stream<RuOmpDeviceinfoSIMsimCardsEnabledChanged>
simCardsEnabledChanged;
/// Stream of ru.omp.deviceinfo.SIM.preferredDataTransferSimChanged signals.
late final Stream<RuOmpDeviceinfoSIMpreferredDataTransferSimChanged>
preferredDataTransferSimChanged;
/// Stream of ru.omp.deviceinfo.SIM.preferredVoiceCallSimChanged signals.
late final Stream<RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged>
preferredVoiceCallSimChanged;
RuOmpDeviceinfoSIM(DBusClient client, String destination, DBusObjectPath path)
: super(client, name: destination, path: path) {
simCardsEnabledChanged = DBusRemoteObjectSignalStream(
object: this,
interface: 'ru.omp.deviceinfo.SIM',
name: 'simCardsEnabledChanged',
signature: DBusSignature('aa{sv}'))
.asBroadcastStream()
.map((signal) => RuOmpDeviceinfoSIMsimCardsEnabledChanged(signal));
preferredDataTransferSimChanged = DBusRemoteObjectSignalStream(
object: this,
interface: 'ru.omp.deviceinfo.SIM',
name: 'preferredDataTransferSimChanged',
signature: DBusSignature('aa{sv}'))
.asBroadcastStream()
.map((signal) =>
RuOmpDeviceinfoSIMpreferredDataTransferSimChanged(signal));
preferredVoiceCallSimChanged = DBusRemoteObjectSignalStream(
object: this,
interface: 'ru.omp.deviceinfo.SIM',
name: 'preferredVoiceCallSimChanged',
signature: DBusSignature('aa{sv}'))
.asBroadcastStream()
.map(
(signal) => RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged(signal));
}
/// Invokes ru.omp.deviceinfo.SIM.getSimCardsInfo()
Future<List<Map<String, DBusValue>>> callgetSimCardsInfo(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.SIM', 'getSimCardsInfo', [],
replySignature: DBusSignature('aa{sv}'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0]
.asArray()
.map((child) => child.asStringVariantDict())
.toList();
}
}

72
packages/device_info_plus/device_info_plus_aurora/lib/ru_omp_deviceinfo_storages.dart

@ -0,0 +1,72 @@
/*
* Copyright (c) 2023. Open Mobile Platform LLC.
* License: Proprietary.
*/
import 'package:dbus/dbus.dart';
/// Signal data for ru.omp.deviceinfo.Storages.externalStorageChanged.
class RuOmpDeviceinfoStoragesexternalStorageChanged extends DBusSignal {
Map<String, DBusValue> get updatedStorage => values[0].asStringVariantDict();
RuOmpDeviceinfoStoragesexternalStorageChanged(DBusSignal signal)
: super(
sender: signal.sender,
path: signal.path,
interface: signal.interface,
name: signal.name,
values: signal.values);
}
class RuOmpDeviceinfoStorages extends DBusRemoteObject {
/// Stream of ru.omp.deviceinfo.Storages.externalStorageChanged signals.
late final Stream<RuOmpDeviceinfoStoragesexternalStorageChanged>
externalStorageChanged;
RuOmpDeviceinfoStorages(
DBusClient client, String destination, DBusObjectPath path)
: super(client, name: destination, path: path) {
externalStorageChanged = DBusRemoteObjectSignalStream(
object: this,
interface: 'ru.omp.deviceinfo.Storages',
name: 'externalStorageChanged',
signature: DBusSignature('a{sv}'))
.asBroadcastStream()
.map((signal) => RuOmpDeviceinfoStoragesexternalStorageChanged(signal));
}
/// Invokes ru.omp.deviceinfo.Storages.getInternalStorageInfo()
Future<Map<String, DBusValue>> callgetInternalStorageInfo(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Storages', 'getInternalStorageInfo', [],
replySignature: DBusSignature('a{sv}'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asStringVariantDict();
}
/// Invokes ru.omp.deviceinfo.Storages.getInternalUserPartitionInfo()
Future<Map<String, DBusValue>> callgetInternalUserPartitionInfo(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Storages', 'getInternalUserPartitionInfo', [],
replySignature: DBusSignature('a{sv}'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asStringVariantDict();
}
/// Invokes ru.omp.deviceinfo.Storages.getExternalStorageInfo()
Future<Map<String, DBusValue>> callgetExternalStorageInfo(
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
var result = await callMethod(
'ru.omp.deviceinfo.Storages', 'getExternalStorageInfo', [],
replySignature: DBusSignature('a{sv}'),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
return result.returnValues[0].asStringVariantDict();
}
}

29
packages/device_info_plus/device_info_plus_aurora/pubspec.yaml

@ -0,0 +1,29 @@
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
name: device_info_plus_aurora
description: The Aurora OS implementation of flutter_local_notifications.
version: 0.0.1
environment:
sdk: '>=2.18.6 <3.0.0'
flutter: ">=2.5.0"
dependencies:
flutter:
sdk: flutter
dbus: ^0.7.8
device_info_plus: ^9.0.1
plugin_platform_interface: ^2.0.2
device_info_plus_platform_interface: ^7.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
plugin:
platforms:
aurora:
dartPluginClass: DeviceInfoPlusAurora
Loading…
Cancel
Save