先在配置文件中隐藏蓝牙快捷键:
niming@ubuntu:/home/user/workspace2/niming/a33-v2.0/android/packages/apps/Settings$ git diff 1421dfe27be68b1d1e11f0ed2244265f385eb380 cae2e8c7736fba6054dc509b259853e54a71b12a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 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 1421dfe27be68b1d1e11f0ed2244265f385eb380
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java
index 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.java
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
old mode 100644
new mode 100755
index 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);