Code clean-ups following moving the managed profile under accounts

Bug: 16234745
Change-Id: I7b4799157394a85a27610de7e059c846f77dda02
This commit is contained in:
Alexandra Gherghina
2014-09-03 11:01:45 +01:00
parent d6cfeba9f7
commit e529bb9841

View File

@@ -31,9 +31,6 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.pm.UserInfo; import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.UserHandle; import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
@@ -117,6 +114,7 @@ public class AccountSettings extends SettingsPreferenceFragment
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mUm = (UserManager) getSystemService(Context.USER_SERVICE); mUm = (UserManager) getSystemService(Context.USER_SERVICE);
mProfileNotAvailablePreference = new Preference(getActivity());
setHasOptionsMenu(true); setHasOptionsMenu(true);
} }
@@ -335,16 +333,11 @@ public class AccountSettings extends SettingsPreferenceFragment
} }
} else { } else {
// Put a label instead of the accounts list // Put a label instead of the accounts list
synchronized (this) { mProfileNotAvailablePreference.setEnabled(false);
if (mProfileNotAvailablePreference == null) { mProfileNotAvailablePreference.setIcon(R.drawable.empty_icon);
mProfileNotAvailablePreference = new Preference(getActivity()); mProfileNotAvailablePreference.setTitle(null);
mProfileNotAvailablePreference.setEnabled(false); mProfileNotAvailablePreference.setSummary(
mProfileNotAvailablePreference.setIcon(R.drawable.empty_icon); R.string.managed_profile_not_available_label);
mProfileNotAvailablePreference.setTitle(null);
mProfileNotAvailablePreference.setSummary(
R.string.managed_profile_not_available_label);
}
}
profileData.preferenceGroup.addPreference(mProfileNotAvailablePreference); profileData.preferenceGroup.addPreference(mProfileNotAvailablePreference);
} }
if (profileData.removeWorkProfilePreference != null) { if (profileData.removeWorkProfilePreference != null) {