Change ProfileType definition
Bug: 141601408 Test: rebuild Change-Id: Ia4d4fabe8a4daad4ce54c243748fa3c29bf944ba
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
@@ -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[]{
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user