Merge "Bug: 28875393 Bug: 28879732" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
779adf8879
@@ -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>
|
||||
|
||||
@@ -265,4 +270,3 @@
|
||||
<bool name="quick_settings_show_date">false</bool>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@ public class TileQueryHelper {
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -141,9 +140,16 @@ public class TileQueryHelper {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user