use of com.voipgrid.vialer.logging.RemoteLogger in project vialer-android by VoIPGRID.
the class AccountHelper method init.
/**
* Init the class by getting the KeyStore that contains encryption keys or make
* new keys when they do not exists yet.
*/
private void init() {
mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
mRemoteLogger = new RemoteLogger(AccountHelper.class);
// several workarounds.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
try {
mKeyStore = KeyStore.getInstance("AndroidKeyStore");
mKeyStore.load(null);
if (!mKeyStore.containsAlias(KEY_ALIAS)) {
generateKeyPair();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.voipgrid.vialer.logging.RemoteLogger in project vialer-android by VoIPGRID.
the class CallRecordFragment method failedFeedback.
private void failedFeedback(Response response) {
if (getActivity() == null) {
new RemoteLogger(CallRecordFragment.class).enableConsoleLogging().e("CallRecordFragment is no longer attached to an activity");
return;
}
String message = getString(R.string.empty_view_default_message);
// Check if authorized.
if (response != null && (response.code() == 401 || response.code() == 403)) {
message = getString(R.string.empty_view_unauthorized_message);
}
if (mAdapter.getCount() == 0) {
setEmptyView(new EmptyView(getActivity(), message), true);
} else {
// Adapter has cached values and we're not about to overwrite them. However,
// we do want to notify the user.
Snackbar.make(getView(), message, Snackbar.LENGTH_SHORT).show();
}
mSwipeRefreshLayout.setRefreshing(false);
}
use of com.voipgrid.vialer.logging.RemoteLogger in project vialer-android by VoIPGRID.
the class SyncUtils method setFullSyncInProgress.
/**
* Set the value of the fullSyncInProgress setting.
* @param inProgress
*/
public static void setFullSyncInProgress(Context context, boolean inProgress) {
new RemoteLogger(SyncUtils.class).d(TAG + " setFullSyncInProgress");
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(SyncConstants.FULL_SYNC_INPROGRESS, inProgress).apply();
}
use of com.voipgrid.vialer.logging.RemoteLogger in project vialer-android by VoIPGRID.
the class SyncUtils method setPeriodicSync.
/**
* Function to set the periodic sync interval (1 day) for a full contact sync.
* @param context
*/
public static void setPeriodicSync(Context context) {
new RemoteLogger(SyncUtils.class).d(TAG + " setPeriodicSync");
// job we can't really ask the user for permission.
if (!ContactsPermission.hasPermission(context)) {
// TODO VIALA-349 Delete sync account.
return;
}
Account account = checkSyncAccount(context);
// Full sync every day.
ContentResolver.addPeriodicSync(account, ContactsContract.AUTHORITY, new Bundle(), SyncConstants.PERIODIC_SYNC_INTERVAL);
}
use of com.voipgrid.vialer.logging.RemoteLogger in project vialer-android by VoIPGRID.
the class LoginRequiredActivity method onResume.
@Override
protected void onResume() {
super.onResume();
Preferences prefs = new Preferences(this);
if (!prefs.isLoggedIn() && prefs.finishedOnboarding()) {
new RemoteLogger(LoginRequiredActivity.class).w("Not logged in anymore! Redirecting to onboarding");
// Go to onboarding.
Intent intent = new Intent(new Intent(this, SetupActivity.class));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
}
}
Aggregations