i am trying to call MIUI system activity by this code:
val intent = Intent()
intent.setClassName("com.miui.powerkeeper", "com.miui.powerkeeper.ui.HiddenAppsConfigActivity")
intent.putExtra("package_name", activity.packageName)
intent.putExtra("package_label", getText(R.string.app_name))
startActivity(intent)
Before Android 13 everything works fine, but on Android 13 I catch an error:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.miui.powerkeeper/com.miui.powerkeeper.ui.HiddenAppsConfigActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
Tried to add default intent-filter, but it never helps:
<activity android:name="com.miui.powerkeeper.ui.HiddenAppsConfigActivity"
android:exported="true">
<intent-filter>
<action android:name="foo" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
How to define external intent-filter?
The problem was that I determined the presence of the MIUI firmware like this:
But the bug was reproduced on the magnificent Redmi A2+, which has the firmware Android 13 (Go).
These firmwares do not have proprietary MIUI applications installed and that's why I couldn't run them.
As a result, to solve the problem, you need to change the firmware identification to this:
And resolve method: