Show default app icon in default app screen.
- Renamed AdvancedAppSettings to DefaultAppSettings. - Add logic to DefaultAppPreferenceController to also display icon. - Modified DefautlAssistPrefController to suppress gear icon, and use the controller in default app setting UI to display icon. - Remove dynamic injected payment setting activity and create the setting statically in xml. - Add DefaultPaymentSettingsPreference to display default payment app title (no icon because we can't get it) Change-Id: I6b8c768da0bafe5ec9a85ba9c79c7993b449be25 Fix: 36458534 Test: robotests
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.applications.defaultapps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.support.v7.preference.Preference;
|
||||
@@ -54,9 +55,11 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
||||
CharSequence defaultAppLabel = getDefaultAppLabel();
|
||||
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
||||
preference.setSummary(defaultAppLabel);
|
||||
preference.setIcon(getDefaultAppIcon());
|
||||
} else {
|
||||
Log.d(TAG, "No default app");
|
||||
preference.setSummary(R.string.app_list_preference_none);
|
||||
preference.setIcon(null);
|
||||
}
|
||||
mayUpdateGearIcon(app, preference);
|
||||
}
|
||||
@@ -84,6 +87,17 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
||||
return null;
|
||||
}
|
||||
|
||||
public Drawable getDefaultAppIcon() {
|
||||
if (!isAvailable()) {
|
||||
return null;
|
||||
}
|
||||
final DefaultAppInfo app = getDefaultAppInfo();
|
||||
if (app != null) {
|
||||
return app.loadIcon();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public CharSequence getDefaultAppLabel() {
|
||||
if (!isAvailable()) {
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user