|
|
@ -3,6 +3,7 @@ package qianmu.container.activity.device; |
|
|
import android.Manifest; |
|
|
import android.Manifest; |
|
|
import android.app.Activity; |
|
|
import android.app.Activity; |
|
|
import android.app.ActivityManager; |
|
|
import android.app.ActivityManager; |
|
|
|
|
|
import android.content.ActivityNotFoundException; |
|
|
import android.content.Intent; |
|
|
import android.content.Intent; |
|
|
import android.content.pm.PackageManager; |
|
|
import android.content.pm.PackageManager; |
|
|
import android.net.Uri; |
|
|
import android.net.Uri; |
|
|
@ -59,6 +60,18 @@ public class DeviceInfoActivity extends BaseActivity { |
|
|
serverInfo = new ViewServerInfo(this, binding.viewServerInfo.getRoot()); |
|
|
serverInfo = new ViewServerInfo(this, binding.viewServerInfo.getRoot()); |
|
|
deviceInfo = new ViewDeviceInfo(this, binding.viewDeviceInfo.getRoot()); |
|
|
deviceInfo = new ViewDeviceInfo(this, binding.viewDeviceInfo.getRoot()); |
|
|
inputPassword = new ViewInputPassword(this, binding.viewInputPassword.getRoot()); |
|
|
inputPassword = new ViewInputPassword(this, binding.viewInputPassword.getRoot()); |
|
|
|
|
|
try{ |
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
|
|
|
|
|
if(!Environment.isExternalStorageManager()){ |
|
|
|
|
|
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); |
|
|
|
|
|
intent.setData(Uri.parse("package:" + this.getPackageName())); |
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
ToastUtils.showToast("申请文件权限失败,请手动前往设置开启"); |
|
|
|
|
|
} |
|
|
setPermission(); |
|
|
setPermission(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -73,7 +86,6 @@ public class DeviceInfoActivity extends BaseActivity { |
|
|
boolean result = getIntent().getBooleanExtra(Constant.INPUT_PASSWORD, false); |
|
|
boolean result = getIntent().getBooleanExtra(Constant.INPUT_PASSWORD, false); |
|
|
if (result) showInputPassword(); |
|
|
if (result) showInputPassword(); |
|
|
else showServerInfo(); |
|
|
else showServerInfo(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|