Change ProfileType definition

Bug: 141601408
Test: rebuild
Change-Id: Ia4d4fabe8a4daad4ce54c243748fa3c29bf944ba
This commit is contained in:
Raff Tsai
2019-12-12 11:45:41 +08:00
parent 1ee247a6a7
commit 1e5d8146b5
12 changed files with 38 additions and 34 deletions

View File

@@ -53,25 +53,28 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
* Denotes the profile type.
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({PERSONAL, WORK, ALL})
@IntDef({
ProfileType.PERSONAL,
ProfileType.WORK,
ProfileType.ALL
})
public @interface ProfileType {
/**
* It is personal work profile.
*/
int PERSONAL = 1;
/**
* It is work profile
*/
int WORK = 1 << 1;
/**
* It is personal and work profile
*/
int ALL = PERSONAL | WORK;
}
/**
* It is personal work profile.
*/
public static final int PERSONAL = 1;
/**
* It is work profile
*/
public static final int WORK = 1 << 1;
/**
* It is personal and work profile
*/
public static final int ALL = PERSONAL | WORK;
/**
* Used in fragment argument and pass {@link ProfileType} to it
*/

View File

@@ -30,12 +30,12 @@ public class ProfileSelectManageApplications extends ProfileSelectFragment {
@Override
public Fragment[] getFragments() {
final Bundle workOnly = getArguments() != null ? getArguments().deepCopy() : new Bundle();
workOnly.putInt(EXTRA_PROFILE, ProfileSelectFragment.WORK);
workOnly.putInt(EXTRA_PROFILE, ProfileSelectFragment.ProfileType.WORK);
final Fragment workFragment = new ManageApplications();
workFragment.setArguments(workOnly);
final Bundle personalOnly = getArguments() != null ? getArguments() : new Bundle();
personalOnly.putInt(EXTRA_PROFILE, ProfileSelectFragment.PERSONAL);
personalOnly.putInt(EXTRA_PROFILE, ProfileSelectFragment.ProfileType.PERSONAL);
final Fragment personalFragment = new ManageApplications();
personalFragment.setArguments(personalOnly);
return new Fragment[]{

View File

@@ -37,7 +37,7 @@ public class ProfileSelectStorageFragment extends ProfileSelectFragment {
final Bundle storageBundle = new Bundle();
storageBundle.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL);
storageBundle.putInt(EXTRA_PROFILE, ProfileSelectFragment.PERSONAL);
storageBundle.putInt(EXTRA_PROFILE, ProfileSelectFragment.ProfileType.PERSONAL);
final Fragment storageDashboardFragment = new StorageDashboardFragment();
storageDashboardFragment.setArguments(storageBundle);