ensure appmgr doesn't fail on loading apps
also don't load icons to improve memory usage
This commit is contained in:
parent
227253de76
commit
8445f2e55d
|
@ -113,8 +113,11 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
||||||
|
|
||||||
final TorifiedApp app = mApps.get(position);
|
final TorifiedApp app = mApps.get(position);
|
||||||
|
|
||||||
|
if (app.getIcon() != null)
|
||||||
entry.icon.setImageDrawable(app.getIcon());
|
entry.icon.setImageDrawable(app.getIcon());
|
||||||
|
else
|
||||||
|
entry.icon.setVisibility(View.GONE);
|
||||||
|
|
||||||
entry.text.setText(app.getName());
|
entry.text.setText(app.getName());
|
||||||
|
|
||||||
final CheckBox box = entry.box;
|
final CheckBox box = entry.box;
|
||||||
|
@ -227,8 +230,18 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
|
||||||
app.setUid(aInfo.uid);
|
app.setUid(aInfo.uid);
|
||||||
app.setUsername(pMgr.getNameForUid(app.getUid()));
|
app.setUsername(pMgr.getNameForUid(app.getUid()));
|
||||||
app.setProcname(aInfo.processName);
|
app.setProcname(aInfo.processName);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
app.setName(pMgr.getApplicationLabel(aInfo).toString());
|
app.setName(pMgr.getApplicationLabel(aInfo).toString());
|
||||||
app.setIcon(pMgr.getApplicationIcon(aInfo));
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
app.setName(aInfo.packageName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//app.setIcon(pMgr.getApplicationIcon(aInfo));
|
||||||
|
|
||||||
// check if this application is allowed
|
// check if this application is allowed
|
||||||
if (Arrays.binarySearch(tordApps, app.getUsername()) >= 0) {
|
if (Arrays.binarySearch(tordApps, app.getUsername()) >= 0) {
|
||||||
|
|
Loading…
Reference in New Issue