Add SuggestionFeatureProvider interface.

The feature provider will contain all logic for suggestions.

Test: RunSettingsRoboTests
Change-Id: I45a0dcdc101d97acb07babd531db50b80bb3b308
This commit is contained in:
Fan Zhang
2017-01-13 14:58:41 +00:00
parent 1d0e6c8cee
commit 6f7164c5a9
5 changed files with 81 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2017 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.settings.dashboard;
import android.content.Context;
/** Interface should be implemented if you have added new suggestions */
public interface SuggestionFeatureProvider {
/**
* Returns true if smart suggestion should be used instead of xml based SuggestionParser.
*/
boolean isSmartSuggestionEnabled(Context context);
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 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.settings.dashboard;
import android.content.Context;
public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider {
@Override
public boolean isSmartSuggestionEnabled(Context context) {
return false;
}
}