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

Commit 93cb8669 authored by yumeng's avatar yumeng Committed by Gerrit - the friendly Code Review server
Browse files

Settings: fix the "force close" in Settings at monkey-test.

it cannot correctly cast into the Class because of the field
"mManageApplications.mListType" changed at second life-cycle.

Change-Id: I9209abab7ba9c00f809251662583c1c73a9665ab
CRs-Fixed: 1070406
parent 6aa77fb3
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1174,8 +1174,12 @@ public class ManageApplications extends InstrumentedFragment
            switch (mManageApplications.mListType) {
                case LIST_TYPE_NOTIFICATION:
                    if (holder.entry.extraInfo != null) {
                        if (!((holder.entry.extraInfo) instanceof AppRow)) {
                            holder.updateSizeText(mManageApplications.mInvalidSizeStr, mWhichSize);
                        } else {
                            holder.summary.setText(InstalledAppDetails.getNotificationSummary(
                                (AppRow) holder.entry.extraInfo, mContext));
                        }
                    } else {
                        holder.summary.setText(null);
                    }
@@ -1187,9 +1191,13 @@ public class ManageApplications extends InstrumentedFragment

                case LIST_TYPE_USAGE_ACCESS:
                    if (holder.entry.extraInfo != null) {
                        if (!((holder.entry.extraInfo) instanceof PermissionState)) {
                            holder.updateSizeText(mManageApplications.mInvalidSizeStr, mWhichSize);
                        } else {
                            holder.summary.setText((new UsageState((PermissionState) holder.entry
                                .extraInfo)).isPermissible() ? R.string.switch_on_text :
                                R.string.switch_off_text);
                        }
                    } else {
                        holder.summary.setText(null);
                    }