Removed some Warnings, Added Type arguments

Change-Id: Ie52eecf14773768c97e23ae7f96a80df1d067ade
diff --git a/src/com/android/calendar/AgendaByDayAdapter.java b/src/com/android/calendar/AgendaByDayAdapter.java
index 881c1a2..f7b86de 100644
--- a/src/com/android/calendar/AgendaByDayAdapter.java
+++ b/src/com/android/calendar/AgendaByDayAdapter.java
@@ -189,7 +189,6 @@
         mTodayJulianDay = Time.getJulianDay(now, time.gmtoff);
         LinkedList<MultipleDayInfo> multipleDayList = new LinkedList<MultipleDayInfo>();
         for (int position = 0; cursor.moveToNext(); position++) {
-            boolean allDay = cursor.getInt(AgendaWindowAdapter.INDEX_ALL_DAY) != 0;
             int startDay = cursor.getInt(AgendaWindowAdapter.INDEX_START_DAY);
 
             // Skip over the days outside of the adapter's range
diff --git a/src/com/android/calendar/AlertActivity.java b/src/com/android/calendar/AlertActivity.java
index 2a041bf..9648bbf 100644
--- a/src/com/android/calendar/AlertActivity.java
+++ b/src/com/android/calendar/AlertActivity.java
@@ -179,7 +179,7 @@
 
     private OnItemClickListener mViewListener = new OnItemClickListener() {
 
-        public void onItemClick(AdapterView parent, View view, int position,
+        public void onItemClick(AdapterView<?> parent, View view, int position,
                 long i) {
             AlertActivity alertActivity = AlertActivity.this;
             Cursor cursor = alertActivity.getItemForView(view);
diff --git a/src/com/android/calendar/AlertReceiver.java b/src/com/android/calendar/AlertReceiver.java
index 7943a9e..d4d4e2d 100644
--- a/src/com/android/calendar/AlertReceiver.java
+++ b/src/com/android/calendar/AlertReceiver.java
@@ -22,7 +22,6 @@
 import android.app.Service;
 import android.content.BroadcastReceiver;
 import android.content.ContentResolver;
-import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
diff --git a/src/com/android/calendar/CalendarApplication.java b/src/com/android/calendar/CalendarApplication.java
index 424e422..35d0ea8 100644
--- a/src/com/android/calendar/CalendarApplication.java
+++ b/src/com/android/calendar/CalendarApplication.java
@@ -18,7 +18,6 @@
 
 import android.app.Application;
 import android.preference.PreferenceManager;
-import android.util.Log;
 
 public class CalendarApplication extends Application {
 
diff --git a/src/com/android/calendar/CalendarView.java b/src/com/android/calendar/CalendarView.java
index 6716edf..44b6535 100644
--- a/src/com/android/calendar/CalendarView.java
+++ b/src/com/android/calendar/CalendarView.java
@@ -2341,7 +2341,6 @@
     void doSingleTapUp(MotionEvent ev) {
         int x = (int) ev.getX();
         int y = (int) ev.getY();
-        Event selectedEvent = mSelectedEvent;
         int selectedDay = mSelectionDay;
         int selectedHour = mSelectionHour;
 
diff --git a/src/com/android/calendar/Event.java b/src/com/android/calendar/Event.java
index 956a0f6..55f7726 100644
--- a/src/com/android/calendar/Event.java
+++ b/src/com/android/calendar/Event.java
@@ -35,7 +35,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 
 // TODO: should Event be Parcelable so it can be passed via Intents?
-public class Event implements Comparable, Cloneable {
+public class Event implements Comparable<Event>, Cloneable {
 
     private static final boolean PROFILE = false;
 
@@ -117,8 +117,6 @@
     public Event nextUp;
     public Event nextDown;
 
-    private static final int MIDNIGHT_IN_MINUTES = 24 * 60;
-
     @Override
     public final Object clone() throws CloneNotSupportedException {
         super.clone();
@@ -187,32 +185,30 @@
      * Compares this event to the given event.  This is just used for checking
      * if two events differ.  It's not used for sorting anymore.
      */
-    public final int compareTo(Object obj) {
-        Event e = (Event) obj;
-
+    public final int compareTo(Event obj) {
         // The earlier start day and time comes first
-        if (startDay < e.startDay) return -1;
-        if (startDay > e.startDay) return 1;
-        if (startTime < e.startTime) return -1;
-        if (startTime > e.startTime) return 1;
+        if (startDay < obj.startDay) return -1;
+        if (startDay > obj.startDay) return 1;
+        if (startTime < obj.startTime) return -1;
+        if (startTime > obj.startTime) return 1;
 
         // The later end time comes first (in order to put long strips on
         // the left).
-        if (endDay < e.endDay) return 1;
-        if (endDay > e.endDay) return -1;
-        if (endTime < e.endTime) return 1;
-        if (endTime > e.endTime) return -1;
+        if (endDay < obj.endDay) return 1;
+        if (endDay > obj.endDay) return -1;
+        if (endTime < obj.endTime) return 1;
+        if (endTime > obj.endTime) return -1;
 
         // Sort all-day events before normal events.
-        if (allDay && !e.allDay) return -1;
-        if (!allDay && e.allDay) return 1;
+        if (allDay && !obj.allDay) return -1;
+        if (!allDay && obj.allDay) return 1;
 
-        if (guestsCanModify && !e.guestsCanModify) return -1;
-        if (!guestsCanModify && e.guestsCanModify) return 1;
+        if (guestsCanModify && !obj.guestsCanModify) return -1;
+        if (!guestsCanModify && obj.guestsCanModify) return 1;
 
         // If two events have the same time range, then sort them in
         // alphabetical order based on their titles.
-        int cmp = compareStrings(title, e.title);
+        int cmp = compareStrings(title, obj.title);
         if (cmp != 0) {
             return cmp;
         }
@@ -220,12 +216,12 @@
         // If the titles are the same then compare the other fields
         // so that we can use this function to check for differences
         // between events.
-        cmp = compareStrings(location, e.location);
+        cmp = compareStrings(location, obj.location);
         if (cmp != 0) {
             return cmp;
         }
 
-        cmp = compareStrings(organizer, e.organizer);
+        cmp = compareStrings(organizer, obj.organizer);
         if (cmp != 0) {
             return cmp;
         }
diff --git a/src/com/android/calendar/EventInfoActivity.java b/src/com/android/calendar/EventInfoActivity.java
index 1abcb0b..aec7953 100644
--- a/src/com/android/calendar/EventInfoActivity.java
+++ b/src/com/android/calendar/EventInfoActivity.java
@@ -901,7 +901,6 @@
             return;
         }
 
-        ContentResolver cr = getContentResolver();
         // Yes/No/Maybe Title
         View titleView = mLayoutInflater.inflate(R.layout.contact_item, null);
         titleView.findViewById(R.id.badge).setVisibility(View.GONE);
@@ -958,11 +957,9 @@
 
     private class PresenceQueryHandler extends AsyncQueryHandler {
         Context mContext;
-        ContentResolver mContentResolver;
 
         public PresenceQueryHandler(Context context, ContentResolver cr) {
             super(cr);
-            mContentResolver = cr;
             mContext = context;
         }
 
diff --git a/src/com/android/calendar/GoogleCalendarUriIntentFilter.java b/src/com/android/calendar/GoogleCalendarUriIntentFilter.java
index 502243a..3daf1e4 100644
--- a/src/com/android/calendar/GoogleCalendarUriIntentFilter.java
+++ b/src/com/android/calendar/GoogleCalendarUriIntentFilter.java
@@ -27,7 +27,6 @@
 
 import android.app.Activity;
 import android.content.ActivityNotFoundException;
-import android.content.ContentResolver;
 import android.content.ContentUris;
 import android.content.Intent;
 import android.database.Cursor;
@@ -56,7 +55,6 @@
             if (uri != null) {
                 String eid = uri.getQueryParameter("eid");
                 if (eid != null) {
-                    ContentResolver cr = getContentResolver();
                     String selection = Events.HTML_URI + " LIKE \"%eid=" + eid + "%\"";
 
                     Cursor eventCursor = managedQuery(Events.CONTENT_URI, EVENT_PROJECTION,
diff --git a/src/com/android/calendar/IcsImportActivity.java b/src/com/android/calendar/IcsImportActivity.java
index c5a125d..3ff43ff 100644
--- a/src/com/android/calendar/IcsImportActivity.java
+++ b/src/com/android/calendar/IcsImportActivity.java
@@ -30,7 +30,6 @@
 import android.view.View;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
-import android.widget.ImageView;
 import android.widget.Spinner;
 import android.widget.TextView;
 
diff --git a/src/com/android/calendar/LaunchActivity.java b/src/com/android/calendar/LaunchActivity.java
index 659eaab..aa73485 100644
--- a/src/com/android/calendar/LaunchActivity.java
+++ b/src/com/android/calendar/LaunchActivity.java
@@ -32,7 +32,6 @@
 import android.preference.PreferenceManager;
 import android.provider.Calendar.Calendars;
 import android.provider.Gmail;
-import android.util.Log;
 
 import com.google.android.googlelogin.GoogleLoginServiceConstants;
 
diff --git a/src/com/android/calendar/MonthActivity.java b/src/com/android/calendar/MonthActivity.java
index 62f8602..a09c7dc 100644
--- a/src/com/android/calendar/MonthActivity.java
+++ b/src/com/android/calendar/MonthActivity.java
@@ -32,7 +32,6 @@
 import android.provider.Calendar.Events;
 import android.text.format.DateUtils;
 import android.text.format.Time;
-import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
diff --git a/src/com/android/calendar/MonthView.java b/src/com/android/calendar/MonthView.java
index 13f6abc..e5bb33a 100644
--- a/src/com/android/calendar/MonthView.java
+++ b/src/com/android/calendar/MonthView.java
@@ -706,8 +706,6 @@
 
         // Draw the cell contents (excluding monthDay number)
         if (!withinCurrentMonth) {
-            boolean firstDayOfNextmonth = isFirstDayOfNextMonth(row, column);
-
             // Adjust cell boundaries to compensate for the different border
             // style.
             r.top--;