Merge "Fix Settings crash in Storage settings." into oc-dev
This commit is contained in:
@@ -300,6 +300,10 @@ public class StorageItemPreferenceController extends PreferenceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Intent getAudioIntent() {
|
private Intent getAudioIntent() {
|
||||||
|
if (mVolume == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(ManageApplications.EXTRA_CLASSNAME,
|
args.putString(ManageApplications.EXTRA_CLASSNAME,
|
||||||
Settings.StorageUseActivity.class.getName());
|
Settings.StorageUseActivity.class.getName());
|
||||||
@@ -312,6 +316,10 @@ public class StorageItemPreferenceController extends PreferenceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Intent getAppsIntent() {
|
private Intent getAppsIntent() {
|
||||||
|
if (mVolume == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(ManageApplications.EXTRA_CLASSNAME,
|
args.putString(ManageApplications.EXTRA_CLASSNAME,
|
||||||
Settings.StorageUseActivity.class.getName());
|
Settings.StorageUseActivity.class.getName());
|
||||||
|
@@ -146,6 +146,14 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
ManageApplications.STORAGE_TYPE_MUSIC);
|
ManageApplications.STORAGE_TYPE_MUSIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void handlePreferenceTreeClick_tappingAudioWhileUninitializedDoesntCrash() {
|
||||||
|
mController.setVolume(null);
|
||||||
|
|
||||||
|
mPreference.setKey("pref_music_audio");
|
||||||
|
mController.handlePreferenceTreeClick(mPreference);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testClickApps() {
|
public void testClickApps() {
|
||||||
mPreference.setKey("pref_other_apps");
|
mPreference.setKey("pref_other_apps");
|
||||||
@@ -164,6 +172,14 @@ public class StorageItemPreferenceControllerTest {
|
|||||||
.isEqualTo(R.string.apps_storage);
|
.isEqualTo(R.string.apps_storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void handlePreferenceTreeClick_tappingAppsWhileUninitializedDoesntCrash() {
|
||||||
|
mController.setVolume(null);
|
||||||
|
|
||||||
|
mPreference.setKey("pref_other_apps");
|
||||||
|
mController.handlePreferenceTreeClick(mPreference);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testClickFiles() {
|
public void testClickFiles() {
|
||||||
when(mSvp.findEmulatedForPrivate(any(VolumeInfo.class))).thenReturn(mVolume);
|
when(mSvp.findEmulatedForPrivate(any(VolumeInfo.class))).thenReturn(mVolume);
|
||||||
|
Reference in New Issue
Block a user