Settings - add support for Launch by Default - part 2

UX fixes

- make the ManageApplications list to be able to handle some disable items
- add domain list for App that are not verified

Change-Id: Ib37c6f3f3dd1d1cdc17db434967f583cc89e068c
This commit is contained in:
Fabrice Di Meglio
2015-04-03 15:16:13 -07:00
parent 6e338dbe62
commit e8981e3c58
2 changed files with 51 additions and 26 deletions

View File

@@ -497,7 +497,9 @@ public class ManageApplications extends InstrumentedFragment
ApplicationsState.AppEntry entry = mApplications.getAppEntry(position);
mCurrentPkgName = entry.info.packageName;
mCurrentUid = entry.info.uid;
startApplicationDetailsActivity();
if (isAppEntryViewEnabled(entry)) {
startApplicationDetailsActivity();
}
}
}
@@ -585,6 +587,13 @@ public class ManageApplications extends InstrumentedFragment
}
private static boolean isAppEntryViewEnabled(AppEntry entry) {
if ((entry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0 || !entry.info.enabled) {
return false;
}
return true;
}
/*
* Custom adapter implementation for the ListView
* This adapter maintains a map for each displayed application and its properties
@@ -879,19 +888,6 @@ public class ManageApplications extends InstrumentedFragment
return false;
}
@Override
public boolean isEnabled(int position) {
ApplicationsState.AppEntry entry = mEntries.get(position);
synchronized (entry) {
if ((entry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) {
return false;
} else if (!entry.info.enabled) {
return false;
}
return true;
}
}
public View getView(int position, View convertView, ViewGroup parent) {
// A ViewHolder keeps references to children views to avoid unnecessary calls
// to findViewById() on each row.
@@ -928,6 +924,7 @@ public class ManageApplications extends InstrumentedFragment
holder.updateSizeText(mManageApplications.mInvalidSizeStr, mWhichSize);
break;
}
convertView.setEnabled(isAppEntryViewEnabled(entry));
if ((entry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) {
holder.disabled.setVisibility(View.VISIBLE);
holder.disabled.setText(R.string.not_installed);