Fix possible crashes when entering AppDetails

This commit is contained in:
Daniel Martí 2013-11-10 18:52:34 +01:00
parent 36cba44c07
commit 080bab482d

View File

@ -502,13 +502,15 @@ public class AppDetails extends ListActivity {
Permission permission = new Permission(this, permissionName); Permission permission = new Permission(this, permissionName);
sb.append("\t• " + permission.getName() + '\n'); sb.append("\t• " + permission.getName() + '\n');
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
if (permissionName.equals("ACCESS_SUPERUSER")) if (permissionName.equals("ACCESS_SUPERUSER")) {
sb.append("\t• Full permissions to all device features and storage\n"); sb.append("\t• Full permissions to all device features and storage\n");
else } else {
Log.d("FDroid", "Can't find permission "+permissionName); Log.d("FDroid", "Permission not yet available: "
+permissionName);
}
} }
} }
sb.setLength(sb.length() - 1); if (sb.length() > 0) sb.setLength(sb.length() - 1);
tv.setText(sb.toString()); tv.setText(sb.toString());
} }
tv = (TextView) infoView.findViewById(R.id.permissions); tv = (TextView) infoView.findViewById(R.id.permissions);
@ -524,7 +526,7 @@ public class AppDetails extends ListActivity {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (String af : app.antiFeatures) for (String af : app.antiFeatures)
sb.append("\t• " + descAntiFeature(af) + "\n"); sb.append("\t• " + descAntiFeature(af) + "\n");
sb.setLength(sb.length() - 1); if (sb.length() > 0) sb.setLength(sb.length() - 1);
tv.setText(sb.toString()); tv.setText(sb.toString());
} else { } else {
tv.setVisibility(View.GONE); tv.setVisibility(View.GONE);