Program: 193177
Project: 193177
Buggy source:
protected boolean inflateViews(Entry entry,ViewGroup parent){
  PackageManager pmUser=getPackageManagerForUser(mContext,entry.notification.getUser().getIdentifier());
  final StatusBarNotification sbn=entry.notification;
  entry.cacheContentViews(mContext,null);
  final RemoteViews contentView=entry.cachedContentView;
  final RemoteViews bigContentView=entry.cachedBigContentView;
  final RemoteViews headsUpContentView=entry.cachedHeadsUpContentView;
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  if (contentView == null) {
    Log.v(TAG,"String_Node_Str" + sbn.getNotification());
    return false;
  }
  if (DEBUG) {
    Log.v(TAG,"String_Node_Str" + publicContentView);
  }
  ExpandableNotificationRow row;
  boolean hasUserChangedExpansion=false;
  boolean userExpanded=false;
  boolean userLocked=false;
  if (entry.row != null) {
    row=entry.row;
    hasUserChangedExpansion=row.hasUserChangedExpansion();
    userExpanded=row.isUserExpanded();
    userLocked=row.isUserLocked();
    entry.reset();
    if (hasUserChangedExpansion) {
      row.setUserExpanded(userExpanded);
    }
  }
 else {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    row=(ExpandableNotificationRow)inflater.inflate(R.layout.status_bar_notification_row,parent,false);
    row.setExpansionLogger(this,entry.notification.getKey());
    row.setGroupManager(mGroupManager);
    row.setOnExpandClickListener(this);
  }
  workAroundBadLayerDrawableOpacity(row);
  View vetoButton=updateNotificationVetoButton(row,sbn);
  vetoButton.setContentDescription(mContext.getString(R.string.accessibility_remove_notification));
  NotificationContentView contentContainer=row.getPrivateLayout();
  NotificationContentView contentContainerPublic=row.getPublicLayout();
  row.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
  if (ENABLE_REMOTE_INPUT) {
    row.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
  }
  mNotificationClicker.register(row,sbn);
  View contentViewLocal=null;
  View bigContentViewLocal=null;
  View headsUpContentViewLocal=null;
  try {
    contentViewLocal=contentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    if (bigContentView != null) {
      bigContentViewLocal=bigContentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    }
    if (headsUpContentView != null) {
      headsUpContentViewLocal=headsUpContentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    }
  }
 catch (  RuntimeException e) {
    final String ident=sbn.getPackageName() + "String_Node_Str" + Integer.toHexString(sbn.getId());
    Log.e(TAG,"String_Node_Str" + ident,e);
    return false;
  }
  if (contentViewLocal != null) {
    contentViewLocal.setIsRootNamespace(true);
    contentContainer.setContractedChild(contentViewLocal);
  }
  if (bigContentViewLocal != null) {
    bigContentViewLocal.setIsRootNamespace(true);
    contentContainer.setExpandedChild(bigContentViewLocal);
  }
  if (headsUpContentViewLocal != null) {
    headsUpContentViewLocal.setIsRootNamespace(true);
    contentContainer.setHeadsUpChild(headsUpContentViewLocal);
  }
  View publicViewLocal=null;
  if (publicContentView != null) {
    try {
      publicViewLocal=publicContentView.apply(sbn.getPackageContext(mContext),contentContainerPublic,mOnClickHandler);
      if (publicViewLocal != null) {
        publicViewLocal.setIsRootNamespace(true);
        contentContainerPublic.setContractedChild(publicViewLocal);
      }
    }
 catch (    RuntimeException e) {
      final String ident=sbn.getPackageName() + "String_Node_Str" + Integer.toHexString(sbn.getId());
      Log.e(TAG,"String_Node_Str" + ident,e);
      publicViewLocal=null;
    }
  }
  try {
    ApplicationInfo info=pmUser.getApplicationInfo(sbn.getPackageName(),0);
    entry.targetSdk=info.targetSdkVersion;
  }
 catch (  NameNotFoundException ex) {
    Log.e(TAG,"String_Node_Str" + sbn.getPackageName(),ex);
  }
  if (publicViewLocal == null) {
    publicViewLocal=LayoutInflater.from(mContext).inflate(R.layout.notification_public_default,contentContainerPublic,false);
    publicViewLocal.setIsRootNamespace(true);
    final TextView title=(TextView)publicViewLocal.findViewById(R.id.title);
    try {
      title.setText(pmUser.getApplicationLabel(pmUser.getApplicationInfo(entry.notification.getPackageName(),0)));
    }
 catch (    NameNotFoundException e) {
      title.setText(entry.notification.getPackageName());
    }
    final ImageView icon=(ImageView)publicViewLocal.findViewById(R.id.icon);
    final ImageView profileBadge=(ImageView)publicViewLocal.findViewById(R.id.profile_badge_line3);
    final StatusBarIcon ic=new StatusBarIcon(entry.notification.getUser(),entry.notification.getPackageName(),entry.notification.getNotification().getSmallIcon(),entry.notification.getNotification().iconLevel,entry.notification.getNotification().number,entry.notification.getNotification().tickerText);
    Drawable iconDrawable=StatusBarIconView.getIcon(mContext,ic);
    icon.setImageDrawable(iconDrawable);
    if (profileBadge != null) {
      Drawable profileDrawable=mContext.getPackageManager().getUserBadgeForDensity(entry.notification.getUser(),0);
      if (profileDrawable != null) {
        profileBadge.setImageDrawable(profileDrawable);
        profileBadge.setVisibility(View.VISIBLE);
      }
 else {
        profileBadge.setVisibility(View.GONE);
      }
    }
    final View privateTime=contentViewLocal.findViewById(com.android.internal.R.id.time);
    final DateTimeView time=(DateTimeView)publicViewLocal.findViewById(R.id.time);
    if (privateTime != null && privateTime.getVisibility() == View.VISIBLE) {
      time.setVisibility(View.VISIBLE);
      time.setTime(entry.notification.getNotification().when);
    }
    final TextView text=(TextView)publicViewLocal.findViewById(R.id.text);
    if (text != null) {
      text.setText(R.string.notification_hidden_text);
      text.setTextAppearance(mContext,R.style.TextAppearance_Material_Notification_Parenthetical);
    }
    contentContainerPublic.setContractedChild(publicViewLocal);
    entry.autoRedacted=true;
  }
  if (MULTIUSER_DEBUG) {
    TextView debug=(TextView)row.findViewById(R.id.debug_info);
    if (debug != null) {
      debug.setVisibility(View.VISIBLE);
      debug.setText("String_Node_Str" + mCurrentUserId + "String_Node_Str"+ entry.notification.getUserId());
    }
  }
  entry.row=row;
  updateNotificationHeightRange(entry);
  entry.row.setOnActivatedListener(this);
  entry.row.setExpandable(bigContentViewLocal != null);
  applyColorsAndBackgrounds(sbn,entry);
  if (hasUserChangedExpansion) {
    row.setUserExpanded(userExpanded);
  }
  row.setUserLocked(userLocked);
  row.updateStatusBarNotification(entry.notification);
  applyRemoteInput(entry);
  return true;
}

