MockShortcutRefresher.java revision 04a180b52fb4100a2f3747e795fb5d26e3207a4a
104a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert/* 204a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * Copyright (C) 2010 The Android Open Source Project 304a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * 404a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * Licensed under the Apache License, Version 2.0 (the "License"); 504a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * you may not use this file except in compliance with the License. 604a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * You may obtain a copy of the License at 704a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * 804a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * http://www.apache.org/licenses/LICENSE-2.0 904a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * 1004a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * Unless required by applicable law or agreed to in writing, software 1104a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * distributed under the License is distributed on an "AS IS" BASIS, 1204a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1304a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * See the License for the specific language governing permissions and 1404a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * limitations under the License. 1504a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert */ 1604a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 1704a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringertpackage com.android.quicksearchbox; 1804a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 1904a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 2004a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert/** 2104a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert * Mock implementation of {@link ShortcutRefresher}. 2204a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert */ 2304a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringertpublic class MockShortcutRefresher implements ShortcutRefresher { 2404a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 2504a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert public void cancelPendingTasks() { 2604a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert } 2704a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 2804a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert public void onShortcutRefreshed(SuggestionCursor shortcut) { 2904a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert } 3004a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 3104a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert public void refresh(SuggestionCursor shortcuts, Listener listener) { 3204a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert } 3304a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 3404a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert public void reset() { 3504a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert } 3604a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 3704a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert public boolean shouldRefresh(SuggestionCursor shortcut) { 3804a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert return shortcut.getShortcutId() != null; 3904a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert } 4004a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert 4104a180b52fb4100a2f3747e795fb5d26e3207a4aBjorn Bringert} 42