Merge "Merge "Use support feature provider to provide intro url." into oc-dr1-dev am: bdc0816982" into oc-dr1-dev-plus-aosp

am: afa34b1cc4

Change-Id: Iac1d851fb89ea51827bca764004ff3741f54dd14
This commit is contained in:
Fan Zhang
2017-06-09 03:03:14 +00:00
committed by android-build-merger
5 changed files with 23 additions and 41 deletions

View File

@@ -24,8 +24,8 @@ import android.app.Activity;
import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.android.settings.support.SupportPhone;
import java.lang.annotation.Retention;
@@ -123,8 +123,8 @@ public interface SupportFeatureProvider {
* Starts support activity of specified type
*
* @param activity Calling activity
* @param account A account that selected by user
* @param type The type of support account needs.
* @param account A account that selected by user
* @param type The type of support account needs.
*/
void startSupport(Activity activity, Account account, @SupportType int type);
@@ -137,6 +137,7 @@ public interface SupportFeatureProvider {
/**
* Checks if support v2 is enabled for this device.
*
* @return a boolean indicating if support v2 is enabled.
*/
boolean isSupportV2Enabled();
@@ -166,4 +167,9 @@ public interface SupportFeatureProvider {
* launches the fragment that displays the system information being sent to support agents.
*/
void launchSystemInfoFragment(Bundle args, FragmentManager manager);
/**
* Returns a url with information to introduce user to new device.
*/
String getNewDeviceIntroUrl(Context context);
}

View File

@@ -28,9 +28,9 @@ import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
import com.android.settings.R;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.overlay.SupportFeatureProvider;
import java.util.List;
@@ -107,7 +107,12 @@ public class NewDeviceIntroSuggestionActivity extends Activity {
@VisibleForTesting
static Intent getLaunchIntent(Context context) {
final String url = context.getString(R.string.new_device_suggestion_intro_url);
final SupportFeatureProvider supportProvider = FeatureFactory.getFactory(context)
.getSupportFeatureProvider(context);
if (supportProvider == null) {
return null;
}
final String url = supportProvider.getNewDeviceIntroUrl(context);
if (TextUtils.isEmpty(url)) {
return null;
}