Android 8.0 删除 Cast 功能
Posted 王睿丶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 8.0 删除 Cast 功能相关的知识,希望对你有一定的参考价值。
frameworks\\base\\packages\\SystemUI\\res\\values\\config.xml
删除:状态栏里的 Cast 图标
<!-- The default tiles to display in QuickSettings -->
<string name="quick_settings_tiles_default" translatable="false">
-- wifi,dnd,flashlight,rotation,battery,cell,airplane,cast
</string>
<string name="quick_settings_tiles_default" translatable="false">
++ wifi,dnd,flashlight,rotation,battery,cell,airplane
</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,airplane,location,hotspot,inversion,saver,work,cast,night
++ wifi,cell,battery,dnd,flashlight,rotation,airplane,location,hotspot,inversion,saver,work,night
</string>
删除:设置里的 Cast 相关的描述
packages\\apps\\Settings\\res\\values\\strings.xml
<!-- Summary for Connected devices settings, explaning a few important settings under it [CHAR LIMIT=NONE]-->
-- <string name="connected_devices_dashboard_summary">Bluetooth, Cast, NFC</string>
++ <string name="connected_devices_dashboard_summary">Bluetooth, NFC</string>
<!-- Summary for Connected devices settings, explaning a few important settings under it [CHAR LIMIT=NONE]-->
-- <string name="connected_devices_dashboard_no_nfc_summary">Bluetooth, Cast</string>
++ <string name="connected_devices_dashboard_no_nfc_summary">Bluetooth</string>
删除:设置里的 Cast 选项
packages\\apps\\Settings\\src\\com\\android\\settings\\dashboard\\DashboardFragment.java
void refreshDashboardTiles(final String TAG)
// Install dashboard tiles.
for (Tile tile : tiles)
final String key = mDashboardFeatureProvider.getDashboardKeyForTile(tile);
if (TextUtils.isEmpty(key))
Log.d(TAG, "tile does not contain a key, skipping " + tile);
continue;
if (!displayTile(tile))
continue;
++ if("dashboard_tile_pref_com.android.settings.Settings$WifiDisplaySettingsActivity".equals(key))
++ continue;
++
if (tintTileIcon(tile))
tile.icon.setTint(tintColor);
if (mDashboardTilePrefKeys.contains(key))
// Have the key already, will rebind.
final Preference preference = mProgressiveDisclosureMixin.findPreference(
screen, key);
mDashboardFeatureProvider.bindPreferenceToTile(getActivity(), getMetricsCategory(),
preference, tile, key, mPlaceholderPreferenceController.getOrder());
else
// Don't have this key, add it.
final Preference pref = new Preference(getPrefContext());
mDashboardFeatureProvider.bindPreferenceToTile(getActivity(), getMetricsCategory(),
pref, tile, key, mPlaceholderPreferenceController.getOrder());
mProgressiveDisclosureMixin.addPreference(screen, pref);
mDashboardTilePrefKeys.add(key);
remove.remove(key);
以上是关于Android 8.0 删除 Cast 功能的主要内容,如果未能解决你的问题,请参考以下文章