Unused logs and permissions removed
This commit is contained in:
@@ -18,8 +18,6 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
getKVV().modules().list().reloadIfOutdated();
|
getKVV().modules().list().reloadIfOutdated();
|
||||||
}
|
}
|
||||||
isPaused = false;
|
isPaused = false;
|
||||||
//log.d("onResume", "send notification!");
|
|
||||||
//CustomNotificationManager.sendNotification(this, "Titel", "Neue Announcements!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -366,7 +364,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
private void registerSync() {
|
private void registerSync() {
|
||||||
Account accountByType = mAccountManager.getAccountByType(AccountGeneral.ACCOUNT_TYPE);
|
Account accountByType = mAccountManager.getAccountByType(AccountGeneral.ACCOUNT_TYPE);
|
||||||
log.d("registerSync", accountByType);
|
|
||||||
if (accountByType != null) {
|
if (accountByType != null) {
|
||||||
ContentResolver.setSyncAutomatically(accountByType, KVVContentProvider.PROVIDER_NAME, true);
|
ContentResolver.setSyncAutomatically(accountByType, KVVContentProvider.PROVIDER_NAME, true);
|
||||||
ContentResolver.addPeriodicSync(
|
ContentResolver.addPeriodicSync(
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
import de.sebse.fuplanner.services.kvv.types.LoginToken;
|
|
||||||
import de.sebse.fuplanner.services.kvv.sync.Login;
|
import de.sebse.fuplanner.services.kvv.sync.Login;
|
||||||
|
import de.sebse.fuplanner.services.kvv.types.LoginToken;
|
||||||
import de.sebse.fuplanner.tools.logging.Logger;
|
import de.sebse.fuplanner.tools.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
@@ -76,8 +76,6 @@ public class UserLoginTask extends AsyncTask<Void, Void, String> {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
log.d(login.get());
|
|
||||||
|
|
||||||
if (login.get() == null) {
|
if (login.get() == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import android.content.Context;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import de.sebse.fuplanner.services.kvv.types.LoginToken;
|
|
||||||
import de.sebse.fuplanner.services.fulogin.AccountGeneral;
|
import de.sebse.fuplanner.services.fulogin.AccountGeneral;
|
||||||
|
import de.sebse.fuplanner.services.kvv.types.LoginToken;
|
||||||
import de.sebse.fuplanner.tools.CustomAccountManager;
|
import de.sebse.fuplanner.tools.CustomAccountManager;
|
||||||
import de.sebse.fuplanner.tools.NetworkCallbackCollector;
|
import de.sebse.fuplanner.tools.NetworkCallbackCollector;
|
||||||
import de.sebse.fuplanner.tools.network.HTTPService;
|
import de.sebse.fuplanner.tools.network.HTTPService;
|
||||||
@@ -34,7 +34,6 @@ public class Login extends HTTPService {
|
|||||||
LoginToken.load(mListener.getAccountManager(), token -> {
|
LoginToken.load(mListener.getAccountManager(), token -> {
|
||||||
boolean result = setToken(token);
|
boolean result = setToken(token);
|
||||||
mLoginPending = false;
|
mLoginPending = false;
|
||||||
log.d("loginToken", token != null ? token.toString() : null);
|
|
||||||
callback.run(result);
|
callback.run(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ public class ModulesList extends HTTPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void upgrade(final NetworkCallback<Modules> callback, final NetworkErrorCallback errorCallback) {
|
private void upgrade(final NetworkCallback<Modules> callback, final NetworkErrorCallback errorCallback) {
|
||||||
log.d(mLogin.isInOnlineMode(), mLogin.getLoginToken());
|
|
||||||
if (!mLogin.isInOnlineMode() || mLogin.getLoginToken() == null) {
|
if (!mLogin.isInOnlineMode() || mLogin.getLoginToken() == null) {
|
||||||
errorCallback.onError(new NetworkError(101105, 500, "Currently running in offline mode!"));
|
errorCallback.onError(new NetworkError(101105, 500, "Currently running in offline mode!"));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
mKVV = new KVV(new KVVListener() {
|
mKVV = new KVV(new KVVListener() {
|
||||||
|
|
||||||
CustomAccountManager accountManager = null;
|
CustomAccountManager accountManager = null;
|
||||||
@Override
|
@Override
|
||||||
public CustomAccountManager getAccountManager() {
|
public CustomAccountManager getAccountManager() {
|
||||||
@@ -66,7 +67,6 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
}, context);
|
}, context);
|
||||||
mQueue.add(() -> {
|
mQueue.add(() -> {
|
||||||
mKVV.account().restoreOnlineLogin(bool -> {
|
mKVV.account().restoreOnlineLogin(bool -> {
|
||||||
log.d("login restored");
|
|
||||||
mQueue.next();
|
mQueue.next();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -84,14 +84,11 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
String authority,
|
String authority,
|
||||||
ContentProviderClient provider,
|
ContentProviderClient provider,
|
||||||
SyncResult syncResult) {
|
SyncResult syncResult) {
|
||||||
log.d("onPerformSync");
|
|
||||||
mQueue.add(() -> {
|
mQueue.add(() -> {
|
||||||
log.d("start syncing");
|
|
||||||
mKVV.modules().list().recv(success -> {
|
mKVV.modules().list().recv(success -> {
|
||||||
Iterator<Modules.Module> iterator = success.latestSemesterIterator();
|
Iterator<Modules.Module> iterator = success.latestSemesterIterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Modules.Module module = iterator.next();
|
Modules.Module module = iterator.next();
|
||||||
log.d("sync module", module.title);
|
|
||||||
final ArrayList<Announcement> announcements = module.announcements;
|
final ArrayList<Announcement> announcements = module.announcements;
|
||||||
final AssignmentList assignments = module.assignments;
|
final AssignmentList assignments = module.assignments;
|
||||||
final EventList events = module.events;
|
final EventList events = module.events;
|
||||||
@@ -99,7 +96,6 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
final ArrayList<Resource> resources = module.resources;
|
final ArrayList<Resource> resources = module.resources;
|
||||||
mKVV.modules().details().recv(module, success1 -> {
|
mKVV.modules().details().recv(module, success1 -> {
|
||||||
if (success1.second) {
|
if (success1.second) {
|
||||||
log.d("Sync Successful for Module '"+module.title+"'!");
|
|
||||||
sendNotifications(announcements, module.announcements, module.title, Announcement::getTitle, Announcement::getId,
|
sendNotifications(announcements, module.announcements, module.title, Announcement::getTitle, Announcement::getId,
|
||||||
R.string.announcement_updated, R.string.announcement_added, R.string.announcement_removed);
|
R.string.announcement_updated, R.string.announcement_added, R.string.announcement_removed);
|
||||||
sendNotifications(assignments, module.assignments, module.title, Assignment::getTitle, Assignment::getId,
|
sendNotifications(assignments, module.assignments, module.title, Assignment::getTitle, Assignment::getId,
|
||||||
@@ -121,7 +117,6 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
log.e(msg);
|
log.e(msg);
|
||||||
mQueue.next();
|
mQueue.next();
|
||||||
}, true);
|
}, true);
|
||||||
log.d("finished");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user