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

Commit 2287e17c authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Git Automerger
Browse files

am 06439fd2: am cb80cb70: am 37548994: Merge "StorageManager: fix issue that...

am 06439fd2: am cb80cb70: am 37548994: Merge "StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test."

* commit '06439fd2':
  StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test.
parents 838e4ecb 06439fd2
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class StorageManager
    /*
     * Our internal MountService binder reference
     */
    private IMountService mMountService;
    final private IMountService mMountService;

    /*
     * The looper target for callbacks
@@ -304,8 +304,6 @@ public class StorageManager
            return;
        }
        mTgtLooper = tgtLooper;
        mBinderListener = new MountServiceBinderListener();
        mMountService.registerListener(mBinderListener);
    }


@@ -322,6 +320,15 @@ public class StorageManager
        }

        synchronized (mListeners) {
            if (mBinderListener == null ) {
                try {
                    mBinderListener = new MountServiceBinderListener();
                    mMountService.registerListener(mBinderListener);
                } catch (RemoteException rex) {
                    Log.e(TAG, "Register mBinderListener failed");
                    return;
                }
            }
            mListeners.add(new ListenerDelegate(listener));
        }
    }
@@ -347,6 +354,14 @@ public class StorageManager
                    break;
                }
            }
            if (mListeners.size() == 0 && mBinderListener != null) {
                try {
                    mMountService.unregisterListener(mBinderListener);
                } catch (RemoteException rex) {
                    Log.e(TAG, "Unregister mBinderListener failed");
                    return;
                }
            }
       }
    }