Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 652c425a authored by Peter_Liang's avatar Peter_Liang Committed by PETER LIANG
Browse files

Fixing the crash when tapping the "Downloaded apps" in Accessibility page.

Root cause:
When Accessibility settings parse the application which is from google
play store, the settings have no check if the resource is valid before
delivery the parameter into the corresponding fragment.

Solution:
Check if the resource is valid before creating the image uri.

Bug: 190716289
Test: manual test
Change-Id: I56eba2232ddf6ed5b2e526d4698479465a012e52
parent d2c4944c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -78,10 +78,12 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
        // Settings animated image.
        final int animatedImageRes = arguments.getInt(
                AccessibilitySettings.EXTRA_ANIMATED_IMAGE_RES);
        if (animatedImageRes > 0) {
            mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
                    .authority(mComponentName.getPackageName())
                    .appendPath(String.valueOf(animatedImageRes))
                    .build();
        }

        // Settings html description.
        mHtmlDescription = arguments.getCharSequence(AccessibilitySettings.EXTRA_HTML_DESCRIPTION);
+6 −4
Original line number Diff line number Diff line
@@ -396,10 +396,12 @@ public class ToggleAccessibilityServicePreferenceFragment extends
        // Settings animated image.
        final int animatedImageRes = arguments.getInt(
                AccessibilitySettings.EXTRA_ANIMATED_IMAGE_RES);
        if (animatedImageRes > 0) {
            mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
                    .authority(mComponentName.getPackageName())
                    .appendPath(String.valueOf(animatedImageRes))
                    .build();
        }

        // Get Accessibility service name.
        mPackageName = getAccessibilityServiceInfo().getResolveInfo().loadLabel(