diff options
author | Sungsoo Lim <sungsoo@google.com> | 2014-07-31 04:43:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-24 16:04:26 +0000 |
commit | 3ee2db7cb32377781c8657907921540e1517aa8f (patch) | |
tree | 62be538d99d068ec73e32e01fbe5bc7ea117de1c /src/com/android/tv | |
parent | 992c52901be421eeb67728d9db2ad613c8db445d (diff) | |
parent | 48411f52807c013a8e6ad921d6b1c705e7c385d1 (diff) | |
download | TV-3ee2db7cb32377781c8657907921540e1517aa8f.tar.gz |
Merge "Enable TvRecommendation with RandomRecommender" into lmp-dev
Diffstat (limited to 'src/com/android/tv')
-rw-r--r-- | src/com/android/tv/notification/NotificationService.java | 4 | ||||
-rw-r--r-- | src/com/android/tv/recommendation/RandomRecommender.java | 27 |
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(); + } +} |