Fixed version (ground truth):
protected boolean inflateViews(Entry entry,ViewGroup parent){
  PackageManager pmUser=getPackageManagerForUser(mContext,entry.notification.getUser().getIdentifier());
  final StatusBarNotification sbn=entry.notification;
  entry.cacheContentViews(mContext,null);
  final RemoteViews contentView=entry.cachedContentView;
  final RemoteViews bigContentView=entry.cachedBigContentView;
  final RemoteViews headsUpContentView=entry.cachedHeadsUpContentView;
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  if (contentView == null) {
    Log.v(TAG,"String_Node_Str" + sbn.getNotification());
    return false;
  }
  if (DEBUG) {
    Log.v(TAG,"String_Node_Str" + publicContentView);
  }
  ExpandableNotificationRow row;
  boolean hasUserChangedExpansion=false;
  boolean userExpanded=false;
  boolean userLocked=false;
  if (entry.row != null) {
    row=entry.row;
    hasUserChangedExpansion=row.hasUserChangedExpansion();
    userExpanded=row.isUserExpanded();
    userLocked=row.isUserLocked();
    entry.reset();
    if (hasUserChangedExpansion) {
      row.setUserExpanded(userExpanded);
    }
  }
 else {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    row=(ExpandableNotificationRow)inflater.inflate(R.layout.status_bar_notification_row,parent,false);
    row.setExpansionLogger(this,entry.notification.getKey());
    row.setGroupManager(mGroupManager);
    row.setOnExpandClickListener(this);
  }
  workAroundBadLayerDrawableOpacity(row);
  View vetoButton=updateNotificationVetoButton(row,sbn);
  vetoButton.setContentDescription(mContext.getString(R.string.accessibility_remove_notification));
  NotificationContentView contentContainer=row.getPrivateLayout();
  NotificationContentView contentContainerPublic=row.getPublicLayout();
  row.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
  if (ENABLE_REMOTE_INPUT) {
    row.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
  }
  mNotificationClicker.register(row,sbn);
  View contentViewLocal=null;
  View bigContentViewLocal=null;
  View headsUpContentViewLocal=null;
  try {
    contentViewLocal=contentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    if (bigContentView != null) {
      bigContentViewLocal=bigContentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    }
    if (headsUpContentView != null) {
      headsUpContentViewLocal=headsUpContentView.apply(sbn.getPackageContext(mContext),contentContainer,mOnClickHandler);
    }
  }
 catch (  RuntimeException e) {
    final String ident=sbn.getPackageName() + "String_Node_Str" + Integer.toHexString(sbn.getId());
    Log.e(TAG,"String_Node_Str" + ident,e);
    return false;
  }
  if (contentViewLocal != null) {
    contentViewLocal.setIsRootNamespace(true);
    contentContainer.setContractedChild(contentViewLocal);
  }
  if (bigContentViewLocal != null) {
    bigContentViewLocal.setIsRootNamespace(true);
    contentContainer.setExpandedChild(bigContentViewLocal);
  }
  if (headsUpContentViewLocal != null) {
    headsUpContentViewLocal.setIsRootNamespace(true);
    contentContainer.setHeadsUpChild(headsUpContentViewLocal);
  }
  View publicViewLocal=null;
  if (publicContentView != null) {
    try {
      publicViewLocal=publicContentView.apply(sbn.getPackageContext(mContext),contentContainerPublic,mOnClickHandler);
      if (publicViewLocal != null) {
        publicViewLocal.setIsRootNamespace(true);
        contentContainerPublic.setContractedChild(publicViewLocal);
      }
    }
 catch (    RuntimeException e) {
      final String ident=sbn.getPackageName() + "String_Node_Str" + Integer.toHexString(sbn.getId());
      Log.e(TAG,"String_Node_Str" + ident,e);
      publicViewLocal=null;
    }
  }
  try {
    ApplicationInfo info=pmUser.getApplicationInfo(sbn.getPackageName(),0);
    entry.targetSdk=info.targetSdkVersion;
  }
 catch (  NameNotFoundException ex) {
    Log.e(TAG,"String_Node_Str" + sbn.getPackageName(),ex);
  }
  if (publicViewLocal == null) {
    publicViewLocal=LayoutInflater.from(mContext).inflate(R.layout.notification_public_default,contentContainerPublic,false);
    publicViewLocal.setIsRootNamespace(true);
    final TextView title=(TextView)publicViewLocal.findViewById(R.id.title);
    try {
      title.setText(pmUser.getApplicationLabel(pmUser.getApplicationInfo(entry.notification.getPackageName(),0)));
    }
 catch (    NameNotFoundException e) {
      title.setText(entry.notification.getPackageName());
    }
    final ImageView icon=(ImageView)publicViewLocal.findViewById(R.id.icon);
    final ImageView profileBadge=(ImageView)publicViewLocal.findViewById(R.id.profile_badge_line3);
    final StatusBarIcon ic=new StatusBarIcon(entry.notification.getUser(),entry.notification.getPackageName(),entry.notification.getNotification().getSmallIcon(),entry.notification.getNotification().iconLevel,entry.notification.getNotification().number,entry.notification.getNotification().tickerText);
    Drawable iconDrawable=StatusBarIconView.getIcon(mContext,ic);
    icon.setImageDrawable(iconDrawable);
    if (profileBadge != null) {
      Drawable profileDrawable=mContext.getPackageManager().getUserBadgeForDensity(entry.notification.getUser(),0);
      if (profileDrawable != null) {
        profileBadge.setImageDrawable(profileDrawable);
        profileBadge.setVisibility(View.VISIBLE);
      }
 else {
        profileBadge.setVisibility(View.GONE);
      }
    }
    final View privateTime=contentViewLocal.findViewById(com.android.internal.R.id.time);
    final DateTimeView time=(DateTimeView)publicViewLocal.findViewById(R.id.time);
    if (privateTime != null && privateTime.getVisibility() == View.VISIBLE) {
      time.setVisibility(View.VISIBLE);
      time.setTime(entry.notification.getNotification().when);
    }
    final TextView text=(TextView)publicViewLocal.findViewById(R.id.text);
    if (text != null) {
      text.setText(R.string.notification_hidden_text);
      text.setTextAppearance(mContext,R.style.TextAppearance_Material_Notification_Parenthetical);
    }
    contentContainerPublic.setContractedChild(publicViewLocal);
    entry.autoRedacted=true;
  }
  if (MULTIUSER_DEBUG) {
    TextView debug=(TextView)row.findViewById(R.id.debug_info);
    if (debug != null) {
      debug.setVisibility(View.VISIBLE);
      debug.setText("String_Node_Str" + mCurrentUserId + "String_Node_Str"+ entry.notification.getUserId());
    }
  }
  entry.row=row;
  entry.row.setOnActivatedListener(this);
  entry.row.setExpandable(bigContentViewLocal != null);
  applyColorsAndBackgrounds(sbn,entry);
  if (hasUserChangedExpansion) {
    row.setUserExpanded(userExpanded);
  }
  row.setUserLocked(userLocked);
  row.onNotificationUpdated(entry);
  applyRemoteInput(entry);
  return true;
}