diff options
author | Seth Raphael <magicseth@google.com> | 2013-09-26 13:51:07 -0700 |
---|---|---|
committer | Seth Raphael <magicseth@google.com> | 2013-09-26 13:51:07 -0700 |
commit | 667880948de7a051f62359878cb61c1e0a867e24 (patch) | |
tree | 665d1eed477298a5b430223f2c14e90adf5ce1ec /src | |
parent | 67685a78a29a0311043f38f8766a1fbbf881a599 (diff) | |
download | android_packages_apps_Snap-667880948de7a051f62359878cb61c1e0a867e24.tar.gz android_packages_apps_Snap-667880948de7a051f62359878cb61c1e0a867e24.tar.bz2 android_packages_apps_Snap-667880948de7a051f62359878cb61c1e0a867e24.zip |
Remove PopupManager to remove a memory leak
PopupManager had been previously refactored out
but vestiges remained. They were causing a memory
leak of Activities in its hash map.
Bug: 10728773
Change-Id: Ia6d98db1f0d30b4e879984033b471e8c802bc1c1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaModule.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/ui/PopupManager.java | 66 |
4 files changed, 0 insertions, 75 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 00a5f01a5..4438dec53 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -63,7 +63,6 @@ import com.android.camera.exif.ExifTag; import com.android.camera.exif.Rational; import com.android.camera.ui.CountDownView.OnCountDownFinishedListener; import com.android.camera.ui.ModuleSwitcher; -import com.android.camera.ui.PopupManager; import com.android.camera.ui.RotateTextToast; import com.android.camera.util.ApiHelper; import com.android.camera.util.CameraUtil; @@ -1206,8 +1205,6 @@ public class PhotoModule } keepScreenOnAwhile(); - // Dismiss open menu if exists. - PopupManager.getInstance(mActivity).notifyShowPopup(null); UsageStatistics.onContentViewChanged( UsageStatistics.COMPONENT_CAMERA, "PhotoModule"); diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index b8b3fcf9d..dc04c8017 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -57,7 +57,6 @@ import com.android.camera.CameraManager.CameraPictureCallback; import com.android.camera.CameraManager.CameraProxy; import com.android.camera.app.OrientationManager; import com.android.camera.exif.ExifInterface; -import com.android.camera.ui.PopupManager; import com.android.camera.ui.RotateTextToast; import com.android.camera.util.AccessibilityUtils; import com.android.camera.util.ApiHelper; @@ -689,8 +688,6 @@ public class VideoModule implements CameraModule, mOnResumeTime = SystemClock.uptimeMillis(); mHandler.sendEmptyMessageDelayed(CHECK_DISPLAY_ROTATION, 100); } - // Dismiss open menu if exists. - PopupManager.getInstance(mActivity).notifyShowPopup(null); UsageStatistics.onContentViewChanged( UsageStatistics.COMPONENT_CAMERA, "VideoModule"); diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index fb7137e20..189bf99d1 100644 --- a/src/com/android/camera/WideAnglePanoramaModule.java +++ b/src/com/android/camera/WideAnglePanoramaModule.java @@ -47,7 +47,6 @@ import android.view.WindowManager; import com.android.camera.CameraManager.CameraProxy; import com.android.camera.app.OrientationManager; import com.android.camera.exif.ExifInterface; -import com.android.camera.ui.PopupManager; import com.android.camera.util.CameraUtil; import com.android.camera.util.UsageStatistics; import com.android.camera2.R; @@ -881,8 +880,6 @@ public class WideAnglePanoramaModule mContentResolver); mLocationManager.recordLocation(recordLocation); - // Dismiss open menu if exists. - PopupManager.getInstance(mActivity).notifyShowPopup(null); UsageStatistics.onContentViewChanged( UsageStatistics.COMPONENT_CAMERA, "PanoramaModule"); } diff --git a/src/com/android/camera/ui/PopupManager.java b/src/com/android/camera/ui/PopupManager.java deleted file mode 100644 index 0dcf34fd7..000000000 --- a/src/com/android/camera/ui/PopupManager.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.camera.ui; - -import android.content.Context; -import android.view.View; - -import java.util.ArrayList; -import java.util.HashMap; - -/** - * A manager which notifies the event of a new popup in order to dismiss the - * old popup if exists. - */ -public class PopupManager { - private static HashMap<Context, PopupManager> sMap = - new HashMap<Context, PopupManager>(); - - public interface OnOtherPopupShowedListener { - public void onOtherPopupShowed(); - } - - private PopupManager() {} - - private ArrayList<OnOtherPopupShowedListener> mListeners = new ArrayList<OnOtherPopupShowedListener>(); - - public void notifyShowPopup(View view) { - for (OnOtherPopupShowedListener listener : mListeners) { - if ((View) listener != view) { - listener.onOtherPopupShowed(); - } - } - } - - public void setOnOtherPopupShowedListener(OnOtherPopupShowedListener listener) { - mListeners.add(listener); - } - - public static PopupManager getInstance(Context context) { - PopupManager instance = sMap.get(context); - if (instance == null) { - instance = new PopupManager(); - sMap.put(context, instance); - } - return instance; - } - - public static void removeInstance(Context context) { - PopupManager instance = sMap.get(context); - sMap.remove(context); - } -} |