diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-04 12:38:19 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-04 12:38:19 +0530 |
| commit | a9550c3a5088b8e25257480fb86ff5c9a2fed6d7 (patch) | |
| tree | b6e8d248a25f1ea74ca8428bdf9eb146397775de | |
| parent | 173cb600667e730c337a436c9407d5b268491e9c (diff) | |
| download | daft-launcher-a9550c3a5088b8e25257480fb86ff5c9a2fed6d7.tar.gz daft-launcher-a9550c3a5088b8e25257480fb86ff5c9a2fed6d7.zip | |
Fixes uninstall action
| -rw-r--r-- | android/app/src/main/AndroidManifest.xml | 6 | ||||
| -rw-r--r-- | lib/components/AppContextMenu.dart | 4 | ||||
| -rw-r--r-- | lib/pages/Apps.dart | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3eb3424..a8c7113 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,13 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" package="io.github.phenax.owyn"> <!-- io.flutter.app.FlutterApplication is an android.app.Application that calls FlutterMain.startInitialization(this); in its onCreate method. In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" /> + <uses-permission android:name="android.permission.DELETE_PACKAGES" tools:ignore="ProtectedPermissions" /> + <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/> <application android:name="io.flutter.app.FlutterApplication" android:label="Owyn launcher" @@ -36,8 +38,6 @@ /> <intent-filter> <action android:name="android.intent.action.MAIN"/> - <action android:name="android.intent.action.DELETE" /> - <action android:name="android.intent.action.UNINSTALL_PACKAGE" /> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> diff --git a/lib/components/AppContextMenu.dart b/lib/components/AppContextMenu.dart index 4dcc93a..ae42bd4 100644 --- a/lib/components/AppContextMenu.dart +++ b/lib/components/AppContextMenu.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:device_apps/device_apps.dart'; import 'package:android_intent/android_intent.dart'; +import 'package:android_intent/flag.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../data/favorites.dart'; @@ -57,9 +58,8 @@ class AppContextMenu extends StatelessWidget { ).launch(); }), Option(child: Text('Uninstall'), onTap: () async { - // FIXME: Doesn't work await AndroidIntent( - action: 'action_delete', + action: 'android.intent.action.DELETE', data: 'package:${app.packageName}', ).launch(); }), diff --git a/lib/pages/Apps.dart b/lib/pages/Apps.dart index 613b0e3..97d2dbc 100644 --- a/lib/pages/Apps.dart +++ b/lib/pages/Apps.dart @@ -15,6 +15,7 @@ class AppsView extends StatelessWidget { Future<List<Application>> appListF = DeviceApps.getInstalledApplications( includeSystemApps: true, onlyAppsWithLaunchIntent: true, + includeAppIcons: false, ); @override |
