import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
-import android.os.UserManager;
import android.provider.SearchIndexableResource;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
}
Cursor getContextualCards() {
- final SQLiteDatabase db = this.getReadableDatabase();
+ final SQLiteDatabase db = getReadableDatabase();
final String selection = CardColumns.CARD_DISMISSED + "=0";
- Cursor cursor = db.query(CARD_TABLE, null /* columns */, selection,
+ return db.query(CARD_TABLE, null /* columns */, selection,
null /* selectionArgs */, null /* groupBy */, null /* having */,
CardColumns.SCORE + " DESC" /* orderBy */);
- return cursor;
}
/**
import android.net.Uri;
import com.android.settings.slices.CustomSliceRegistry;
-import com.android.settings.slices.SettingsSliceProvider;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
-import org.robolectric.shadows.ShadowContentResolver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
@RunWith(RobolectricTestRunner.class)
public class ContextualCardLoaderTest {
private Context mContext;
private ContextualCardLoader mContextualCardLoader;
- private SettingsSliceProvider mProvider;
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mContextualCardLoader = spy(new ContextualCardLoader(mContext));
- mProvider = new SettingsSliceProvider();
- ShadowContentResolver.registerProviderInternal(SettingsSliceProvider.SLICE_AUTHORITY,
- mProvider);
}
@Test
.build());
return cards;
}
-}
\ No newline at end of file
+}