Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitsaibot authored and jspricke committed Jan 19, 2024
1 parent b8c2461 commit 62b75dc
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/android/calendar/AllInOneActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void run() {
protected void onNewIntent(Intent intent) {
String action = intent.getAction();
if (DEBUG)
Log.d(TAG, "New intent received " + intent.toString());
Log.d(TAG, "New intent received " + intent);
// Don't change the date if we're just returning to the app's home
if (Intent.ACTION_VIEW.equals(action)
&& !intent.getBooleanExtra(Utils.INTENT_KEY_HOME, false)) {
Expand Down Expand Up @@ -301,7 +301,7 @@ protected void onCreate(Bundle icicle) {

if (DEBUG) {
if (icicle != null && intent != null) {
Log.d(TAG, "both, icicle:" + icicle.toString() + " intent:" + intent.toString());
Log.d(TAG, "both, icicle:" + icicle + " intent:" + intent);
} else {
Log.d(TAG, "not both, icicle:" + icicle + " intent:" + intent);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/android/calendar/DayView.java
Original file line number Diff line number Diff line change
Expand Up @@ -4370,7 +4370,7 @@ public boolean onTouchEvent(MotionEvent ev) {
return true;

default:
if (DEBUG) Log.e(TAG, "Not MotionEvent " + ev.toString());
if (DEBUG) Log.e(TAG, "Not MotionEvent " + ev);
if (mGestureDetector.onTouchEvent(ev)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected void onCreate(Bundle icicle) {
continue;
}
} catch (DateException e) {
if (debug) Log.d(TAG, "duration:" + e.toString());
if (debug) Log.d(TAG, "duration:" + e);
continue;
}
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/android/calendar/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ public static HashMap<Integer, DNAStrand> createDNAStrands(int firstJulianDay,
segments.add(i + 1, rhs);
strands.get(rhs.color).count++;
if (DEBUG) {
Log.d(TAG, "Added rhs, curr:" + currSegment.toString() + " i:"
Log.d(TAG, "Added rhs, curr:" + currSegment + " i:"
+ segments.get(i).toString());
}
}
Expand All @@ -1201,7 +1201,7 @@ public static HashMap<Integer, DNAStrand> createDNAStrands(int firstJulianDay,
segments.add(i++, lhs);
strands.get(lhs.color).count++;
if (DEBUG) {
Log.d(TAG, "Added lhs, curr:" + currSegment.toString() + " i:"
Log.d(TAG, "Added lhs, curr:" + currSegment + " i:"
+ segments.get(i).toString());
}
}
Expand Down Expand Up @@ -1346,7 +1346,7 @@ private static int getPixelOffsetFromMinutes(int minute, int workDayHeight,
private static void addNewSegment(LinkedList<DNASegment> segments, Event event,
HashMap<Integer, DNAStrand> strands, int firstJulianDay, int minStart, int minMinutes) {
if (event.startDay > event.endDay) {
Log.wtf(TAG, "Event starts after it ends: " + event.toString());
Log.wtf(TAG, "Event starts after it ends: " + event);
}
// If this is a multiday event split it up by day
if (event.startDay != event.endDay) {
Expand Down Expand Up @@ -1985,7 +1985,7 @@ public static Spannable extendedLinkify(String text, boolean lastDitchGeo) {
dialBuilder.append(ch);
}
}
URLSpan span = new URLSpan("tel:" + dialBuilder.toString());
URLSpan span = new URLSpan("tel:" + dialBuilder);

spanText.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
phoneCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void onCreate(Bundle icicle) {
if (prevTime != -1) {
mTime.set(prevTime);
if (DEBUG) {
Log.d(TAG, "Restoring time to " + mTime.toString());
Log.d(TAG, "Restoring time to " + mTime);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public long getFirstVisibleTime(AgendaItem item) {
t.setSecond(second);
if (DEBUG) {
t.normalize();
Log.d(TAG, "first position had time " + t.toString());
Log.d(TAG, "first position had time " + t);
}
return t.normalize();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ private void doQuery(QuerySpec queryData) {
time.setJulianDay(queryData.start);
Time time2 = new Time(mTimeZone);
time2.setJulianDay(queryData.end);
Log.v(TAG, "startQuery: " + time.toString() + " to "
+ time2.toString() + " then go to " + queryData.goToTime);
Log.v(TAG, "startQuery: " + time + " to "
+ time2 + " then go to " + queryData.goToTime);
}

mQueryHandler.cancelOperation(0);
Expand Down Expand Up @@ -1053,10 +1053,10 @@ public String toString() {
StringBuilder sb = new StringBuilder();
time.setJulianDay(start);
time.normalize();
sb.append("Start:").append(time.toString());
sb.append("Start:").append(time);
time.setJulianDay(end);
time.normalize();
sb.append(" End:").append(time.toString());
sb.append(" End:").append(time);
sb.append(" Offset:").append(offset);
sb.append(" Size:").append(size);
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public void onReceive(final Context context, final Intent intent) {
return;

if (AlertService.DEBUG) {
Log.d(TAG, "onReceive: a=" + intent.getAction() + " " + intent.toString());
Log.d(TAG, "onReceive: a=" + intent.getAction() + " " + intent);
}
if (MAP_ACTION.equals(intent.getAction())) {
// Try starting the map action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private static void logEventIdsBumped(List<NotificationInfo> list1,
ids.setLength(ids.length() - 1);
}
if (ids.length() > 0) {
Log.d(TAG, "Reached max postings, bumping event IDs {" + ids.toString()
Log.d(TAG, "Reached max postings, bumping event IDs {" + ids
+ "} to digest.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public IBinder onBind(Intent intent) {
@Override
public void onHandleIntent(Intent intent) {
if (AlertService.DEBUG) {
Log.d(TAG, "onReceive: a=" + intent.getAction() + " " + intent.toString());
Log.d(TAG, "onReceive: a=" + intent.getAction() + " " + intent);
}

long eventId = intent.getLongExtra(AlertUtils.EVENT_ID_KEY, -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void startQuery() {
mModel.mCalendarAccessLevel = Calendars.CAL_ACCESS_NONE;
mOutstandingQueries = TOKEN_ALL;
if (DEBUG) {
Log.d(TAG, "startQuery: uri for event is " + mUri.toString());
Log.d(TAG, "startQuery: uri for event is " + mUri);
}
mHandler.startQuery(TOKEN_EVENT, null, mUri, EditEventHelper.EVENT_PROJECTION,
null /* selection */, null /* selection args */, null /* sort order */);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ public MonthByWeekFragment(long initialTime, boolean isMiniMonth) {
private Uri updateUri() {
SimpleWeekView child = (SimpleWeekView) mListView.getChildAt(0);
if (child != null) {
int julianDay = child.getFirstJulianDay();
mFirstLoadedJulianDay = julianDay;
mFirstLoadedJulianDay = child.getFirstJulianDay();
}
// -1 to ensure we get all day events from any time zone
mTempTime.setJulianDay(mFirstLoadedJulianDay - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static private void copyModelToEventRecurrence(final RecurrenceModel model,

if (!canHandleRecurrenceRule(er)) {
throw new IllegalStateException("UI generated recurrence that it can't handle. ER:"
+ er.toString() + " Model: " + model.toString());
+ er + " Model: " + model);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CalendarColorPickerDialogX : ColorPickerDialogX() {

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState)
queryService = QueryService(activity!!)
queryService = QueryService(requireActivity())
if (mColors == null) {
startQuery()
}
Expand Down Expand Up @@ -194,7 +194,7 @@ class CalendarColorPickerDialogX : ColorPickerDialogX() {
}

private fun useDefaultColors() {
val warningDialog = AlertDialog.Builder(activity!!)
val warningDialog = AlertDialog.Builder(requireActivity())
.setTitle(R.string.preferences_calendar_color_warning_title)
.setMessage(R.string.preferences_calendar_color_warning_message)
.setPositiveButton(R.string.preferences_calendar_color_warning_button) { dialogInterface, _ ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void onReceive(Context context, Intent intent) {
// coming in without extras, which AppWidgetProvider then blocks.
final String action = intent.getAction();
if (LOGD)
Log.d(TAG, "AppWidgetProvider got the intent: " + intent.toString());
Log.d(TAG, "AppWidgetProvider got the intent: " + intent);
if (Utils.getWidgetUpdateAction(context).equals(action)) {
if (!isWidgetSupported(context)) {
return;
Expand Down

0 comments on commit 62b75dc

Please sign in to comment.