Program: 25665
Project: 25665
Buggy source:
@Override public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  final ViewHolder holder;
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.templateentry,parent);
    holder=new ViewHolder(convertView);
    convertView.setTag(holder);
  }
 else   holder=(ViewHolder)convertView.getTag();
  final String restrictionName=(String)getGroup(groupPosition);
  final int userId=Util.getUserId(Process.myUid());
  String value=PrivacyManager.getSetting(userId,getTemplate(),restrictionName,Boolean.toString(!ondemand) + "String_Node_Str");
  holder.restricted=value.contains("String_Node_Str");
  holder.asked=(!ondemand || value.contains("String_Node_Str"));
  boolean partialRestricted=false;
  boolean partialAsked=false;
  if (holder.restricted || !holder.asked)   for (  Hook hook : PrivacyManager.getHooks(restrictionName)) {
    String settingName=restrictionName + "String_Node_Str" + hook.getName();
    String childValue=PrivacyManager.getSetting(userId,getTemplate(),settingName,null);
    if (childValue == null)     childValue=Boolean.toString(holder.restricted && !hook.isDangerous()) + (holder.asked || (hook.isDangerous() && hook.whitelist() == null) ? "String_Node_Str" : "String_Node_Str");
    if (!childValue.contains("String_Node_Str"))     partialRestricted=true;
    if (childValue.contains("String_Node_Str"))     partialAsked=true;
  }
  Bitmap bmRestricted=(holder.restricted ? partialRestricted ? getHalfCheckBox() : getFullCheckBox() : getOffCheckBox());
  Bitmap bmAsked=(holder.asked ? getOffCheckBox() : partialAsked ? getHalfCheckBox() : getOnDemandCheckBox());
  holder.imgIndicator.setImageResource(getThemed(isExpanded ? R.attr.icon_expander_maximized : R.attr.icon_expander_minimized));
  holder.imgIndicator.setVisibility(View.VISIBLE);
  holder.tvRestriction.setTypeface(null,Typeface.BOLD);
  holder.tvRestriction.setText(listLocalizedTitle.get(groupPosition));
  holder.imgCbRestrict.setImageBitmap(bmRestricted);
  holder.imgCbAsk.setImageBitmap(bmAsked);
  holder.imgCbAsk.setVisibility(ondemand ? View.VISIBLE : View.GONE);
  holder.imgCbRestrict.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      holder.restricted=!holder.restricted;
      PrivacyManager.setSetting(userId,getTemplate(),restrictionName,(holder.restricted ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (holder.asked ? "String_Node_Str" : "String_Node_Str"));
      notifyDataSetChanged();
    }
  }
);
  holder.imgCbAsk.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      holder.asked=(!ondemand || !holder.asked);
      PrivacyManager.setSetting(userId,getTemplate(),restrictionName,(holder.restricted ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (holder.asked ? "String_Node_Str" : "String_Node_Str"));
      notifyDataSetChanged();
    }
  }
);
  return convertView;
}

Fixed version (ground truth):
@Override @SuppressLint("String_Node_Str") public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  final ViewHolder holder;
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.templateentry,null);
    holder=new ViewHolder(convertView);
    convertView.setTag(holder);
  }
 else   holder=(ViewHolder)convertView.getTag();
  final String restrictionName=(String)getGroup(groupPosition);
  final int userId=Util.getUserId(Process.myUid());
  String value=PrivacyManager.getSetting(userId,getTemplate(),restrictionName,Boolean.toString(!ondemand) + "String_Node_Str");
  holder.restricted=value.contains("String_Node_Str");
  holder.asked=(!ondemand || value.contains("String_Node_Str"));
  boolean partialRestricted=false;
  boolean partialAsked=false;
  if (holder.restricted || !holder.asked)   for (  Hook hook : PrivacyManager.getHooks(restrictionName)) {
    String settingName=restrictionName + "String_Node_Str" + hook.getName();
    String childValue=PrivacyManager.getSetting(userId,getTemplate(),settingName,null);
    if (childValue == null)     childValue=Boolean.toString(holder.restricted && !hook.isDangerous()) + (holder.asked || (hook.isDangerous() && hook.whitelist() == null) ? "String_Node_Str" : "String_Node_Str");
    if (!childValue.contains("String_Node_Str"))     partialRestricted=true;
    if (childValue.contains("String_Node_Str"))     partialAsked=true;
  }
  Bitmap bmRestricted=(holder.restricted ? partialRestricted ? getHalfCheckBox() : getFullCheckBox() : getOffCheckBox());
  Bitmap bmAsked=(holder.asked ? getOffCheckBox() : partialAsked ? getHalfCheckBox() : getOnDemandCheckBox());
  holder.imgIndicator.setImageResource(getThemed(isExpanded ? R.attr.icon_expander_maximized : R.attr.icon_expander_minimized));
  holder.imgIndicator.setVisibility(View.VISIBLE);
  holder.tvRestriction.setTypeface(null,Typeface.BOLD);
  holder.tvRestriction.setText(listLocalizedTitle.get(groupPosition));
  holder.imgCbRestrict.setImageBitmap(bmRestricted);
  holder.imgCbAsk.setImageBitmap(bmAsked);
  holder.imgCbAsk.setVisibility(ondemand ? View.VISIBLE : View.GONE);
  holder.imgCbRestrict.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      holder.restricted=!holder.restricted;
      PrivacyManager.setSetting(userId,getTemplate(),restrictionName,(holder.restricted ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (holder.asked ? "String_Node_Str" : "String_Node_Str"));
      notifyDataSetChanged();
    }
  }
);
  holder.imgCbAsk.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      holder.asked=(!ondemand || !holder.asked);
      PrivacyManager.setSetting(userId,getTemplate(),restrictionName,(holder.restricted ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (holder.asked ? "String_Node_Str" : "String_Node_Str"));
      notifyDataSetChanged();
    }
  }
);
  return convertView;
}