Add infrastructure for connected device group.
The core thing is to find out a way to update group when devices (bt device and usb device)are updated. The infrastructure contains three parts: 1. ConnectedDeviceController Normal PreferenceController. Get info from sub controller and update the preferenceGroup. 2. BluetoothDeviceUpdater Listen to bluetooth callback, decide whether to add/remove devices 3. DevicePreferenceCallback Interface to add/remove preference. This interface will be used in ConntectedDeviceController and future SavedDeviceController Bug: 69333961 Test: RunsettingsRoboTests Change-Id: I85a9ef216a801d5f0dd1cf0130d53850a68be4bd
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.connecteddevice;
|
||||
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
/**
|
||||
* Callback to add or remove {@link Preference} in device group.
|
||||
*/
|
||||
public interface DevicePreferenceCallback {
|
||||
/**
|
||||
* Called when a device(i.e. bluetooth, usb) is added
|
||||
* @param preference present the device
|
||||
*/
|
||||
void onDeviceAdded(Preference preference);
|
||||
|
||||
/**
|
||||
* Called when a device(i.e. bluetooth, usb) is removed
|
||||
* @param preference present the device
|
||||
*/
|
||||
void onDeviceRemoved(Preference preference);
|
||||
}
|
Reference in New Issue
Block a user