Declare activities for factory reset pages

When trying to trigger factory reset from Settings app, it's unexpected
that Settings will get a fatal ActivityNotFoundException, causing
Settings crash. The factory reset pages have changed their launching
way from by SubSettingsLauncher to by startActivity directly. These
activities haven't been declared in AndroidManifest.xml, which caused
this issue.

Fixes: 182144129
Test: rebuild and manual
1) Flash the device with aosp build
2) Navigate to Reset options (Settings -> System -> Reset options)
3) Observe and check if Settings gets crashed

Change-Id: Ia99f269e237d7c84153d4b903cbca14c33835dc1
This commit is contained in:
Mill Chen
2021-03-11 01:18:13 +08:00
parent f760ea0639
commit 0023100e7f

View File

@@ -3751,6 +3751,25 @@
android:launchMode="singleTask"> android:launchMode="singleTask">
</activity> </activity>
<activity android:name="Settings$FactoryResetActivity"
android:permission="android.permission.BACKUP"
android:label="@string/main_clear_title"
android:exported="true"
android:theme="@style/SudThemeGlif.Light">
<intent-filter>
<action android:name="com.android.settings.action.FACTORY_RESET"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.MainClear"/>
</activity>
<activity android:name="Settings$FactoryResetConfirmActivity"
android:label="@string/main_clear_confirm_title"
android:exported="false"
android:theme="@style/SudThemeGlif.Light">
</activity>
<!-- This is the longest AndroidManifest.xml ever. --> <!-- This is the longest AndroidManifest.xml ever. -->
</application> </application>
</manifest> </manifest>