mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2025-06-07 07:56:14 +00:00
Require Android 4.4 to restore messages
This commit is contained in:
parent
52e7fa109b
commit
45d7352c32
@ -35,6 +35,10 @@ public class RestoreMessagesActivity extends AppCompatActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_restore_messages);
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) {
|
||||
// Change message to define Android 4.4 or greated is required
|
||||
return;
|
||||
}
|
||||
|
||||
assert getIntent().getExtras() != null;
|
||||
|
||||
|
@ -37,7 +37,12 @@ public interface ASyncSMSRecovery {
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
// This feature is only available for Android 4.4 and greater
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) {
|
||||
return null;
|
||||
}
|
||||
Log.i(ASyncSMSRecovery.TAG, "Starting background recovery");
|
||||
|
||||
Long start = (long) 0;
|
||||
JSONObject obj = new OCSMSOwnCloudClient(_context, _account).retrieveSomeMessages(start, 500);
|
||||
try {
|
||||
|
@ -20,7 +20,6 @@ package fr.unix_experience.owncloud_sms.engine;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
@ -41,6 +40,7 @@ public interface ASyncSMSSync {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
Log.i(ASyncSMSSync.TAG, "Starting background sync");
|
||||
|
||||
// Get ownCloud SMS account list
|
||||
AccountManager _accountMgr = AccountManager.get(_context);
|
||||
Account[] myAccountList = _accountMgr.getAccountsByType(_context.getString(R.string.account_type));
|
||||
|
Loading…
x
Reference in New Issue
Block a user