mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 20:24:03 -04:00
Remove WRITE_SETTINGS permission for devices>=O
This commit is contained in:
parent
7fb1aa8fad
commit
e4e333ae21
@ -1792,15 +1792,15 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
switch (resultCode) {
|
||||
case Activity.RESULT_OK:
|
||||
// All required changes were successfully made
|
||||
Toast.makeText(MainActivity.this, states.isLocationPresent() + "", Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
Log.v("case 101", states.isLocationPresent() + "");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
wifiHotspotManager.turnOnHotspot();
|
||||
}
|
||||
break;
|
||||
case Activity.RESULT_CANCELED:
|
||||
// The user was asked to change settings, but chose not to
|
||||
Toast.makeText(MainActivity.this, "Canceled", Toast.LENGTH_SHORT).show();
|
||||
Log.v("case 101", "Canceled");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -39,7 +39,8 @@ public class WifiHotspotManager {
|
||||
|
||||
//To get write permission settings, we use this method.
|
||||
public void showWritePermissionSettings() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
if (!Settings.System.canWrite(this.context)) {
|
||||
Log.v("DANG", " " + !Settings.System.canWrite(this.context));
|
||||
Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user