Loading app/src/main/java/foundation/e/drive/EdriveApplication.java +7 −2 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ public class EdriveApplication extends Application { super.onCreate(); Log.i(TAG, "Starting"); resetOperationManagerSetting(); SharedPreferences prefs = getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); if (prefs.getString(AccountManager.KEY_ACCOUNT_NAME, null) != null) { prefs.edit().putBoolean(AppConstants.KEY_OMS_IS_WORKING, false).commit(); scheduleScannerJob(); } else { Account mAccount = CommonUtils.getAccount(getString(R.string.eelo_account_type), AccountManager.get(this)); Loading @@ -44,7 +44,6 @@ public class EdriveApplication extends Application { String accountType = mAccount.type; prefs.edit().putString(AccountManager.KEY_ACCOUNT_NAME, accountName) .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .putString(AccountManager.KEY_ACCOUNT_TYPE, accountType) .apply(); Loading @@ -59,6 +58,12 @@ public class EdriveApplication extends Application { } } private void resetOperationManagerSetting() { getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit() .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .apply(); } @Override public void onLowMemory() { super.onLowMemory(); Loading app/src/main/java/foundation/e/drive/services/OperationManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -290,4 +290,12 @@ public class OperationManagerService extends Service implements OnRemoteOperatio public IBinder onBind(Intent intent) { throw new UnsupportedOperationException(); } @Override public void onLowMemory() { Log.w(TAG, "System is low on memory. Service might get killed. Setting KEY_OMS_IS_WORKING to false"); getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit() .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .apply(); } } gradlew 100644 → 100755 +0 −0 File mode changed from 100644 to 100755. View file Loading
app/src/main/java/foundation/e/drive/EdriveApplication.java +7 −2 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ public class EdriveApplication extends Application { super.onCreate(); Log.i(TAG, "Starting"); resetOperationManagerSetting(); SharedPreferences prefs = getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); if (prefs.getString(AccountManager.KEY_ACCOUNT_NAME, null) != null) { prefs.edit().putBoolean(AppConstants.KEY_OMS_IS_WORKING, false).commit(); scheduleScannerJob(); } else { Account mAccount = CommonUtils.getAccount(getString(R.string.eelo_account_type), AccountManager.get(this)); Loading @@ -44,7 +44,6 @@ public class EdriveApplication extends Application { String accountType = mAccount.type; prefs.edit().putString(AccountManager.KEY_ACCOUNT_NAME, accountName) .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .putString(AccountManager.KEY_ACCOUNT_TYPE, accountType) .apply(); Loading @@ -59,6 +58,12 @@ public class EdriveApplication extends Application { } } private void resetOperationManagerSetting() { getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit() .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .apply(); } @Override public void onLowMemory() { super.onLowMemory(); Loading
app/src/main/java/foundation/e/drive/services/OperationManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -290,4 +290,12 @@ public class OperationManagerService extends Service implements OnRemoteOperatio public IBinder onBind(Intent intent) { throw new UnsupportedOperationException(); } @Override public void onLowMemory() { Log.w(TAG, "System is low on memory. Service might get killed. Setting KEY_OMS_IS_WORKING to false"); getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit() .putBoolean(AppConstants.KEY_OMS_IS_WORKING, false) .apply(); } }