Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Bug: 28875393 Bug: 28879732" into nyc-mr1-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
William Harmon authored and Android (Google) Code Review committed Jun 7, 2016
2 parents 9d5009e + beb1f17 commit 779adf8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/SystemUI/res/values/config.xml
Expand Up @@ -103,6 +103,11 @@
wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location
</string>

<!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
<string name="quick_settings_tiles_stock" translatable="false">
wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,work,cast,night
</string>

<!-- The tiles to display in QuickSettings -->
<string name="quick_settings_tiles" translatable="false">default</string>

Expand Down Expand Up @@ -265,4 +270,3 @@
<bool name="quick_settings_show_date">false</bool>

</resources>

Expand Up @@ -55,8 +55,7 @@ public TileQueryHelper(Context context, QSTileHost host) {
}

private void addSystemTiles(final QSTileHost host) {
String possible = mContext.getString(R.string.quick_settings_tiles_default)
+ ",hotspot,inversion,saver,work,cast,night";
String possible = mContext.getString(R.string.quick_settings_tiles_stock);
String[] possibleTiles = possible.split(",");
final Handler qsHandler = new Handler(host.getLooper());
final Handler mainHandler = new Handler(Looper.getMainLooper());
Expand Down Expand Up @@ -141,9 +140,16 @@ protected Collection<TileInfo> doInBackground(Collection<QSTile<?>>... params) {
PackageManager pm = mContext.getPackageManager();
List<ResolveInfo> services = pm.queryIntentServicesAsUser(
new Intent(TileService.ACTION_QS_TILE), 0, ActivityManager.getCurrentUser());
String stockTiles = mContext.getString(R.string.quick_settings_tiles_stock);
for (ResolveInfo info : services) {
String packageName = info.serviceInfo.packageName;
ComponentName componentName = new ComponentName(packageName, info.serviceInfo.name);

// Don't include apps that are a part of the default tile set.
if (stockTiles.contains(componentName.flattenToString())) {
continue;
}

final CharSequence appLabel = info.serviceInfo.applicationInfo.loadLabel(pm);
String spec = CustomTile.toSpec(componentName);
State state = getState(params[0], spec);
Expand Down

0 comments on commit 779adf8

Please sign in to comment.