Fix work profile storage bugs.

This makes apps and files in the work profile show up only for the work profile.
It turns out the primary profile's user id was getting piped down to the
special files views and it was showing the primary profile's file sizes
instead of the work ones.

Change-Id: If9c175f24920513c624c522d838bcdbe925566d1
Fixes: 65559258, 65558758, 65559934
Test: Settings robotest and 34768986
This commit is contained in:
Daniel Nishi
2017-09-12 16:52:17 -07:00
parent 22eb007eea
commit 59982c6954
3 changed files with 30 additions and 16 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo.storage;
import static com.android.settings.applications.ManageApplications.EXTRA_WORK_ID;
import static com.android.settings.applications.ManageApplications.EXTRA_WORK_ONLY;
import static com.android.settings.utils.FileSizeFormatter.MEGABYTE_IN_BYTES;
@@ -195,6 +196,10 @@ public class StorageItemPreferenceControllerTest {
intent.getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS)
.getBoolean(EXTRA_WORK_ONLY))
.isTrue();
assertThat(
intent.getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS)
.getInt(EXTRA_WORK_ID))
.isEqualTo(0);
}
@Test