Merge "Revert "Calling start/stop listening in onStart/onStop"" into ub-launcher3-calgary

This commit is contained in:
Sunny Goyal 2016-04-28 22:43:10 +00:00 committed by Android (Google) Code Review
commit f8a2ba2707
2 changed files with 6 additions and 6 deletions

View File

@ -958,9 +958,6 @@ public class Launcher extends Activity
protected void onStop() {
super.onStop();
FirstFrameAnimatorHelper.setIsVisible(false);
if (Utilities.isNycOrAbove()) {
mAppWidgetHost.stopListening();
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onStop();
@ -971,9 +968,6 @@ public class Launcher extends Activity
protected void onStart() {
super.onStart();
FirstFrameAnimatorHelper.setIsVisible(true);
if (Utilities.isNycOrAbove()) {
mAppWidgetHost.startListening();
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onStart();

View File

@ -82,6 +82,12 @@ public class LauncherAppWidgetHost extends AppWidgetHost {
}
}
@Override
public void stopListening() {
super.stopListening();
clearViews();
}
public void addProviderChangeListener(Runnable callback) {
mProviderChangeListeners.add(callback);
}