fix: disable File Shuttle on Android Go devices
* Those won't work with SYSTEM_ALERT_WINDOW
This commit is contained in:
parent
f35f125c7d
commit
172522f3f9
|
@ -1,5 +1,7 @@
|
|||
package net.typeblog.shelter.ui;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
|
@ -90,6 +92,14 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Prefer
|
|||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
|
||||
mPrefCrossProfileFileChooser.setEnabled(false);
|
||||
}
|
||||
|
||||
// Disable FileShuttle for Android Go
|
||||
// as it requires SYSTEM_ALERT_WINDOW which
|
||||
// is not allowed on Go devices
|
||||
ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
if (am.isLowRamDevice()) {
|
||||
mPrefCrossProfileFileChooser.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue