Add shortcut manager support to Settings (2/2)
b/28298258 Locale change will be handled in future CL/ dynamic shortcut list change using a UI will be handled in follow up CL. Change-Id: I5468b17e8c8b32625139ab0484d5d0386be0961d
This commit is contained in:
@@ -43,6 +43,7 @@ import android.transition.TransitionManager;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -536,6 +537,8 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
final ComponentName cn = intent.getComponent();
|
||||
final String className = cn.getClassName();
|
||||
|
||||
publishShortcuts();
|
||||
|
||||
mIsShowingDashboard = className.equals(Settings.class.getName())
|
||||
|| className.equals(Settings.WirelessSettings.class.getName())
|
||||
|| className.equals(Settings.DeviceSettings.class.getName())
|
||||
@@ -1016,6 +1019,18 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
return f;
|
||||
}
|
||||
|
||||
private void publishShortcuts() {
|
||||
AsyncTask.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!getSharedPreferences(ShortcutInfoPublisher.PREF_FILE, Context.MODE_PRIVATE)
|
||||
.getBoolean(ShortcutInfoPublisher.PREF_KEY, false)) {
|
||||
ShortcutInfoPublisher.setDynamicShortcuts(SettingsActivity.this, getTileCache());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateTilesList() {
|
||||
// Generally the items that are will be changing from these updates will
|
||||
// not be in the top list of tiles, so run it in the background and the
|
||||
|
Reference in New Issue
Block a user