Use support feature provider to provide intro url.
Change-Id: I3d2493ec8c84fdc61c04fd63537f959fbd589e98 Fix: 62034077 Test: make RunSettingsRoboTests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user