Rename audios to audio
Bug: 186635176 Test: build pass Change-Id: I0d909f639fe36edf2e5088c7ec219cceee4e963a
This commit is contained in:
@@ -511,8 +511,8 @@
|
|||||||
<!-- Media Uri to view videos storage category. -->
|
<!-- Media Uri to view videos storage category. -->
|
||||||
<string name="config_videos_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/videos_root</string>
|
<string name="config_videos_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/videos_root</string>
|
||||||
|
|
||||||
<!-- Media Uri to view audios storage category. -->
|
<!-- Media Uri to view audio storage category. -->
|
||||||
<string name="config_audios_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/audio_root</string>
|
<string name="config_audio_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/audio_root</string>
|
||||||
|
|
||||||
<!-- Media Uri to view documents & other storage category. -->
|
<!-- Media Uri to view documents & other storage category. -->
|
||||||
<string name="config_documents_and_other_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/documents_root</string>
|
<string name="config_documents_and_other_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/documents_root</string>
|
||||||
|
@@ -11883,8 +11883,8 @@
|
|||||||
<!-- Preference label for the Videos storage section. [CHAR LIMIT=50] -->
|
<!-- Preference label for the Videos storage section. [CHAR LIMIT=50] -->
|
||||||
<string name="storage_videos">Videos</string>
|
<string name="storage_videos">Videos</string>
|
||||||
|
|
||||||
<!-- Preference label for the Audios storage section. [CHAR LIMIT=50] -->
|
<!-- Preference label for the Audio storage section. [CHAR LIMIT=50] -->
|
||||||
<string name="storage_audios">Audios</string>
|
<string name="storage_audio">Audio</string>
|
||||||
|
|
||||||
<!-- Preference label for the Apps storage section. [CHAR LIMIT=50] -->
|
<!-- Preference label for the Apps storage section. [CHAR LIMIT=50] -->
|
||||||
<string name="storage_apps">Apps</string>
|
<string name="storage_apps">Apps</string>
|
||||||
|
@@ -43,8 +43,8 @@
|
|||||||
android:icon="@drawable/ic_local_movies"
|
android:icon="@drawable/ic_local_movies"
|
||||||
android:order="102"/>
|
android:order="102"/>
|
||||||
<com.android.settings.deviceinfo.StorageItemPreference
|
<com.android.settings.deviceinfo.StorageItemPreference
|
||||||
android:key="pref_audios"
|
android:key="pref_audio"
|
||||||
android:title="@string/storage_audios"
|
android:title="@string/storage_audio"
|
||||||
android:icon="@drawable/ic_media_stream"
|
android:icon="@drawable/ic_media_stream"
|
||||||
android:order="103"/>
|
android:order="103"/>
|
||||||
<com.android.settings.deviceinfo.StorageItemPreference
|
<com.android.settings.deviceinfo.StorageItemPreference
|
||||||
|
@@ -63,8 +63,8 @@
|
|||||||
android:icon="@drawable/ic_local_movies"
|
android:icon="@drawable/ic_local_movies"
|
||||||
android:order="102"/>
|
android:order="102"/>
|
||||||
<com.android.settings.deviceinfo.StorageItemPreference
|
<com.android.settings.deviceinfo.StorageItemPreference
|
||||||
android:key="pref_audios"
|
android:key="pref_audio"
|
||||||
android:title="@string/storage_audios"
|
android:title="@string/storage_audio"
|
||||||
android:icon="@drawable/ic_media_stream"
|
android:icon="@drawable/ic_media_stream"
|
||||||
android:order="103"/>
|
android:order="103"/>
|
||||||
<com.android.settings.deviceinfo.StorageItemPreference
|
<com.android.settings.deviceinfo.StorageItemPreference
|
||||||
|
@@ -76,7 +76,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final String VIDEOS_KEY = "pref_videos";
|
static final String VIDEOS_KEY = "pref_videos";
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final String AUDIOS_KEY = "pref_audios";
|
static final String AUDIO_KEY = "pref_audio";
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final String APPS_KEY = "pref_apps";
|
static final String APPS_KEY = "pref_apps";
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -93,7 +93,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final Uri mVideosUri;
|
final Uri mVideosUri;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final Uri mAudiosUri;
|
final Uri mAudioUri;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final Uri mDocumentsAndOtherUri;
|
final Uri mDocumentsAndOtherUri;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
StorageItemPreference mVideosPreference;
|
StorageItemPreference mVideosPreference;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
StorageItemPreference mAudiosPreference;
|
StorageItemPreference mAudioPreference;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
StorageItemPreference mAppsPreference;
|
StorageItemPreference mAppsPreference;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -151,8 +151,8 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
.getString(R.string.config_images_storage_category_uri));
|
.getString(R.string.config_images_storage_category_uri));
|
||||||
mVideosUri = Uri.parse(context.getResources()
|
mVideosUri = Uri.parse(context.getResources()
|
||||||
.getString(R.string.config_videos_storage_category_uri));
|
.getString(R.string.config_videos_storage_category_uri));
|
||||||
mAudiosUri = Uri.parse(context.getResources()
|
mAudioUri = Uri.parse(context.getResources()
|
||||||
.getString(R.string.config_audios_storage_category_uri));
|
.getString(R.string.config_audio_storage_category_uri));
|
||||||
mDocumentsAndOtherUri = Uri.parse(context.getResources()
|
mDocumentsAndOtherUri = Uri.parse(context.getResources()
|
||||||
.getString(R.string.config_documents_and_other_storage_category_uri));
|
.getString(R.string.config_documents_and_other_storage_category_uri));
|
||||||
}
|
}
|
||||||
@@ -182,8 +182,8 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
case VIDEOS_KEY:
|
case VIDEOS_KEY:
|
||||||
launchActivityWithUri(mVideosUri);
|
launchActivityWithUri(mVideosUri);
|
||||||
return true;
|
return true;
|
||||||
case AUDIOS_KEY:
|
case AUDIO_KEY:
|
||||||
launchActivityWithUri(mAudiosUri);
|
launchActivityWithUri(mAudioUri);
|
||||||
return true;
|
return true;
|
||||||
case APPS_KEY:
|
case APPS_KEY:
|
||||||
launchAppsIntent();
|
launchAppsIntent();
|
||||||
@@ -251,7 +251,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
final boolean privateStoragePreferencesVisible = isValidPrivateVolume();
|
final boolean privateStoragePreferencesVisible = isValidPrivateVolume();
|
||||||
mImagesPreference.setVisible(privateStoragePreferencesVisible);
|
mImagesPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
mVideosPreference.setVisible(privateStoragePreferencesVisible);
|
mVideosPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
mAudiosPreference.setVisible(privateStoragePreferencesVisible);
|
mAudioPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
mAppsPreference.setVisible(privateStoragePreferencesVisible);
|
mAppsPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
mGamesPreference.setVisible(privateStoragePreferencesVisible);
|
mGamesPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
mDocumentsAndOtherPreference.setVisible(privateStoragePreferencesVisible);
|
mDocumentsAndOtherPreference.setVisible(privateStoragePreferencesVisible);
|
||||||
@@ -279,7 +279,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
|
|
||||||
mPrivateStorageItemPreferences.add(mImagesPreference);
|
mPrivateStorageItemPreferences.add(mImagesPreference);
|
||||||
mPrivateStorageItemPreferences.add(mVideosPreference);
|
mPrivateStorageItemPreferences.add(mVideosPreference);
|
||||||
mPrivateStorageItemPreferences.add(mAudiosPreference);
|
mPrivateStorageItemPreferences.add(mAudioPreference);
|
||||||
mPrivateStorageItemPreferences.add(mAppsPreference);
|
mPrivateStorageItemPreferences.add(mAppsPreference);
|
||||||
mPrivateStorageItemPreferences.add(mGamesPreference);
|
mPrivateStorageItemPreferences.add(mGamesPreference);
|
||||||
mPrivateStorageItemPreferences.add(mDocumentsAndOtherPreference);
|
mPrivateStorageItemPreferences.add(mDocumentsAndOtherPreference);
|
||||||
@@ -288,7 +288,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
}
|
}
|
||||||
mScreen.removePreference(mImagesPreference);
|
mScreen.removePreference(mImagesPreference);
|
||||||
mScreen.removePreference(mVideosPreference);
|
mScreen.removePreference(mVideosPreference);
|
||||||
mScreen.removePreference(mAudiosPreference);
|
mScreen.removePreference(mAudioPreference);
|
||||||
mScreen.removePreference(mAppsPreference);
|
mScreen.removePreference(mAppsPreference);
|
||||||
mScreen.removePreference(mGamesPreference);
|
mScreen.removePreference(mGamesPreference);
|
||||||
mScreen.removePreference(mDocumentsAndOtherPreference);
|
mScreen.removePreference(mDocumentsAndOtherPreference);
|
||||||
@@ -317,7 +317,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
tintPreference(mPublicStoragePreference);
|
tintPreference(mPublicStoragePreference);
|
||||||
tintPreference(mImagesPreference);
|
tintPreference(mImagesPreference);
|
||||||
tintPreference(mVideosPreference);
|
tintPreference(mVideosPreference);
|
||||||
tintPreference(mAudiosPreference);
|
tintPreference(mAudioPreference);
|
||||||
tintPreference(mAppsPreference);
|
tintPreference(mAppsPreference);
|
||||||
tintPreference(mGamesPreference);
|
tintPreference(mGamesPreference);
|
||||||
tintPreference(mDocumentsAndOtherPreference);
|
tintPreference(mDocumentsAndOtherPreference);
|
||||||
@@ -346,7 +346,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
mPublicStoragePreference = screen.findPreference(PUBLIC_STORAGE_KEY);
|
mPublicStoragePreference = screen.findPreference(PUBLIC_STORAGE_KEY);
|
||||||
mImagesPreference = screen.findPreference(IMAGES_KEY);
|
mImagesPreference = screen.findPreference(IMAGES_KEY);
|
||||||
mVideosPreference = screen.findPreference(VIDEOS_KEY);
|
mVideosPreference = screen.findPreference(VIDEOS_KEY);
|
||||||
mAudiosPreference = screen.findPreference(AUDIOS_KEY);
|
mAudioPreference = screen.findPreference(AUDIO_KEY);
|
||||||
mAppsPreference = screen.findPreference(APPS_KEY);
|
mAppsPreference = screen.findPreference(APPS_KEY);
|
||||||
mGamesPreference = screen.findPreference(GAMES_KEY);
|
mGamesPreference = screen.findPreference(GAMES_KEY);
|
||||||
mDocumentsAndOtherPreference = screen.findPreference(DOCUMENTS_AND_OTHER_KEY);
|
mDocumentsAndOtherPreference = screen.findPreference(DOCUMENTS_AND_OTHER_KEY);
|
||||||
@@ -363,7 +363,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
|
|
||||||
mImagesPreference.setStorageSize(getImagesSize(data), mTotalSize);
|
mImagesPreference.setStorageSize(getImagesSize(data), mTotalSize);
|
||||||
mVideosPreference.setStorageSize(getVideosSize(data), mTotalSize);
|
mVideosPreference.setStorageSize(getVideosSize(data), mTotalSize);
|
||||||
mAudiosPreference.setStorageSize(getAudiosSize(data), mTotalSize);
|
mAudioPreference.setStorageSize(getAudioSize(data), mTotalSize);
|
||||||
mAppsPreference.setStorageSize(getAppsSize(data), mTotalSize);
|
mAppsPreference.setStorageSize(getAppsSize(data), mTotalSize);
|
||||||
mGamesPreference.setStorageSize(getGamesSize(data), mTotalSize);
|
mGamesPreference.setStorageSize(getGamesSize(data), mTotalSize);
|
||||||
mDocumentsAndOtherPreference.setStorageSize(getDocumentsAndOtherSize(data),
|
mDocumentsAndOtherPreference.setStorageSize(getDocumentsAndOtherSize(data),
|
||||||
@@ -426,7 +426,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
|
|||||||
return data.videoAppsSize;
|
return data.videoAppsSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getAudiosSize(StorageAsyncLoader.AppsStorageResult data) {
|
private long getAudioSize(StorageAsyncLoader.AppsStorageResult data) {
|
||||||
return data.musicAppsSize + data.externalStats.audioBytes;
|
return data.musicAppsSize + data.externalStats.audioBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,8 +112,8 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
images.setIcon(R.drawable.ic_photo_library);
|
images.setIcon(R.drawable.ic_photo_library);
|
||||||
final StorageItemPreference videos = spy(new StorageItemPreference(mContext));
|
final StorageItemPreference videos = spy(new StorageItemPreference(mContext));
|
||||||
videos.setIcon(R.drawable.ic_local_movies);
|
videos.setIcon(R.drawable.ic_local_movies);
|
||||||
final StorageItemPreference audios = spy(new StorageItemPreference(mContext));
|
final StorageItemPreference audio = spy(new StorageItemPreference(mContext));
|
||||||
audios.setIcon(R.drawable.ic_media_stream);
|
audio.setIcon(R.drawable.ic_media_stream);
|
||||||
final StorageItemPreference apps = spy(new StorageItemPreference(mContext));
|
final StorageItemPreference apps = spy(new StorageItemPreference(mContext));
|
||||||
apps.setIcon(R.drawable.ic_storage_apps);
|
apps.setIcon(R.drawable.ic_storage_apps);
|
||||||
final StorageItemPreference games = spy(new StorageItemPreference(mContext));
|
final StorageItemPreference games = spy(new StorageItemPreference(mContext));
|
||||||
@@ -132,8 +132,8 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
.thenReturn(images);
|
.thenReturn(images);
|
||||||
when(screen.findPreference(eq(StorageItemPreferenceController.VIDEOS_KEY)))
|
when(screen.findPreference(eq(StorageItemPreferenceController.VIDEOS_KEY)))
|
||||||
.thenReturn(videos);
|
.thenReturn(videos);
|
||||||
when(screen.findPreference(eq(StorageItemPreferenceController.AUDIOS_KEY)))
|
when(screen.findPreference(eq(StorageItemPreferenceController.AUDIO_KEY)))
|
||||||
.thenReturn(audios);
|
.thenReturn(audio);
|
||||||
when(screen.findPreference(eq(StorageItemPreferenceController.APPS_KEY)))
|
when(screen.findPreference(eq(StorageItemPreferenceController.APPS_KEY)))
|
||||||
.thenReturn(apps);
|
.thenReturn(apps);
|
||||||
when(screen.findPreference(eq(StorageItemPreferenceController.GAMES_KEY)))
|
when(screen.findPreference(eq(StorageItemPreferenceController.GAMES_KEY)))
|
||||||
@@ -190,8 +190,8 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void launchAudiosIntent_resolveActionViewNull_settingsIntent() {
|
public void launchAudioIntent_resolveActionViewNull_settingsIntent() {
|
||||||
mPreference.setKey(StorageItemPreferenceController.AUDIOS_KEY);
|
mPreference.setKey(StorageItemPreferenceController.AUDIO_KEY);
|
||||||
final Context mockContext = getMockContext();
|
final Context mockContext = getMockContext();
|
||||||
mController = new StorageItemPreferenceController(mockContext, mFragment, mVolume,
|
mController = new StorageItemPreferenceController(mockContext, mFragment, mVolume,
|
||||||
mSvp, false /* isWorkProfile */);
|
mSvp, false /* isWorkProfile */);
|
||||||
@@ -203,7 +203,7 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
final Intent intent = argumentCaptor.getValue();
|
final Intent intent = argumentCaptor.getValue();
|
||||||
|
|
||||||
assertThat(intent.getAction()).isEqualTo(Intent.ACTION_VIEW);
|
assertThat(intent.getAction()).isEqualTo(Intent.ACTION_VIEW);
|
||||||
assertThat(intent.getData()).isEqualTo(mController.mAudiosUri);
|
assertThat(intent.getData()).isEqualTo(mController.mAudioUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -215,7 +215,7 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
assertThat(mController.mPublicStoragePreference.isVisible()).isFalse();
|
assertThat(mController.mPublicStoragePreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mImagesPreference.isVisible()).isFalse();
|
assertThat(mController.mImagesPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mVideosPreference.isVisible()).isFalse();
|
assertThat(mController.mVideosPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mAudiosPreference.isVisible()).isFalse();
|
assertThat(mController.mAudioPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mAppsPreference.isVisible()).isFalse();
|
assertThat(mController.mAppsPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mGamesPreference.isVisible()).isFalse();
|
assertThat(mController.mGamesPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mDocumentsAndOtherPreference.isVisible()).isFalse();
|
assertThat(mController.mDocumentsAndOtherPreference.isVisible()).isFalse();
|
||||||
@@ -355,7 +355,7 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
|
|
||||||
assertThat(mController.mImagesPreference.getSummary().toString()).isEqualTo("0.35 GB");
|
assertThat(mController.mImagesPreference.getSummary().toString()).isEqualTo("0.35 GB");
|
||||||
assertThat(mController.mVideosPreference.getSummary().toString()).isEqualTo("0.16 GB");
|
assertThat(mController.mVideosPreference.getSummary().toString()).isEqualTo("0.16 GB");
|
||||||
assertThat(mController.mAudiosPreference.getSummary().toString()).isEqualTo("0.14 GB");
|
assertThat(mController.mAudioPreference.getSummary().toString()).isEqualTo("0.14 GB");
|
||||||
assertThat(mController.mAppsPreference.getSummary().toString()).isEqualTo("0.09 GB");
|
assertThat(mController.mAppsPreference.getSummary().toString()).isEqualTo("0.09 GB");
|
||||||
assertThat(mController.mGamesPreference.getSummary().toString()).isEqualTo("0.08 GB");
|
assertThat(mController.mGamesPreference.getSummary().toString()).isEqualTo("0.08 GB");
|
||||||
assertThat(mController.mDocumentsAndOtherPreference.getSummary().toString())
|
assertThat(mController.mDocumentsAndOtherPreference.getSummary().toString())
|
||||||
@@ -371,7 +371,7 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
verify(mController.mPublicStoragePreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mPublicStoragePreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mImagesPreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mImagesPreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mVideosPreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mVideosPreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mAudiosPreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mAudioPreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mAppsPreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mAppsPreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mGamesPreference, times(2)).setIcon(nullable(Drawable.class));
|
verify(mController.mGamesPreference, times(2)).setIcon(nullable(Drawable.class));
|
||||||
verify(mController.mDocumentsAndOtherPreference, times(2))
|
verify(mController.mDocumentsAndOtherPreference, times(2))
|
||||||
@@ -455,7 +455,7 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
assertThat(mController.mPublicStoragePreference.isVisible()).isTrue();
|
assertThat(mController.mPublicStoragePreference.isVisible()).isTrue();
|
||||||
assertThat(mController.mImagesPreference.isVisible()).isFalse();
|
assertThat(mController.mImagesPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mVideosPreference.isVisible()).isFalse();
|
assertThat(mController.mVideosPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mAudiosPreference.isVisible()).isFalse();
|
assertThat(mController.mAudioPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mAppsPreference.isVisible()).isFalse();
|
assertThat(mController.mAppsPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mGamesPreference.isVisible()).isFalse();
|
assertThat(mController.mGamesPreference.isVisible()).isFalse();
|
||||||
assertThat(mController.mDocumentsAndOtherPreference.isVisible()).isFalse();
|
assertThat(mController.mDocumentsAndOtherPreference.isVisible()).isFalse();
|
||||||
|
Reference in New Issue
Block a user