Replace TextUtils.isEmpty with isNullOrEmpty

pull/996/head
Alex Baker 5 years ago
parent 2f8ac10e47
commit 76febd39bd

@ -16,7 +16,8 @@
package org.tasks.billing;
import android.text.TextUtils;
import static org.tasks.Strings.isNullOrEmpty;
import android.util.Base64;
import com.android.billingclient.util.BillingHelper;
import java.io.IOException;
@ -49,9 +50,9 @@ class Security {
*/
static boolean verifyPurchase(String base64PublicKey, String signedData, String signature)
throws IOException {
if (TextUtils.isEmpty(signedData)
|| TextUtils.isEmpty(base64PublicKey)
|| TextUtils.isEmpty(signature)) {
if (isNullOrEmpty(signedData)
|| isNullOrEmpty(base64PublicKey)
|| isNullOrEmpty(signature)) {
BillingHelper.logWarn(TAG, "Purchase verification failed: missing data.");
return false;
}

@ -6,7 +6,8 @@
package com.todoroo.andlib.data;
import android.text.TextUtils;
import static org.tasks.Strings.isNullOrEmpty;
import com.todoroo.andlib.sql.Field;
/**
@ -56,7 +57,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
/** Return a clone of this property */
Property<TYPE> cloneAs(String tableAlias, String columnAlias) {
Table aliasedTable = this.table;
if (!TextUtils.isEmpty(tableAlias)) {
if (!isNullOrEmpty(tableAlias)) {
aliasedTable = table.as(tableAlias);
}
@ -65,7 +66,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
this.getClass()
.getConstructor(Table.class, String.class)
.newInstance(aliasedTable, this.name);
if (!TextUtils.isEmpty(columnAlias)) {
if (!isNullOrEmpty(columnAlias)) {
return (Property<TYPE>) newInstance.as(columnAlias);
}
return newInstance;

@ -1,6 +1,7 @@
package com.todoroo.astrid.adapter;
import android.text.TextUtils;
import static org.tasks.Strings.isNullOrEmpty;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.dao.TaskDao;
@ -123,7 +124,7 @@ public final class AstridTaskAdapter extends TaskAdapter {
boolean madeChanges = false;
for (Task t : tasks) {
if (!TextUtils.isEmpty(t.getRecurrence())) {
if (!isNullOrEmpty(t.getRecurrence())) {
updater.moveToParentOf(t.getUuid(), itemId);
madeChanges = true;
}

@ -1,7 +1,8 @@
package com.todoroo.astrid.adapter;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Context;
import android.text.TextUtils;
import com.todoroo.astrid.api.CaldavFilter;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.GtasksFilter;
@ -119,13 +120,13 @@ public class TaskAdapterProvider {
filterId = TaskListMetadata.FILTER_ID_TODAY;
prefId = SubtasksFilterUpdater.TODAY_TASKS_ORDER;
}
if (TextUtils.isEmpty(filterId)) {
if (isNullOrEmpty(filterId)) {
return null;
}
TaskListMetadata list = taskListMetadataDao.fetchByTagOrFilter(filterId);
if (list == null) {
String defaultOrder = preferences.getStringValue(prefId);
if (TextUtils.isEmpty(defaultOrder)) {
if (isNullOrEmpty(defaultOrder)) {
defaultOrder = "[]"; // $NON-NLS-1$
}
defaultOrder = SubtasksHelper.convertTreeToRemoteIds(taskDao, defaultOrder);

@ -14,7 +14,6 @@ import static org.tasks.date.DateTimeUtils.newDateTime;
import android.content.ContentValues;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.annotation.IntDef;
import androidx.core.os.ParcelCompat;
import androidx.room.ColumnInfo;
@ -325,7 +324,7 @@ public class Task implements Parcelable {
}
public static boolean isUuidEmpty(String uuid) {
return NO_UUID.equals(uuid) || TextUtils.isEmpty(uuid);
return NO_UUID.equals(uuid) || isNullOrEmpty(uuid);
}
public long getId() {
@ -569,7 +568,7 @@ public class Task implements Parcelable {
}
public boolean hasNotes() {
return !TextUtils.isEmpty(notes);
return !isNullOrEmpty(notes);
}
public Long getModificationDate() {

@ -6,12 +6,13 @@
package com.todoroo.astrid.gcal;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.provider.CalendarContract;
import android.text.TextUtils;
import android.text.format.Time;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.dao.TaskDao;
@ -53,7 +54,7 @@ public class GCalHelper {
private String getTaskEventUri(Task task) {
String uri;
if (!TextUtils.isEmpty(task.getCalendarURI())) {
if (!isNullOrEmpty(task.getCalendarURI())) {
uri = task.getCalendarURI();
} else {
task = taskDao.fetch(task.getId());
@ -93,7 +94,7 @@ public class GCalHelper {
String eventuri = getTaskEventUri(task);
if (!TextUtils.isEmpty(eventuri) && deleteEventIfExists) {
if (!isNullOrEmpty(eventuri) && deleteEventIfExists) {
calendarEventProvider.deleteEvent(task);
}
@ -103,10 +104,10 @@ public class GCalHelper {
values.put(CalendarContract.Events.HAS_ALARM, 0);
boolean valuesContainCalendarId =
(values.containsKey(CalendarContract.Events.CALENDAR_ID)
&& !TextUtils.isEmpty(values.getAsString(CalendarContract.Events.CALENDAR_ID)));
&& !isNullOrEmpty(values.getAsString(CalendarContract.Events.CALENDAR_ID)));
if (!valuesContainCalendarId) {
String calendarId = preferences.getDefaultCalendar();
if (!TextUtils.isEmpty(calendarId)) {
if (!isNullOrEmpty(calendarId)) {
values.put(CalendarContract.Events.CALENDAR_ID, calendarId);
}
}
@ -128,7 +129,7 @@ public class GCalHelper {
public void rescheduleRepeatingTask(Task task) {
String taskUri = getTaskEventUri(task);
if (TextUtils.isEmpty(taskUri)) {
if (isNullOrEmpty(taskUri)) {
return;
}

@ -15,7 +15,6 @@ import static org.tasks.time.DateTimeUtils.currentTimeMillis;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -235,7 +234,7 @@ public class RepeatControlSet extends TaskEditControlFragment {
}
copy.setUntil(null);
String result = copy.toIcal();
if (repeatAfterCompletion && !TextUtils.isEmpty(result)) {
if (repeatAfterCompletion && !isNullOrEmpty(result)) {
result += ";FROM=COMPLETION"; // $NON-NLS-1$
}

@ -2,10 +2,10 @@ package com.todoroo.astrid.service;
import static com.todoroo.andlib.utility.DateUtilities.now;
import static com.todoroo.astrid.helper.UUIDHelper.newUUID;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.ContentValues;
import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.api.CaldavFilter;
@ -84,9 +84,9 @@ public class TaskCreator {
boolean gcalCreateEventEnabled =
preferences.isDefaultCalendarSet() && task.hasDueDate(); // $NON-NLS-1$
if (!TextUtils.isEmpty(task.getTitle())
if (!isNullOrEmpty(task.getTitle())
&& gcalCreateEventEnabled
&& TextUtils.isEmpty(task.getCalendarURI())) {
&& isNullOrEmpty(task.getCalendarURI())) {
Uri calendarUri = gcalHelper.createTaskEvent(task, new ContentValues());
task.setCalendarUri(calendarUri.toString());
}

@ -1,8 +1,8 @@
package com.todoroo.astrid.subtasks;
import static org.tasks.Strings.isNullOrEmpty;
import static org.tasks.db.QueryUtils.showHiddenAndCompleted;
import android.text.TextUtils;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
@ -110,7 +110,7 @@ public class SubtasksFilterUpdater {
return "[]"; // $NON-NLS-1$
}
String order = list.getTaskIds();
if (TextUtils.isEmpty(order) || "null".equals(order)) // $NON-NLS-1$
if (isNullOrEmpty(order) || "null".equals(order)) // $NON-NLS-1$
{
order = "[]"; // $NON-NLS-1$
}

@ -1,9 +1,9 @@
package com.todoroo.astrid.subtasks;
import static org.tasks.Strings.isNullOrEmpty;
import static org.tasks.db.QueryUtils.showHidden;
import android.content.Context;
import android.text.TextUtils;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.GtasksFilter;
import com.todoroo.astrid.core.BuiltInFilterExposer;
@ -52,7 +52,7 @@ public class SubtasksHelper {
serializedTree.split("[\\[\\],\\s]"); // Split on [ ] , or whitespace chars
for (String idString : digitsOnly) {
try {
if (!TextUtils.isEmpty(idString)) {
if (!isNullOrEmpty(idString)) {
ids.add(Long.parseLong(idString));
}
} catch (NumberFormatException e) {
@ -66,7 +66,7 @@ public class SubtasksHelper {
ArrayList<String> ids = new ArrayList<>();
String[] values = serializedTree.split("[\\[\\],\"\\s]"); // Split on [ ] , or whitespace chars
for (String idString : values) {
if (!TextUtils.isEmpty(idString)) {
if (!isNullOrEmpty(idString)) {
ids.add(idString);
}
}

@ -6,11 +6,12 @@
package com.todoroo.astrid.timers;
import static org.tasks.Strings.isNullOrEmpty;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
@ -196,11 +197,11 @@ public class TimerControlSet extends TaskEditControlFragment {
String toDisplay;
if (!TextUtils.isEmpty(est) && !TextUtils.isEmpty(elap)) {
if (!isNullOrEmpty(est) && !isNullOrEmpty(elap)) {
toDisplay = est + ", " + elap; // $NON-NLS-1$
} else if (!TextUtils.isEmpty(est)) {
} else if (!isNullOrEmpty(est)) {
toDisplay = est;
} else if (!TextUtils.isEmpty(elap)) {
} else if (!isNullOrEmpty(elap)) {
toDisplay = elap;
} else {
toDisplay = null;

@ -6,7 +6,8 @@
package com.todoroo.astrid.utility;
import android.text.TextUtils;
import static org.tasks.Strings.isNullOrEmpty;
import com.google.ical.values.Frequency;
import com.google.ical.values.RRule;
import com.mdimension.jchronic.AstridChronic;
@ -369,7 +370,7 @@ public class TitleParser {
if (cal
!= null) { // if at least one of the above has been called, write to task. else do nothing.
if (!TextUtils.isEmpty(inputText)) {
if (!isNullOrEmpty(inputText)) {
task.setTitle(inputText);
}
if (containsSpecificTime) {

@ -6,7 +6,6 @@
package org.tasks.activities;
import static android.text.TextUtils.isEmpty;
import static com.google.common.collect.Iterables.find;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Lists.transform;
@ -288,7 +287,7 @@ public class FilterSettingsActivity extends BaseListSettingsActivity {
protected void save() {
String newName = getNewName();
if (isEmpty(newName)) {
if (isNullOrEmpty(newName)) {
nameLayout.setError(getString(R.string.name_cannot_be_empty));
return;
}

@ -1,6 +1,6 @@
package org.tasks.activities;
import static android.text.TextUtils.isEmpty;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Context;
import android.content.Intent;
@ -129,7 +129,7 @@ public class GoogleTaskListSettingsActivity extends BaseListSettingsActivity {
String newName = getNewName();
if (isEmpty(newName)) {
if (isNullOrEmpty(newName)) {
Toast.makeText(this, R.string.name_cannot_be_empty, Toast.LENGTH_LONG).show();
return;
}
@ -193,7 +193,7 @@ public class GoogleTaskListSettingsActivity extends BaseListSettingsActivity {
@Override
protected boolean hasChanges() {
if (isNewList) {
return selectedColor >= 0 || !isEmpty(getNewName());
return selectedColor >= 0 || !isNullOrEmpty(getNewName());
}
return colorChanged() || nameChanged() || iconChanged();
}

@ -6,7 +6,7 @@
package org.tasks.activities;
import static android.text.TextUtils.isEmpty;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Context;
import android.content.Intent;
@ -63,7 +63,7 @@ public class TagSettingsActivity extends BaseListSettingsActivity {
name.setText(tagData.getName());
String autopopulateName = getIntent().getStringExtra(TOKEN_AUTOPOPULATE_NAME);
if (!isEmpty(autopopulateName)) {
if (!isNullOrEmpty(autopopulateName)) {
name.setText(autopopulateName);
getIntent().removeExtra(TOKEN_AUTOPOPULATE_NAME);
} else if (isNewTag) {
@ -108,7 +108,7 @@ public class TagSettingsActivity extends BaseListSettingsActivity {
protected void save() {
String newName = getNewName();
if (isEmpty(newName)) {
if (isNullOrEmpty(newName)) {
nameLayout.setError(getString(R.string.name_cannot_be_empty));
return;
}
@ -142,7 +142,7 @@ public class TagSettingsActivity extends BaseListSettingsActivity {
@Override
protected boolean hasChanges() {
if (isNewTag) {
return selectedColor >= 0 || selectedIcon >= 0 || !isEmpty(getNewName());
return selectedColor >= 0 || selectedIcon >= 0 || !isNullOrEmpty(getNewName());
}
return !(selectedColor == tagData.getColor()
&& selectedIcon == tagData.getIcon()

@ -1,6 +1,5 @@
package org.tasks.caldav;
import static android.text.TextUtils.isEmpty;
import static com.todoroo.astrid.data.Task.NO_ID;
import static org.tasks.Strings.isNullOrEmpty;
@ -8,6 +7,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.view.MenuItem;
import android.view.View;
@ -82,7 +82,7 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
binding.name.setText(caldavAccount.getName());
binding.url.setText(caldavAccount.getUrl());
binding.user.setText(caldavAccount.getUsername());
if (!isEmpty(caldavAccount.getPassword())) {
if (!isNullOrEmpty(caldavAccount.getPassword())) {
binding.password.setText(PASSWORD_MASK);
}
binding.repeat.setChecked(caldavAccount.isSuppressRepeatingTasks());
@ -165,7 +165,7 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
binding.password.setText("");
}
} else {
if (isEmpty(binding.password.getText()) && caldavAccount != null) {
if (TextUtils.isEmpty(binding.password.getText()) && caldavAccount != null) {
binding.password.setText(PASSWORD_MASK);
}
}
@ -201,7 +201,7 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
boolean failed = false;
if (isEmpty(url)) {
if (isNullOrEmpty(url)) {
binding.urlLayout.setError(getString(R.string.url_required));
failed = true;
} else {
@ -209,7 +209,7 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
String scheme = baseURL.getScheme();
if ("https".equalsIgnoreCase(scheme) || "http".equalsIgnoreCase(scheme)) {
String host = baseURL.getHost();
if (isEmpty(host)) {
if (isNullOrEmpty(host)) {
binding.urlLayout.setError(getString(R.string.url_host_name_required));
failed = true;
} else {
@ -233,12 +233,12 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
}
}
if (isEmpty(username)) {
if (isNullOrEmpty(username)) {
binding.userLayout.setError(getString(R.string.username_required));
failed = true;
}
if (isEmpty(password)) {
if (isNullOrEmpty(password)) {
binding.passwordLayout.setError(getString(R.string.password_required));
failed = true;
}
@ -308,10 +308,10 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA
private boolean hasChanges() {
if (caldavAccount == null) {
return !isEmpty(binding.name.getText().toString().trim())
|| !isEmpty(getNewPassword())
|| !isEmpty(binding.url.getText().toString().trim())
|| !isEmpty(getNewUsername())
return !isNullOrEmpty(binding.name.getText().toString().trim())
|| !isNullOrEmpty(getNewPassword())
|| !isNullOrEmpty(binding.url.getText().toString().trim())
|| !isNullOrEmpty(getNewUsername())
|| binding.repeat.isChecked();
}
return needsValidation()

@ -1,6 +1,6 @@
package org.tasks.caldav;
import static android.text.TextUtils.isEmpty;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Context;
import android.content.Intent;
@ -114,7 +114,7 @@ public abstract class BaseCaldavCalendarSettingsActivity extends BaseListSetting
String name = getNewName();
if (isEmpty(name)) {
if (isNullOrEmpty(name)) {
nameLayout.setError(getString(R.string.name_cannot_be_empty));
return;
}
@ -211,7 +211,7 @@ public abstract class BaseCaldavCalendarSettingsActivity extends BaseListSetting
@Override
protected boolean hasChanges() {
return caldavCalendar == null
? !isEmpty(getNewName()) || selectedColor != 0 || selectedIcon != -1
? !isNullOrEmpty(getNewName()) || selectedColor != 0 || selectedIcon != -1
: nameChanged() || iconChanged() || colorChanged();
}

@ -1,9 +1,9 @@
package org.tasks.caldav;
import static android.text.TextUtils.isEmpty;
import static at.bitfire.dav4jvm.XmlUtils.NS_CALDAV;
import static at.bitfire.dav4jvm.XmlUtils.NS_CARDDAV;
import static at.bitfire.dav4jvm.XmlUtils.NS_WEBDAV;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Context;
import at.bitfire.cert4android.CustomCertManager;
@ -148,7 +148,7 @@ public class CaldavClient {
CurrentUserPrincipal currentUserPrincipal = response.get(CurrentUserPrincipal.class);
if (currentUserPrincipal != null) {
String href = currentUserPrincipal.getHref();
if (!isEmpty(href)) {
if (!isNullOrEmpty(href)) {
return href;
}
}
@ -170,7 +170,7 @@ public class CaldavClient {
throw new DisplayableException(R.string.caldav_home_set_not_found);
}
String homeSet = hrefs.get(0);
if (isEmpty(homeSet)) {
if (isNullOrEmpty(homeSet)) {
throw new DisplayableException(R.string.caldav_home_set_not_found);
}
return davResource.getLocation().resolve(homeSet).toString();
@ -192,7 +192,7 @@ public class CaldavClient {
principal = tryFindPrincipal("");
}
return forUrl(
(isEmpty(principal) ? this.httpUrl : httpUrl.resolve(principal)).toString(),
(isNullOrEmpty(principal) ? this.httpUrl : httpUrl.resolve(principal)).toString(),
basicDigestAuthHandler.getUsername(),
basicDigestAuthHandler.getPassword())
.findHomeset();

@ -1,13 +1,13 @@
package org.tasks.calendars;
import static android.provider.BaseColumns._ID;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.CalendarContract;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.todoroo.astrid.data.Task;
import java.util.ArrayList;
@ -71,7 +71,7 @@ public class CalendarEventProvider {
}
private void deleteEvent(String eventUri) {
if (!TextUtils.isEmpty(eventUri)) {
if (!isNullOrEmpty(eventUri)) {
deleteEvent(Uri.parse(eventUri));
}
}

@ -1,6 +1,6 @@
package org.tasks.etesync;
import static android.text.TextUtils.isEmpty;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.Intent;
import android.net.Uri;
@ -111,7 +111,7 @@ public class EncryptionSettingsActivity extends ThemedInjectingAppCompatActivity
String encryptionPassword = getNewEncryptionPassword();
String derivedKey = caldavAccount.getEncryptionPassword(encryption);
if (isEmpty(encryptionPassword) && isEmpty(derivedKey)) {
if (isNullOrEmpty(encryptionPassword) && isNullOrEmpty(derivedKey)) {
binding.encryptionPasswordLayout.setError(getString(R.string.encryption_password_required));
return;
}
@ -125,7 +125,7 @@ public class EncryptionSettingsActivity extends ThemedInjectingAppCompatActivity
}
String key =
isEmpty(encryptionPassword)
isNullOrEmpty(encryptionPassword)
? derivedKey
: Crypto.deriveKey(caldavAccount.getUsername(), encryptionPassword);
CryptoManager cryptoManager;

@ -10,7 +10,6 @@ import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@ -205,7 +204,7 @@ public class CommentBarFragment extends TaskEditControlFragment {
private void addComment(String message) {
// Allow for users to just add picture
if (TextUtils.isEmpty(message)) {
if (isNullOrEmpty(message)) {
message = " ";
}
Uri picture = pendingCommentPicture;

@ -5,7 +5,6 @@ import static org.tasks.Strings.isNullOrEmpty;
import static org.tasks.date.DateTimeUtils.newDateTime;
import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.services.tasks.model.TaskList;
@ -286,7 +285,7 @@ public class GoogleTaskSynchronizer {
// If task was newly created but without a title, don't sync--we're in the middle of
// creating a task which may end up being cancelled. Also don't sync new but already
// deleted tasks
if (newlyCreated && (TextUtils.isEmpty(task.getTitle()) || task.getDeletionDate() > 0)) {
if (newlyCreated && (isNullOrEmpty(task.getTitle()) || task.getDeletionDate() > 0)) {
return;
}
@ -481,7 +480,7 @@ public class GoogleTaskSynchronizer {
}
private void write(Task task, GoogleTask googleTask) {
if (!(TextUtils.isEmpty(task.getTitle()) && TextUtils.isEmpty(task.getNotes()))) {
if (!(isNullOrEmpty(task.getTitle()) && isNullOrEmpty(task.getNotes()))) {
task.suppressSync();
task.suppressRefresh();
if (task.isNew()) {

@ -1,13 +1,13 @@
package org.tasks.jobs;
import static com.todoroo.astrid.dao.TaskDao.TRANS_SUPPRESS_REFRESH;
import static org.tasks.Strings.isNullOrEmpty;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.provider.CalendarContract;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.work.Data;
import androidx.work.Data.Builder;
@ -129,7 +129,7 @@ public class AfterSaveWork extends InjectingWorker {
private void updateCalendarTitle(Task task) {
String calendarUri = task.getCalendarURI();
if (!TextUtils.isEmpty(calendarUri)) {
if (!isNullOrEmpty(calendarUri)) {
try {
// change title of calendar event
ContentResolver cr = context.getContentResolver();

@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.google.common.base.Joiner;
@ -332,7 +331,7 @@ public class NotificationManager {
}
// new task edit in progress
if (TextUtils.isEmpty(task.getTitle())) {
if (isNullOrEmpty(task.getTitle())) {
return null;
}

@ -16,7 +16,6 @@ import android.content.pm.PackageManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Binder;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.documentfile.provider.DocumentFile;
@ -228,7 +227,7 @@ public class Preferences {
}
public boolean isStringValueSet(int keyResource) {
return !TextUtils.isEmpty(getStringValue(keyResource));
return !isNullOrEmpty(getStringValue(keyResource));
}
public int getDefaultReminders() {

Loading…
Cancel
Save