本文整理匯總了Java中org.fdroid.fdroid.localrepo.type.BluetoothSwap類的典型用法代碼示例。如果您正苦於以下問題:Java BluetoothSwap類的具體用法?Java BluetoothSwap怎麽用?Java BluetoothSwap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BluetoothSwap類屬於org.fdroid.fdroid.localrepo.type包,在下文中一共展示了BluetoothSwap類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public void onCreate() {
super.onCreate();
Utils.debugLog(TAG, "Creating swap service.");
startForeground(NOTIFICATION, createNotification());
CacheSwapAppsService.startCaching(this);
SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);
appsToSwap.addAll(deserializePackages(preferences.getString(KEY_APPS_TO_SWAP, "")));
bluetoothSwap = BluetoothSwap.create(this);
wifiSwap = new WifiSwap(this);
Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);
LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST));
IntentFilter filter = new IntentFilter(BLUETOOTH_STATE_CHANGE);
filter.addAction(WIFI_STATE_CHANGE);
LocalBroadcastManager.getInstance(this).registerReceiver(receiveSwapStatusChanged, filter);
/*
if (wasBluetoothEnabled()) {
Utils.debugLog(TAG, "Previously the user enabled Bluetooth swap, so enabling again automatically.");
bluetoothSwap.startInBackground();
}
*/
if (wasWifiEnabled()) {
Utils.debugLog(TAG, "Previously the user enabled WiFi swap, so enabling again automatically.");
wifiSwap.startInBackground();
} else {
Utils.debugLog(TAG, "WiFi was NOT enabled last time user swapped, so starting with WiFi not visible.");
}
}
示例2: onCreate
import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public void onCreate() {
super.onCreate();
Utils.debugLog(TAG, "Creating swap service.");
SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);
appsToSwap.addAll(deserializePackages(preferences.getString(KEY_APPS_TO_SWAP, "")));
bluetoothSwap = BluetoothSwap.create(this);
wifiSwap = new WifiSwap(this);
Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);
LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST));
IntentFilter filter = new IntentFilter(BLUETOOTH_STATE_CHANGE);
filter.addAction(WIFI_STATE_CHANGE);
LocalBroadcastManager.getInstance(this).registerReceiver(receiveSwapStatusChanged, filter);
/*
if (wasBluetoothEnabled()) {
Utils.debugLog(TAG, "Previously the user enabled Bluetooth swap, so enabling again automatically.");
bluetoothSwap.startInBackground();
}
*/
if (wasWifiEnabled()) {
Utils.debugLog(TAG, "Previously the user enabled WiFi swap, so enabling again automatically.");
wifiSwap.startInBackground();
} else {
Utils.debugLog(TAG, "WiFi was NOT enabled last time user swapped, so starting with WiFi not visible.");
}
}
示例3: getName
import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
@Override
public String getName() {
return device.getName().replaceAll("^" + BluetoothSwap.BLUETOOTH_NAME_TAG, "");
}
示例4: BluetoothServer
import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public BluetoothServer(BluetoothSwap swap, File webRoot) {
this.webRoot = webRoot;
this.swap = swap;
start();
}