Implement Settings app UX for when a user has bluetooth config locked down.
When a user has the user restriction DISALLOW_CONFIG_BLUETOOTH - Remove all the menu items for searching and other config - Hide "available" but non-paired devices - Remove settings button from paired devices - Remove ability to make the device visible to others Change-Id: Icaebf29d3cce55d924fdd65449447b5b7a438bbe
This commit is contained in:
@@ -16,11 +16,15 @@
|
||||
|
||||
package com.android.settings.bluetooth;
|
||||
|
||||
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothDevicePicker;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
@@ -51,7 +55,9 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getActivity().setTitle(getString(R.string.device_picker));
|
||||
mStartScanOnResume = (savedInstanceState == null); // don't start scan after rotation
|
||||
UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
|
||||
mStartScanOnResume = !um.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)
|
||||
&& (savedInstanceState == null); // don't start scan after rotation
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user