Listen to category changes in preference fragment.
Bug: 31781480 Test: make RunSettingsRoboTests Change-Id: I702e524eb3a9e40b653e112dba80d620be3bc9bb
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.dashboard;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settingslib.drawer.CategoryKey;
|
||||
@@ -30,6 +31,8 @@ import java.util.List;
|
||||
*/
|
||||
public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
|
||||
|
||||
private static final String DASHBOARD_TILE_PREF_KEY_PREFIX = "dashboard_tile_pref_";
|
||||
|
||||
protected final Context mContext;
|
||||
|
||||
private final CategoryManager mCategoryManager;
|
||||
@@ -63,4 +66,15 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
|
||||
public int getPriorityGroup(Tile tile) {
|
||||
return tile.priority / 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDashboardKeyForTile(Tile tile) {
|
||||
if (tile == null || tile.intent == null) {
|
||||
return null;
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder(DASHBOARD_TILE_PREF_KEY_PREFIX);
|
||||
final ComponentName component = tile.intent.getComponent();
|
||||
sb.append(component.getClassName());
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user