Search in sources :

Example 56 with SliceMetadata

use of androidx.slice.SliceMetadata in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class NotificationChannelSliceTest method getSlice_channelCountIsMoreThanDefaultRows_subTitleShouldHaveTapToManagerAll.

@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
public void getSlice_channelCountIsMoreThanDefaultRows_subTitleShouldHaveTapToManagerAll() {
    addMockPackageToPackageManager(true, /* isRecentlyInstalled */
    ApplicationInfo.FLAG_INSTALLED);
    mockNotificationBackend(CHANNEL_COUNT + 1, NOTIFICATION_COUNT, false, /* banned */
    false);
    final Slice slice = mNotificationChannelSlice.getSlice();
    final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
    assertThat(metadata.getSubtitle()).isEqualTo(mContext.getString(R.string.notification_many_channel_count_summary, CHANNEL_COUNT + 1));
}
Also used : Slice(androidx.slice.Slice) ParceledListSlice(android.content.pm.ParceledListSlice) SliceMetadata(androidx.slice.SliceMetadata) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Example 57 with SliceMetadata

use of androidx.slice.SliceMetadata in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class NotificationChannelSliceTest method getSlice_isAllDisplayableChannelBlocked_shouldHaveNoSuggestedAppTitle.

@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
public void getSlice_isAllDisplayableChannelBlocked_shouldHaveNoSuggestedAppTitle() {
    addMockPackageToPackageManager(true, /* isRecentlyInstalled */
    ApplicationInfo.FLAG_INSTALLED);
    mockNotificationBackend(CHANNEL_COUNT, NOTIFICATION_COUNT, false, /* banned */
    true);
    final Slice slice = mNotificationChannelSlice.getSlice();
    final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
    assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.no_suggested_app));
}
Also used : Slice(androidx.slice.Slice) ParceledListSlice(android.content.pm.ParceledListSlice) SliceMetadata(androidx.slice.SliceMetadata) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

SliceMetadata (androidx.slice.SliceMetadata)57 Slice (androidx.slice.Slice)44 Test (org.junit.Test)43 SliceAction (androidx.slice.core.SliceAction)29 PendingIntent (android.app.PendingIntent)12 SliceItem (androidx.slice.SliceItem)12 ParceledListSlice (android.content.pm.ParceledListSlice)11 IconCompat (androidx.core.graphics.drawable.IconCompat)11 Config (org.robolectric.annotation.Config)9 PrivateStorageInfo (com.android.settingslib.deviceinfo.PrivateStorageInfo)3 MetricsFeatureProvider (com.android.settingslib.core.instrumentation.MetricsFeatureProvider)2 Uri (android.net.Uri)1 Handler (android.os.Handler)1 VisibleForTesting (androidx.annotation.VisibleForTesting)1 ListContent (androidx.slice.widget.ListContent)1 RowContent (androidx.slice.widget.RowContent)1 SliceContent (androidx.slice.widget.SliceContent)1 MediaDevice (com.android.settingslib.media.MediaDevice)1