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

Commit d1531417 authored by YuanQY's avatar YuanQY
Browse files

CMFileManager: Fix crash when select CMFileManager internal editor to open text file.

    When open a text file, in the choose application to open and select
the CMFileManager internal editor to open, the CMFileManager will crash.
Because the ri.filter is null.

    Patch Set 2:
        Implement the logical as Jorge Ruesga suggestion. Check it's interneal editor
    before to process system association.

    Patch Set 3:
        Add the ri.filter valid check before to process system association.

Change-Id: I2d9698d9cb862de2b1141e84bc2f540e4ced92e6
parent 8dc8c051
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ public class AssociationsDialog implements OnItemClickListener {
     */
    @SuppressWarnings({"deprecation"})
    void onIntentSelected(ResolveInfo ri, Intent intent, boolean remember) {
        if (remember) {
        if (remember && !isInternalEditor(ri) && ri.filter != null) {
            // Build a reasonable intent filter, based on what matched.
            IntentFilter filter = new IntentFilter();

@@ -414,7 +414,7 @@ public class AssociationsDialog implements OnItemClickListener {
            boolean isPlatformSigned =
                    FileManagerApplication.isAppPlatformSignature(this.mContext);
            if (isPlatformSigned && this.mAllowPreferred) {
                if (filter != null && !isPreferredSelected() && !isInternalEditor(ri)) {
                if (filter != null && !isPreferredSelected()) {
                    try {
                        AssociationsAdapter adapter = (AssociationsAdapter)this.mGrid.getAdapter();
                        final int cc = adapter.getCount();