-
-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Port ignore battery optimizations (Android) (#1212)
* Port Android `Manifest.permission` and `Manifest.permission_group` (#1196) * Port `Manifest.permission` and `Manifest.permission_group` * Use Dart conventions for `Manifest` variables * Implement `checkPermissionStatus` * Change entry point of getting an `Activity`, implement `requestPermission` * Expose `requestCode` * Update tests * Update main.dart * Update CHANGELOG.md * Elaborate on concern * Replace `AndroidActivity` with `ActivityAware` * Delete test * Apply small fixes * Elaborate on missing Android activity * Regenerate pigeon files * Make small adjustments based on review * Update documentation * Update documentation * Implement `Settings` mirror * Implement `Uri` mirror * Add `Intent` constructor and update `Uri` implementation * Implement `Intent` methods * Implement `startActivity`, `getPackageName` for `Context` * Copy new `Context` methods to `Activity` * Implement `openAppSettings` in `PermissionHandlerAndroid` * Follow-up changes * Run `dart format .` * Add `startActivityForResult` * Add actions to `Settings` * Update TODOs * Run `dart format .` * Implement `getSystemService` * Add `Build` * Implement `PowerManager` * Fix bug with `PowerManager`, update `PermissionHandlerAndroid` * Run `dart format .` * Add sdk check to `isIgnoringBatteryOptimizations`
- Loading branch information
1 parent
8e4488b
commit b1bf5fc
Showing
19 changed files
with
1,680 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...android/android/src/main/java/com/baseflow/permissionhandler/BuildVersionHostApiImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.baseflow.permissionhandler; | ||
|
||
import android.os.Build; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.baseflow.permissionhandler.PermissionHandlerPigeon.BuildVersionHostApi; | ||
|
||
/** | ||
* Host API implementation for `Build.VERSION`. | ||
* | ||
* <p>This class may handle instantiating and adding native object instances that are attached to a | ||
* Dart instance or handle method calls on the associated native class or an instance of the class. | ||
*/ | ||
public class BuildVersionHostApiImpl implements BuildVersionHostApi { | ||
@NonNull | ||
@Override | ||
public Long sdkInt() { | ||
return (long) Build.VERSION.SDK_INT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.