Use a generic icon for Home

It's only a *foolish* consistency that is the hobgoblin of
little minds.

Bug 10849877

Change-Id: Ice60cbb13a754edc104ae8630cb3d8dfe637d1af
This commit is contained in:
Jeff Sharkey
2013-09-23 17:41:16 -07:00
committed by Christopher Tate
parent 88cf7709cb
commit d572a03ad8
5 changed files with 2 additions and 37 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -667,50 +667,15 @@ public class Settings extends PreferenceActivity
return headerIndex;
}
private boolean isSystemApp(ResolveInfo ri) {
return ((ri.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
}
private boolean updateHomeSettingHeaders(Header header) {
final PackageManager pm = getPackageManager();
final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
try {
ComponentName currentHome = pm.getHomeActivities(homeApps);
final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
getPackageManager().getHomeActivities(homeApps);
if (homeApps.size() < 2) {
// When there's only one available home app, omit this settings
// category entirely at the top level UI.
return false;
}
ResolveInfo iconSource = null;
if (currentHome == null) {
// no current default, so find the system home app and use that
for (int which = 0; which < homeApps.size(); which++) {
ResolveInfo ri = homeApps.get(which);
if (isSystemApp(ri)) {
iconSource = ri;
break;
}
}
} else {
// find the current-home entry in the returned set
for (int which = 0; which < homeApps.size(); which++) {
ResolveInfo ri = homeApps.get(which);
ComponentName riName = new ComponentName(ri.activityInfo.packageName,
ri.activityInfo.name);
if (riName.equals(currentHome)) {
iconSource = ri;
break;
}
}
}
if (iconSource != null) {
if (header.extras == null) {
header.extras = new Bundle();
}
header.extras.putParcelable(HomeSettings.CURRENT_HOME, iconSource.activityInfo);
} else {
Log.v(LOG_TAG, "No home app icon found");
}
} catch (Exception e) {
// Can't look up the home activity; bail on configuring the icon
Log.w(LOG_TAG, "Problem looking up home activity!", e);