Stability fixes for Settings. Asynchronous callbacks causing NPEs.
Bug: 4598717 Change-Id: I7f1c5bf6e079bb36301e81085096c5b82615814b
This commit is contained in:
@@ -230,6 +230,7 @@ public class ManageAccountsSettings extends AccountPreferenceBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setBackgroundDataInt(boolean enabled) {
|
private void setBackgroundDataInt(boolean enabled) {
|
||||||
|
if (getActivity() == null) return;
|
||||||
final ConnectivityManager connManager = (ConnectivityManager)
|
final ConnectivityManager connManager = (ConnectivityManager)
|
||||||
getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
|
getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
connManager.setBackgroundDataSetting(enabled);
|
connManager.setBackgroundDataSetting(enabled);
|
||||||
@@ -315,6 +316,7 @@ public class ManageAccountsSettings extends AccountPreferenceBase
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccountsUpdated(Account[] accounts) {
|
public void onAccountsUpdated(Account[] accounts) {
|
||||||
|
if (getActivity() == null) return;
|
||||||
mManageAccountsCategory.removeAll();
|
mManageAccountsCategory.removeAll();
|
||||||
for (int i = 0, n = accounts.length; i < n; i++) {
|
for (int i = 0, n = accounts.length; i < n; i++) {
|
||||||
final Account account = accounts[i];
|
final Account account = accounts[i];
|
||||||
|
Reference in New Issue
Block a user