Skip to content

Commit b177b0a

Browse files
authored
Merge branch 'audiostreamer-dev' into feature/fix-microphone-in-use-crash
2 parents 8e8b5e4 + 3e646eb commit b177b0a

197 files changed

Lines changed: 10009 additions & 2663 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
4+
#
5+
# Source repository: https://github.com/actions/dependency-review-action
6+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
7+
name: 'Dependency Review'
8+
on: [pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
dependency-review:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Checkout Repository'
18+
uses: actions/checkout@v3
19+
- name: 'Dependency Review'
20+
uses: actions/dependency-review-action@v1

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,6 @@ app.*.symbols
116116
!**/ios/**/default.pbxuser
117117
!**/ios/**/default.perspectivev3
118118
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
119-
!/dev/ci/**/Gemfile.lock
119+
!/dev/ci/**/Gemfile.lock
120+
packages/app_usage/example/.flutter-plugins-dependencies
121+
packages/app_usage/example/.flutter-plugins-dependencies

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These are the available plugins in this repository.
2020
| [weather](./packages/weather) | Get current weather, as well as forecasting using the OpenWeatherMap API. | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/weather.svg)](https://pub.dartlang.org/packages/weather) |
2121
| [air_quality](./packages/air_quality) | Get the air quality index using the WAQI API. | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/air_quality.svg)](https://pub.dartlang.org/packages/air_quality) |
2222
| [notifications](./packages/notifications) | Track device notifications. | ✔️ || [![pub package](https://img.shields.io/pub/v/notifications.svg)](https://pub.dartlang.org/packages/notifications) |
23-
| [movisens_flutter](./packages/movisens_flutter) | Movisens sensor communication. | ✔️ | | [![pub package](https://img.shields.io/pub/v/movisens_flutter.svg)](https://pub.dartlang.org/packages/movisens_flutter) |
23+
| [movisens_flutter](./packages/movisens_flutter) | Movisens sensor communication. | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/movisens_flutter.svg)](https://pub.dartlang.org/packages/movisens_flutter) |
2424
| [esense_flutter](./packages/esense_flutter) | eSense ear sensor plugin. | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/esense_flutter.svg)](https://pub.dartlang.org/packages/esense_flutter) |
2525
| [health](./packages/health) | Apple HealthKit and Google Fit interface plugin. | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/health.svg)](https://pub.dartlang.org/packages/health) |
2626
| [activity_recognition](./packages/activity_recognition_flutter) | Activity Recognition | ✔️ | ✔️ | [![pub package](https://img.shields.io/pub/v/activity_recognition_flutter.svg)](https://pub.dartlang.org/packages/activity_recognition_flutter) |

docs/_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.packages
30+
build/

packages/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled.
5+
6+
version:
7+
revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
8+
channel: stable
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
17+
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
18+
- platform: android
19+
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
20+
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

packages/app_usage/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 2.1.1
2+
3+
- check of Android OS version added when getting `lastForeground`.
4+
5+
## 2.1.0
6+
7+
- Addition of `lastForeground` information - when was the app last time in the foreground.
8+
- update of example app to AndroidX and new gradle build version.
9+
- update of documentation.
10+
111
## 2.0.0
212

313
- Migration to null safety

packages/app_usage/LICENSE

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
MIT License
1+
MIT License.
22

3-
Copyright (c) 2018 thomasnilsson
3+
Copyright 2018-2022 Copenhagen Center for Health Technology (CACHET) at the Technical University of Denmark (DTU).
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6+
documentation files (the ”Software”), to deal in the Software without restriction, including without limitation
7+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
8+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
119

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
10+
The above copyright notice and this permission notice shall be included in all copies or substantial
11+
portions of the Software.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
13+
THE SOFTWARE IS PROVIDED ”AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
14+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
16+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS

packages/app_usage/README.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# app_usage
1+
# App Usage
22

33
[![pub package](https://img.shields.io/pub/v/app_usage.svg)](https://pub.dartlang.org/packages/app_usage)
44

5-
Application usage stats for Android only. Note that the stats are only precise down to a daily basis. This is a limitation from Google's implementation, unfortunately.
5+
Application usage stats for Android only. Note that the stats are only precise down to a daily basis. This is a limitation from Google's implementation.
6+
67
## Install
7-
Add ```app_usage``` as a dependency in `pubspec.yaml`.
8+
9+
Add `app_usage` as a dependency in `pubspec.yaml`.
810
For help on adding as a dependency, view the [documentation](https://flutter.io/using-packages/).
911

1012
## Android
11-
*NB: Requires API level 21 as a minimum!*
13+
14+
> **Note:** Requires API level 21 as a minimum.
1215
1316
I.e. you need to set the min SDK version inside the `android/app/build.gradle`:
1417

@@ -17,19 +20,21 @@ minSdkVersion 21
1720
```
1821

1922
You need to add the following package to the manifest namespace in `AndroidManifest.xml`:
23+
2024
```xml
2125
xmlns:tools="http://schemas.android.com/tools"
2226
```
2327

2428
as well as the following permissions to the manifest:
2529

26-
```
30+
```xml
2731
<uses-permission
2832
android:name="android.permission.PACKAGE_USAGE_STATS"
2933
tools:ignore="ProtectedPermissions" />
3034
```
3135

3236
Below is an example of how the start of your manifest should look in the end
37+
3338
```xml
3439
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3540
package="YOUR_PACKAGE_NAME_HERE"
@@ -41,15 +46,27 @@ Below is an example of how the start of your manifest should look in the end
4146
```
4247

4348
## Usage
49+
50+
The `AppUsage` class works as a singleton and you get app usage statistics by calling:
51+
52+
```dart
53+
AppUsage().getAppUsage(startDate, endDate)
54+
````
55+
56+
A larger example (from the example app) could look like:
57+
4458
```dart
4559
void getUsageStats() async {
4660
try {
47-
DateTime startDate = DateTime(2018, 01, 01);
48-
DateTime endDate = new DateTime.now();
49-
List<AppUsageInfo> infos = await AppUsage.getAppUsage(startDate, endDate);
50-
setState(() {
51-
_infos = infos;
52-
});
61+
DateTime endDate = DateTime.now();
62+
DateTime startDate = endDate.subtract(Duration(hours: 1));
63+
List<AppUsageInfo> infoList =
64+
await AppUsage().getAppUsage(startDate, endDate);
65+
setState(() => _infos = infoList);
66+
67+
for (var info in infoList) {
68+
print(info.toString());
69+
}
5370
} on AppUsageException catch (exception) {
5471
print(exception);
5572
}
@@ -60,23 +77,28 @@ Each `AppUsageInfo` object has the following public fields:
6077

6178
```dart
6279
/// The name of the application
63-
String get appName;
80+
String get appName => _appName;
6481
6582
/// The name of the application package
66-
String get packageName;
83+
String get packageName => _packageName;
6784
6885
/// The amount of time the application has been used
6986
/// in the specified interval
70-
Duration get usage;
87+
Duration get usage => _usage;
7188
7289
/// The start of the interval
73-
DateTime get startDate;
90+
DateTime get startDate => _startDate;
7491
7592
/// The end of the interval
76-
DateTime get endDate;
93+
DateTime get endDate => _endDate;
94+
95+
/// Last time app was in foreground
96+
DateTime get lastForeground => _lastForeground;
97+
7798
```
7899

100+
## Example app
101+
102+
The example app shows how to use the plugin.
79103

80-
## Example screenshot
81-
The first screen will ask for permission to view usage stats. Tap on your application.
82-
![Screenshot](https://raw.githubusercontent.com/cph-cachet/flutter-plugins/master/packages/app_usage/images/app_usage_screenshot.png)
104+
The first screen will ask for permission to view usage stats. Tap on your application and allow it to access usage information. Then you can "download" app usage stats by pressing the arrow button.

0 commit comments

Comments
 (0)