Add checks before casting entry.extraInfo.

Test: make, flash
Change-Id: I1a9d6a51b1f236e711fdb49d9c2f795e7023cfce
Fixes: 113309404
This commit is contained in:
Julia Reynolds
2018-09-19 12:23:41 -04:00
parent d5ddae8fc4
commit 56966ce8f5
2 changed files with 26 additions and 2 deletions

View File

@@ -1335,7 +1335,8 @@ public class ManageApplications extends InstrumentedFragment
private void updateSummary(ApplicationViewHolder holder, AppEntry entry) {
switch (mManageApplications.mListType) {
case LIST_TYPE_NOTIFICATION:
if (entry.extraInfo != null) {
if (entry.extraInfo != null
&& entry.extraInfo instanceof NotificationsSentState) {
holder.setSummary(AppStateNotificationBridge.getSummary(mContext,
(NotificationsSentState) entry.extraInfo,
(mLastSortMode == R.id.sort_order_recent_notification)));
@@ -1384,7 +1385,8 @@ public class ManageApplications extends InstrumentedFragment
.getSwitchOnClickListener(entry),
AppStateNotificationBridge.enableSwitch(entry),
AppStateNotificationBridge.checkSwitch(entry));
if (entry.extraInfo != null) {
if (entry.extraInfo != null
&& entry.extraInfo instanceof NotificationsSentState) {
holder.setSummary(AppStateNotificationBridge.getSummary(mContext,
(NotificationsSentState) entry.extraInfo,
(mLastSortMode == R.id.sort_order_recent_notification)));