mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -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) {
|
switch (resultCode) {
|
||||||
case Activity.RESULT_OK:
|
case Activity.RESULT_OK:
|
||||||
// All required changes were successfully made
|
// All required changes were successfully made
|
||||||
Toast.makeText(MainActivity.this, states.isLocationPresent() + "", Toast.LENGTH_SHORT)
|
Log.v("case 101", states.isLocationPresent() + "");
|
||||||
.show();
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
wifiHotspotManager.turnOnHotspot();
|
wifiHotspotManager.turnOnHotspot();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Activity.RESULT_CANCELED:
|
case Activity.RESULT_CANCELED:
|
||||||
// The user was asked to change settings, but chose not to
|
// 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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -39,7 +39,8 @@ public class WifiHotspotManager {
|
|||||||
|
|
||||||
//To get write permission settings, we use this method.
|
//To get write permission settings, we use this method.
|
||||||
public void showWritePermissionSettings() {
|
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)) {
|
if (!Settings.System.canWrite(this.context)) {
|
||||||
Log.v("DANG", " " + !Settings.System.canWrite(this.context));
|
Log.v("DANG", " " + !Settings.System.canWrite(this.context));
|
||||||
Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
|
Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user