mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
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
This commit is contained in:
@@ -3823,6 +3823,9 @@ public class Launcher extends Activity
|
||||
mAppsCustomizeTabHost.trimMemory();
|
||||
}
|
||||
}
|
||||
if (mLauncherCallbacks != null) {
|
||||
mLauncherCallbacks.onTrimMemory(level);
|
||||
}
|
||||
}
|
||||
|
||||
protected void showWorkspace(boolean animated) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -107,6 +107,10 @@ public class LauncherExtension extends Launcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrimMemory(int level) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLauncherProviderChange() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user