aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tv/data/WatchedHistoryManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/tv/data/WatchedHistoryManager.java')
-rw-r--r--src/com/android/tv/data/WatchedHistoryManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/tv/data/WatchedHistoryManager.java b/src/com/android/tv/data/WatchedHistoryManager.java
index cff8cd5c..fc6672d2 100644
--- a/src/com/android/tv/data/WatchedHistoryManager.java
+++ b/src/com/android/tv/data/WatchedHistoryManager.java
@@ -3,10 +3,12 @@ package com.android.tv.data;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.MainThread;
+import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
@@ -42,8 +44,8 @@ public class WatchedHistoryManager {
private boolean mStarted;
private boolean mLoaded;
private SharedPreferences mSharedPreferences;
- private SharedPreferences.OnSharedPreferenceChangeListener mOnSharedPreferenceChangeListener =
- new SharedPreferences.OnSharedPreferenceChangeListener() {
+ private final OnSharedPreferenceChangeListener mOnSharedPreferenceChangeListener =
+ new OnSharedPreferenceChangeListener() {
@Override
@MainThread
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
@@ -80,7 +82,7 @@ public class WatchedHistoryManager {
private final Context mContext;
private Listener mListener;
private final int mMaxHistorySize;
- private Handler mHandler;
+ private final Handler mHandler;
public WatchedHistoryManager(Context context) {
this(context, MAX_HISTORY_SIZE);
@@ -197,6 +199,7 @@ public class WatchedHistoryManager {
* Returns watched history in the ascending order of time. In other words, the first element
* is the oldest and the last element is the latest record.
*/
+ @NonNull
public List<WatchedRecord> getWatchedHistory() {
return Collections.unmodifiableList(mWatchedHistory);
}