Settings: Fix the memory leak in Settings

Fixed the memory leak in both InstalledAppDetails

Change-Id: I3520b3c1fe1bf98e3baec2ee989eb215164a7cf2
Signed-off-by: Zhijun Peng <pengzhj@marvell.com>
Fix memory leak in ManageApplication

ApplicationsAdapter new a Session member and make it has a reference to
it self. If we don't release it explicitly, the cross reference will
cause memory leak.

Change-Id: Iecce35ae1d56d98cee6347e84d3a3ff57f3b15a5
Total and available fields missing in Settings storage menu

After formatting SD card or inserting an SD card the total and
available space fields in Settings storage are missing.
This fix add those fields after SD card has been mounted.

Change-Id: Id6c1d1963effdb9656c8eb1c567b913bc4d98bd2
Dont show "Erase SD Card" when there is none

On devices with physcal, external SD Cards, the "Erase SD card"
option in in Settings/Storage is available even when there is
no SD card present, this dont make much sense since you cannot
erase a card that is absent. With this change the erase option
is bound to the mount toggle which leads to the following
consequences:

 Card present and mounted -> Erase enabled
 Card present but unmounted -> Erase enabled
 No card present -> Erase disabled
 Card present and MTP attached -> Erase disabled

Change-Id: I756ae8af3e0565febaf940df5f4991dd89105bd9
Fix elapsed time formatting.

We should extend DateUtils to provide this kind of elapsed time
formatting via icu4c, but for now let's at least fix our
arithmetic.

Bug: https://code.google.com/p/android/issues/detail?id=61479
Change-Id: I6c087dbb9fdbff0a21d9243d239126fee180454c
Fix null pointer exceptions in NetworkPolicyEditor

This upload fixes a null pointer exception issue.
After this fix the modified methods return
their corresponding default values instead of null.

Change-Id: Idb94f8b808b8dd18be5e3fc92cc5560ce0f81c4f
Use java.util.Objects instead of internal API

Change-Id: Ib0d797b3e7f2e4f831f52832776b64c0973880b3
'When to daydream' dialog does not follow the JB dialog design guide

The dialog is a single selection popup and according to the
dialogs design guide the popup should close when the user
has make his/her choice, but in this case it does not.

Change-Id: Iac6bc19146a88236d3253d2d846212ce09b4925b
Move "Pulse notification light" to Display settings.

Bug: 5242350
Change-Id: I91cb23ca8f49c1c053710031b0316b10d55fbab4

Conflicts:
	res/xml/display_settings.xml
	src/com/android/settings/DisplaySettings.java
Fix Move "Pulse notification light" to Display settings.
Replace AppOps menu
Revert "AppOps: Fix appops Settings crash under Chinese"

This reverts commit 041d3cfa2672186b903d1186b9e732013b96ad06.