|
@@ -37,6 +37,7 @@ import android.widget.Toast;
|
|
|
import com.usai.util.AES;
|
|
import com.usai.util.AES;
|
|
|
import com.usai.util.Crypto;
|
|
import com.usai.util.Crypto;
|
|
|
import com.usai.util.Network;
|
|
import com.usai.util.Network;
|
|
|
|
|
+import com.usai.util.RAUtil;
|
|
|
import com.usai.util.dbUtil;
|
|
import com.usai.util.dbUtil;
|
|
|
import com.usai.util.dbgUtil;
|
|
import com.usai.util.dbgUtil;
|
|
|
|
|
|
|
@@ -409,8 +410,10 @@ public class FullScreenLoginActivity extends Activity {
|
|
|
|
|
|
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
|
|
|
|
|
|
- String server=data.getStringExtra("server");
|
|
|
|
|
- m_etServer.setText(server);
|
|
|
|
|
|
|
+ if (resultCode == Activity.RESULT_OK && data != null) {
|
|
|
|
|
+ String server=data.getStringExtra("server");
|
|
|
|
|
+ m_etServer.setText(server);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -544,24 +547,24 @@ public class FullScreenLoginActivity extends Activity {
|
|
|
|
|
|
|
|
boolean granted = checkAllPermission();
|
|
boolean granted = checkAllPermission();
|
|
|
if (!granted) {
|
|
if (!granted) {
|
|
|
- new AlertDialog.Builder(this)
|
|
|
|
|
- .setTitle("Warning")
|
|
|
|
|
- .setMessage("RA Image need some permission")
|
|
|
|
|
- .setPositiveButton("Setting", new DialogInterface.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
- Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
|
|
- intent.setData(Uri.parse("package:" + getPackageName()));
|
|
|
|
|
- startActivity(intent);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .setNegativeButton("No", new DialogInterface.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
- finish();
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .show();
|
|
|
|
|
|
|
+// new AlertDialog.Builder(this)
|
|
|
|
|
+// .setTitle("Warning")
|
|
|
|
|
+// .setMessage("RA Image need some permission")
|
|
|
|
|
+// .setPositiveButton("Setting", new DialogInterface.OnClickListener() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
+// Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
|
|
+// intent.setData(Uri.parse("package:" + getPackageName()));
|
|
|
|
|
+// startActivity(intent);
|
|
|
|
|
+// }
|
|
|
|
|
+// })
|
|
|
|
|
+// .setNegativeButton("No", new DialogInterface.OnClickListener() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
+// finish();
|
|
|
|
|
+// }
|
|
|
|
|
+// })
|
|
|
|
|
+// .show();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -582,7 +585,7 @@ public class FullScreenLoginActivity extends Activity {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
for(String permission : permissions) {
|
|
for(String permission : permissions) {
|
|
|
- boolean granted = checkPermission(permission);
|
|
|
|
|
|
|
+ boolean granted = RAUtil.checkPermission(this,permission);
|
|
|
if (!granted) {
|
|
if (!granted) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -591,12 +594,12 @@ public class FullScreenLoginActivity extends Activity {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public boolean checkPermission(String per) {
|
|
|
|
|
- int permission = ContextCompat.checkSelfPermission(FullScreenLoginActivity.this, per);
|
|
|
|
|
- if (permission == PackageManager.PERMISSION_DENIED) {
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// public boolean checkPermission(String per) {
|
|
|
|
|
+// int permission = ContextCompat.checkSelfPermission(FullScreenLoginActivity.this, per);
|
|
|
|
|
+// if (permission == PackageManager.PERMISSION_DENIED) {
|
|
|
|
|
+//
|
|
|
|
|
+// return false;
|
|
|
|
|
+// }
|
|
|
|
|
+// return true;
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|