Bug 838398 - Make sure SyncType.onDestroy() is called when AboutHomePromoBox is removed. r=mfinkle

--HG--
rename : services/sync/tests/unit/test_utils_json.js => services/common/tests/unit/test_utils_json.js
extra : rebase_source : 4e9db7d7954d9138776bcfc1812764dcfa7bc989
This commit is contained in:
Brian Nicholson 2013-02-06 10:45:19 -08:00
Родитель a53252c868
Коммит 6861cb3b5b
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,14 @@ public class AboutHomePromoBox extends TextView implements View.OnClickListener
return true;
}
public void onClick(View v) { }
public void onDestroy() { }
}
@Override
protected void onDetachedFromWindow() {
for (Type type : mTypes) {
type.onDestroy();
}
}
private class SyncType extends Type {
@ -75,6 +83,7 @@ public class AboutHomePromoBox extends TextView implements View.OnClickListener
context.startActivity(intent);
}
@Override
public void onDestroy() {
if (mAccountListener != null) {
AccountManager.get(mContext).removeOnAccountsUpdatedListener(mAccountListener);