Add user and account dashboard category for new IA.
Add the initial version for the User & accounts category and set the tile's intent if it contains metadata but fragment is null. Test: RunSettingsRoboTests Bug: 31801423 Change-Id: Ic63bf8aeaf47f68a184af73c9a8a72b89b597a17
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.android.settings.dashboard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Bundle;
|
||||
@@ -142,6 +143,21 @@ public class DashboardFragmentTest {
|
||||
assertThat(preference.getOrder()).isEqualTo(-tile.priority);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bindPreference_noFragmentMetadata_shouldBindIntent() {
|
||||
final Preference preference = new Preference(
|
||||
ShadowApplication.getInstance().getApplicationContext());
|
||||
final Tile tile = new Tile();
|
||||
tile.metaData = new Bundle();
|
||||
tile.priority = 10;
|
||||
tile.intent = new Intent();
|
||||
mTestFragment.bindPreferenceToTile(mContext, preference, tile, "123");
|
||||
|
||||
assertThat(preference.getFragment()).isNull();
|
||||
assertThat(preference.getIntent()).isNotNull();
|
||||
assertThat(preference.getOrder()).isEqualTo(-tile.priority);
|
||||
}
|
||||
|
||||
public static class TestPreferenceController extends PreferenceController {
|
||||
|
||||
public TestPreferenceController(Context context) {
|
||||
|
Reference in New Issue
Block a user