aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSungsoo Lim <sungsoo@google.com>2014-07-31 09:12:45 +0900
committerSungsoo Lim <sungsoo@google.com>2014-07-31 10:57:00 +0900
commit48411f52807c013a8e6ad921d6b1c705e7c385d1 (patch)
tree70053bc87548aafe708322d685100d31dad5da54 /src
parentc91a6ff8aca631d682764bc7a771cc79fbd41c75 (diff)
downloadTV-48411f52807c013a8e6ad921d6b1c705e7c385d1.tar.gz
Enable TvRecommendation with RandomRecommender
Bug: 14068131 Change-Id: I262c6a6007de5b6fb27db1769e4aca70cb536af5
Diffstat (limited to 'src')
-rw-r--r--src/com/android/tv/notification/NotificationService.java4
-rw-r--r--src/com/android/tv/recommendation/RandomRecommender.java27
2 files changed, 29 insertions, 2 deletions
diff --git a/src/com/android/tv/notification/NotificationService.java b/src/com/android/tv/notification/NotificationService.java
index cb871a62..01998065 100644
--- a/src/com/android/tv/notification/NotificationService.java
+++ b/src/com/android/tv/notification/NotificationService.java
@@ -43,7 +43,7 @@ import android.util.Log;
import com.android.tv.R;
import com.android.tv.data.Program;
-import com.android.tv.recommendation.RoutineWatchRecommender;
+import com.android.tv.recommendation.RandomRecommender;
import com.android.tv.recommendation.TvRecommendation;
import com.android.tv.recommendation.TvRecommendation.ChannelRecord;
import com.android.tv.util.TvInputManagerHelper;
@@ -136,7 +136,7 @@ public class NotificationService extends Service {
R.dimen.notif_card_img_height);
mTvRecommendation = new TvRecommendation(this, mHandler, true);
- mTvRecommendation.registerTvRecommender(new RoutineWatchRecommender(this));
+ mTvRecommendation.registerTvRecommender(new RandomRecommender());
mNotificationManager = (NotificationManager) getSystemService(
Context.NOTIFICATION_SERVICE);
mTvInputManager = (TvInputManager) getSystemService(Context.TV_INPUT_SERVICE);
diff --git a/src/com/android/tv/recommendation/RandomRecommender.java b/src/com/android/tv/recommendation/RandomRecommender.java
new file mode 100644
index 00000000..6e7aaede
--- /dev/null
+++ b/src/com/android/tv/recommendation/RandomRecommender.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.tv.recommendation;
+
+import com.android.tv.recommendation.TvRecommendation.ChannelRecord;
+import com.android.tv.recommendation.TvRecommendation.TvRecommender;
+
+public class RandomRecommender extends TvRecommender {
+ @Override
+ public double calculateScore(final ChannelRecord cr) {
+ return Math.random();
+ }
+}