lynn8570
lynn8570

Reputation: 1683

how to remove the bluetooth module from android

I have a device which runs android 4.1. But the device does not have a bluetooth, so I want to remove bluetooth related items from the 4.1 platform (like sharing menu, setting items which contain "bluetooth ").

but it seems a miscellaneous work ( settings, filesharing , ).

Is there any method that can tell the platform that the current devices don't have a bluetooth only by config some files???

Upvotes: 0

Views: 3772

Answers (1)

lynn8570
lynn8570

Reputation: 1683

in Android 4.1 Settings.java (packages/apps/settings/) the code

// Remove Bluetooth Settings if Bluetooth service is not available.
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
target.remove(header);
}

is used to judge if the devices support Bluetooth service.

the configing files are under systemtem/etc/permissions/xxxx.xml which are copied from /framework/base/data/etc/xxx.xml

 PackageManager.FEATURE_BLUETOOTH = "android.hardware.wifi"

 PackageManager.FEATURE_BLUETOOTH = "android.hardware.bluetooth"

Since it only provides a method to flag whether the devices support Bluetooth service, the View items that contain Bluetooth should be removed separately.

Upvotes: 1

Related Questions