Android系统去除蓝牙

来源:互联网 发布:淘宝类目排名查询 编辑:程序博客网 时间:2024/06/03 14:52

        先在配置文件中隐藏蓝牙快捷键:

niming@ubuntu:/home/user/workspace2/niming/a33-v2.0/android/packages/apps/Settings$ git diff  1421dfe27be68b1d1e11f0ed2244265f385eb380 cae2e8c7736fba6054dc509b259853e54a71b12adiff --git a/AndroidManifest.xml b/AndroidManifest.xmlindex baf841a..5836def 100755--- a/AndroidManifest.xml+++ b/AndroidManifest.xml@@ -274,7 +274,7 @@                 <category android:name="android.intent.category.VOICE_LAUNCH" />             </intent-filter>         </activity>-+ <!-- Keep compatibility with old shortcuts.          <activity android:name="Settings$BluetoothSettingsActivity"                 android:uiOptions="splitActionBarWhenNarrow"                 android:label="@string/bluetooth_settings_title"@@ -293,7 +293,7 @@                 android:resource="@id/bluetooth_settings" />         </activity>          <!-- Keep compatibility with old shortcuts. -->                <activity-alias android:name=".bluetooth.BluetoothSettings"                 android:uiOptions="splitActionBarWhenNarrow"                 android:label="@string/bluetooth_settings_title"@@ -316,7 +316,7 @@                 <category android:name="android.intent.category.DEFAULT" />             </intent-filter>         </activity>-+    -->         <activity android:name="Settings$TetherSettingsActivity"                 android:label="@string/tether_settings_title_all"                 android:taskAffinity=""

        然后在Java代码里删除蓝牙。。

niming@ubuntu:/home/user/workspace2/niming/a33-v2.0/android/packages/apps/Settings$ git diff  223b1542a05f601c77eea4e49289f3d1e99524be 1421dfe27be68b1d1e11f0ed2244265f385eb380diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.javaindex a5d3658..590b5f9 100644--- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java+++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java@@ -43,7 +43,8 @@ import android.widget.RemoteViews; import com.android.settings.R; import com.android.settings.bluetooth.LocalBluetoothAdapter; import com.android.settings.bluetooth.LocalBluetoothManager;-+import android.view.View;+import android.content.pm.PackageManager; /**  * Provides control of power-related settings from a widget.  */@@ -700,6 +701,14 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {                 getLaunchPendingIntent(context,                         BUTTON_BLUETOOTH));+               // add by kangwx delete bluetooth+               if(!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))+               {+                       views.setViewVisibility(R.id.btn_bluetooth, View.GONE);+               }++                       views.setViewVisibility(R.id.btn_bluetooth, View.GONE);         updateButtons(views, context);         return views;     }

去掉 设置-》更多-》网络共享和便携式热点里面的《蓝牙共享网络》这项的代码:

niming@ubuntu:/home/user/workspace2/niming/a33-v2.0/android/packages/apps/Settings$ git diff   src/com/android/settings/TetherSettings.javadiff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.javaold mode 100644new mode 100755index 962b798..3114d8d--- a/src/com/android/settings/TetherSettings.java+++ b/src/com/android/settings/TetherSettings.java@@ -161,7 +161,7 @@ public class TetherSettings extends SettingsPreferenceFragment                 mBluetoothTether.setChecked(false);             }         }-+        getPreferenceScreen().removePreference(mBluetoothTether);         mProvisionApp = getResources().getStringArray(                 com.android.internal.R.array.config_mobile_hotspot_provision_app);



0 0
原创粉丝点击