Use app name as summary in default home app setting.
Bug: 27834147 Condition: Only use app name as summary if there is only 1 launcher app installed. Change-Id: Idb9b55d5618bbdbea6446758f2fcd09d0d6309af
This commit is contained in:
@@ -32,6 +32,7 @@ import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -265,6 +266,24 @@ public class AppListPreference extends CustomListPreference {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets app label as summary if there is only 1 app applicable to this preference.
|
||||
*/
|
||||
protected void setSoleAppLabelAsSummary() {
|
||||
final CharSequence soleLauncherLabel = getSoleAppLabel();
|
||||
if (!TextUtils.isEmpty(soleLauncherLabel)) {
|
||||
setSummary(soleLauncherLabel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns app label if there is only 1 app applicable to this preference.
|
||||
*/
|
||||
protected CharSequence getSoleAppLabel() {
|
||||
// Intentionally left empty so subclasses can override with necessary logic.
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class SavedState implements Parcelable {
|
||||
|
||||
public final CharSequence[] entryValues;
|
||||
|
Reference in New Issue
Block a user