|
@@ -1,8 +1,10 @@
|
|
|
package com.xplora.xpsettings.Activity;
|
|
|
|
|
|
+import android.Manifest;
|
|
|
import android.bluetooth.BluetoothAdapter;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.content.pm.PackageManager;
|
|
|
import android.graphics.Color;
|
|
|
import android.graphics.drawable.ColorDrawable;
|
|
|
import android.net.wifi.SupplicantState;
|
|
@@ -18,6 +20,7 @@ import android.util.Log;
|
|
|
import android.widget.ListView;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
+import androidx.core.app.ActivityCompat;
|
|
|
|
|
|
import com.xplora.xpsettings.Adapter.BaseListAdapter;
|
|
|
import com.xplora.xpsettings.Adapter.ConnectionsAdapter;
|
|
@@ -80,7 +83,7 @@ public class ConnectionsActivity extends BaseActivity {
|
|
|
} else {
|
|
|
ssid = ssid.replace("\"", "");
|
|
|
}
|
|
|
- subTitle = isConnected ? (ssid == null ? "" : ssid) : getString(R.string.data_roaming_off);
|
|
|
+ subTitle = isWifiOn ? (isConnected ? (ssid == null ? "" : ssid): "") : getString(R.string.data_roaming_off);
|
|
|
|
|
|
mDataList.get(1).isOn = isWifiOn;
|
|
|
mDataList.get(1).subTitle = subTitle;
|
|
@@ -147,11 +150,11 @@ public class ConnectionsActivity extends BaseActivity {
|
|
|
int isOn = msg.arg2;
|
|
|
BaseModel model = mDataList.get(index);
|
|
|
model.isOn = isOn >= 1;
|
|
|
- BtManager mBtManager = new BtManager(getBaseContext());
|
|
|
+ BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
|
|
if (model.isOn) {
|
|
|
- mBtManager.setEnable(true);
|
|
|
+ bluetoothAdapter.enable();
|
|
|
} else {
|
|
|
- mBtManager.setEnable(false);
|
|
|
+ bluetoothAdapter.disable();
|
|
|
}
|
|
|
}
|
|
|
}
|