зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a53252c868
Коммит
6861cb3b5b
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче