From c7be4f9a4aace3d7187283923104d66c6a4d228e Mon Sep 17 00:00:00 2001 From: Remon Date: Fri, 18 Oct 2024 15:16:00 +0100 Subject: [PATCH] feat: add support to open sim profile settings --- .../plus/androidintent/MethodCallHandlerImpl.java | 2 ++ packages/android_intent_plus/example/lib/main.dart | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/android_intent_plus/android/src/main/java/dev/fluttercommunity/plus/androidintent/MethodCallHandlerImpl.java b/packages/android_intent_plus/android/src/main/java/dev/fluttercommunity/plus/androidintent/MethodCallHandlerImpl.java index 0cd0a0765f..f998cd0101 100644 --- a/packages/android_intent_plus/android/src/main/java/dev/fluttercommunity/plus/androidintent/MethodCallHandlerImpl.java +++ b/packages/android_intent_plus/android/src/main/java/dev/fluttercommunity/plus/androidintent/MethodCallHandlerImpl.java @@ -142,6 +142,8 @@ private static String convertAction(String action) { return Settings.ACTION_LOCATION_SOURCE_SETTINGS; case "action_application_details_settings": return Settings.ACTION_APPLICATION_DETAILS_SETTINGS; + case "action_manage_all_sim_profiles_settings": + return Settings.ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS; default: return action; } diff --git a/packages/android_intent_plus/example/lib/main.dart b/packages/android_intent_plus/example/lib/main.dart index ce48c1305c..7acb57cece 100644 --- a/packages/android_intent_plus/example/lib/main.dart +++ b/packages/android_intent_plus/example/lib/main.dart @@ -194,6 +194,13 @@ class ExplicitIntentsWidget extends StatelessWidget { intent.launch(); } + void _openSimSettings() { + const AndroidIntent intent = AndroidIntent( + action: 'action_manage_all_sim_profiles_settings', + ); + intent.launch(); + } + void _openApplicationDetails() { const intent = AndroidIntent( action: 'action_application_details_settings', @@ -304,6 +311,11 @@ class ExplicitIntentsWidget extends StatelessWidget { 'Tap here to open gmail app with details', ), ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () => _openSimSettings(), + child: const Text('Tap here to open sim profiles.'), + ), ], ), ),