Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67c30861 authored by Robert Kozikowski's avatar Robert Kozikowski
Browse files

Adding Launcher3 callbacks for trimming memory.

It will help reduce memory footprint of Launcher, when in background.
It is required to help deallocate images, when Google Now Launcher
goes into the background. See cl/83222937/ .

Plan after this CL:
- Generate drop CL with launcher3_drop.sh. Add empty metods to
 make code compile.
- Sync the cl/83222937 and hide the code behind the feature flag.

It was previously submitted in ag/628070 and reverted in ag/630423
due to GSA release schedule.

Change-Id: I56eee618b86d518d0afc362b6cf44c3bbec1f19c
parent b823ae4f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3823,6 +3823,9 @@ public class Launcher extends Activity
                mAppsCustomizeTabHost.trimMemory();
            }
        }
        if (mLauncherCallbacks != null) {
            mLauncherCallbacks.onTrimMemory(level);
        }
    }

    protected void showWorkspace(boolean animated) {
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ public interface LauncherCallbacks {
    public void dump(String prefix, FileDescriptor fd, PrintWriter w, String[] args);
    public void onHomeIntent();
    public boolean handleBackPressed();
    public void onTrimMemory(int level);

    /*
     * Extension points for providing custom behavior on certain user interactions.
+4 −0
Original line number Diff line number Diff line
@@ -107,6 +107,10 @@ public class LauncherExtension extends Launcher {
            return false;
        }

        @Override
        public void onTrimMemory(int level) {
        }

        @Override
        public void onLauncherProviderChange() {
        }