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
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index cd2bc59..0414a5b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3823,6 +3823,9 @@
                 mAppsCustomizeTabHost.trimMemory();
             }
         }
+        if (mLauncherCallbacks != null) {
+            mLauncherCallbacks.onTrimMemory(level);
+        }
     }
 
     protected void showWorkspace(boolean animated) {
diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java
index a1f4e0b..d8128d6 100644
--- a/src/com/android/launcher3/LauncherCallbacks.java
+++ b/src/com/android/launcher3/LauncherCallbacks.java
@@ -42,6 +42,7 @@
     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.
diff --git a/src/com/android/launcher3/LauncherExtension.java b/src/com/android/launcher3/LauncherExtension.java
index b264042..fe9bd6c 100644
--- a/src/com/android/launcher3/LauncherExtension.java
+++ b/src/com/android/launcher3/LauncherExtension.java
@@ -108,6 +108,10 @@
         }
 
         @Override
+        public void onTrimMemory(int level) {
+        }
+
+        @Override
         public void onLauncherProviderChange() {
         }