From 78e3ce26c674e2c8b5a5f38d63bd60f0c65106bb Mon Sep 17 00:00:00 2001
From: Qt Support <support@qt.io>
Date: Tue, 9 Jul 2024 11:31:22 +0800
Subject: [PATCH] Remove ministro code

Since Ministro no longer work on recent Android versions (Android 8+),
and it hasn't been maintained and the repos are not updated, the
existing code is practically a dead code.

[ChangeLog][Android] Remove ministro code since it's been unmaintained
and not working with recent Android versions.

Task-number: QTBUG-85201
(cherry picked from commit af6bc5a21bbef6a5870f8e49c2cc70c53d4fa352)

Change-Id: I34a7096816c00104882e3617d04e6756f452f878
---
 .../androidextras/customactivity/android/AndroidManifest.xml   | 2 --
 .../androidextras/jnimessenger/android/AndroidManifest.xml     | 2 --
 examples/androidextras/musiclist/android/AndroidManifest.xml   | 2 --
 .../androidextras/notification/android/AndroidManifest.xml     | 2 --
 .../services/servicebinder/android/AndroidManifest.xml         | 2 --
 .../services/servicebroadcast/android/AndroidManifest.xml      | 2 --
 .../servicebroadcastsamelib/android/AndroidManifest.xml        | 2 --
 .../services/serviceremoteobjects/android/AndroidManifest.xml  | 2 --
 .../serviceremoteobjectssamelib/android/AndroidManifest.xml    | 2 --
 .../services/servicesameprocess/android/AndroidManifest.xml    | 2 --
 src/androidextras/android/qandroidactivityresultreceiver.cpp   | 3 ---
 11 files changed, 23 deletions(-)

diff --git a/examples/androidextras/customactivity/android/AndroidManifest.xml b/examples/androidextras/customactivity/android/AndroidManifest.xml
index c78a9f4785..b8d4fe4545 100644
--- a/examples/androidextras/customactivity/android/AndroidManifest.xml
+++ b/examples/androidextras/customactivity/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/jnimessenger/android/AndroidManifest.xml b/examples/androidextras/jnimessenger/android/AndroidManifest.xml
index 56617c4230..37c753321d 100644
--- a/examples/androidextras/jnimessenger/android/AndroidManifest.xml
+++ b/examples/androidextras/jnimessenger/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/musiclist/android/AndroidManifest.xml b/examples/androidextras/musiclist/android/AndroidManifest.xml
index 051fbaa72d..427c2e61bc 100644
--- a/examples/androidextras/musiclist/android/AndroidManifest.xml
+++ b/examples/androidextras/musiclist/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/notification/android/AndroidManifest.xml b/examples/androidextras/notification/android/AndroidManifest.xml
index 903db5b243..c2a1f5f8c1 100644
--- a/examples/androidextras/notification/android/AndroidManifest.xml
+++ b/examples/androidextras/notification/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/servicebinder/android/AndroidManifest.xml b/examples/androidextras/services/servicebinder/android/AndroidManifest.xml
index 3326e963d3..98de4260f1 100644
--- a/examples/androidextras/services/servicebinder/android/AndroidManifest.xml
+++ b/examples/androidextras/services/servicebinder/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/servicebroadcast/android/AndroidManifest.xml b/examples/androidextras/services/servicebroadcast/android/AndroidManifest.xml
index e0736af7c6..ee1a675a08 100644
--- a/examples/androidextras/services/servicebroadcast/android/AndroidManifest.xml
+++ b/examples/androidextras/services/servicebroadcast/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/servicebroadcastsamelib/android/AndroidManifest.xml b/examples/androidextras/services/servicebroadcastsamelib/android/AndroidManifest.xml
index 65f71b6b62..c903e8c59c 100644
--- a/examples/androidextras/services/servicebroadcastsamelib/android/AndroidManifest.xml
+++ b/examples/androidextras/services/servicebroadcastsamelib/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/serviceremoteobjects/android/AndroidManifest.xml b/examples/androidextras/services/serviceremoteobjects/android/AndroidManifest.xml
index 78940458f6..e8a5820c67 100644
--- a/examples/androidextras/services/serviceremoteobjects/android/AndroidManifest.xml
+++ b/examples/androidextras/services/serviceremoteobjects/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/serviceremoteobjectssamelib/android/AndroidManifest.xml b/examples/androidextras/services/serviceremoteobjectssamelib/android/AndroidManifest.xml
index daca3a6aaa..03fe644767 100644
--- a/examples/androidextras/services/serviceremoteobjectssamelib/android/AndroidManifest.xml
+++ b/examples/androidextras/services/serviceremoteobjectssamelib/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/examples/androidextras/services/servicesameprocess/android/AndroidManifest.xml b/examples/androidextras/services/servicesameprocess/android/AndroidManifest.xml
index e9b0017646..bdbf52b0ff 100644
--- a/examples/androidextras/services/servicesameprocess/android/AndroidManifest.xml
+++ b/examples/androidextras/services/servicesameprocess/android/AndroidManifest.xml
@@ -40,8 +40,6 @@
             <!-- Used to specify custom system library path to run with local system libs -->
             <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
             <!--  Messages maps -->
-            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
-            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
             <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
             <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/>
             <!--  Messages maps -->
diff --git a/src/androidextras/android/qandroidactivityresultreceiver.cpp b/src/androidextras/android/qandroidactivityresultreceiver.cpp
index f1caa27989..4a7018c90c 100644
--- a/src/androidextras/android/qandroidactivityresultreceiver.cpp
+++ b/src/androidextras/android/qandroidactivityresultreceiver.cpp
@@ -52,9 +52,6 @@ static int uniqueActivityRequestCode()
     static int requestCode = 0x1000; // Reserve all request codes under 0x1000 for Qt.
 
     QMutexLocker locker(&mutex);
-    if (requestCode == 0xf3ee) // Special case for MINISTRO_INSTALL_REQUEST_CODE
-        requestCode++;
-
     if (requestCode == INT_MAX)
         qWarning("Unique activity request code has wrapped. Unexpected behavior may occur.");
 
-- 
2.45.2.windows.1

