Null pointer exception in FileRotator.java

Sometimes a null pointer exception is thrown when examining files
managed by the file rotator.

The logs from the test show that the Wifi state is changed a large
number of times. On every state change, a write operation is
initiated on the file system. This will eventually result in out
of memory and the call to mBasePath.list() in the maybeRotate(...)
method in FileRotator.java will return null so the iteration will
throw a NullPointerException.

Change-Id: I5d5980d9593bc9ec75281169ca27ee591809903f
Add OpenCnam paid account settings keys

Change-Id: I895b5f2b2a8a8de568e5aa1cea5d66ba490985fc
Add explicit close of Scanner input

The UsbDeviceManager is using a Scanner to identify
the ALSA card/device numbers to use for USB Gadget
audio, with a FileInputStream as its input.

Since FileInputStream implements the Closeable interface
it provides a close() method that should be explictly
called in order to close the stream source and release
any system resources that it might hold.

Change-Id: Ia0ff86d1f3cdf8916becec9c8603915dcbf4d2c8
Signed-off-by: houst0nn <houstonn@gmail.com>
Avoid SystemUI crash due to NPE

BaseStatusBar.createNotificationViews() returns null
when it reports handleNotificationError(), leading to
a forced crash of the misbehaving app. However, it
should not add a null object of Notification.Entry
since it will also crash SystemUI (crashing at compare).

Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581
Signed-off-by: houst0nn <houstonn@gmail.com>
Don't allow MemoryFiles of negative length.

Prevents us from converting a (signed) jint into an
(unsigned) size_t and having horrible things happen.

Change-Id: I0f04e2eb9852ae7fc49b435fd0974f56e86751a4
Signed-off-by: houst0nn <houstonn@gmail.com>
NsdService does not clean up after exiting clients

When a client of the NsdService exits, NsdService should
clean up the requests it has sent to the mDNS daemon:
cancel any pending resource-discovery and resource-resolution
queries, and remove any services registered by this client.

If this isn't done, several bad things happen. The daemon will
continue to run unnecessarily, will report service discoveries
that can't be forwarded on to the client, and will continue to
advertise service ports for an application which is no longer
running until the device is rebooted (mDNS pollution).

Bug: 9801184
Change-Id: I0aa7311480322aefcff16f902fbbf34f50985d38
Signed-off-by: houst0nn <houstonn@gmail.com>
Reduce warning verbosity in aapt

- Attributed source of problems to the correct file.
- Only verify string localizations against valid
  locales.
Bug:13140015
Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269

Signed-off-by: houst0nn <houstonn@gmail.com>
Quicksettings: Correct alignment.

* Fix issues cumulated during quick settings rework, restore android behaviour for margins and ditch empty views (that were applied only to basic constructed tiles).
* Wrap battery views into a separate parent layout so we align only that one that contains both.
* Clean circle battery sizes calculations and ditch inside padding for external margin (derp).
* Increase dual switch area a bit, since is an overlaied view is fine does not affects margins.

Before:
* https://drive.google.com/file/d/0B2UbDLX5_0AjWkFmcEtKN3hJcHM/edit?usp=sharing
* https://drive.google.com/file/d/0B2UbDLX5_0Ajb1F3MWw4UjVpYzg/edit?usp=sharing

After:
* https://drive.google.com/file/d/0B2UbDLX5_0AjY3ZvUm54S1ZURGc/edit?usp=sharing
* https://drive.google.com/file/d/0B2UbDLX5_0AjUXJrMlpTSlpVLTQ/edit?usp=sharing

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
PIE: Unlock screen on triggering recents

* Bring up unlock panel. Clear all is still hidden when lockscreen is showing.
  Thanks to community for pointing this out.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Frameworks: Translation Import Catalan

Change-Id: I1a498ff10abe56618616c272b20371a089679f2c
Frameworks: Translation Import Spanish

Change-Id: I8e80e68194c893d2c45ced00946e37b676d67982
Frameworks: Translation Import German

Change-Id: Iaef7676b5a07ac7459dec33b5a0e4ffc3f543ed5
Frameworks: Translation Import Polish

Change-Id: Ie421c77eb49d35de8003606184051e1d2da1d0bc
Merge "Reduce warning verbosity in aapt" into kitkat
Merge "Avoid SystemUI crash due to NPE" into kitkat
Merge "Don't allow MemoryFiles of negative length." into kitkat
Merge "NsdService does not clean up after exiting clients" into kitkat
Merge "Null pointer exception in FileRotator.java" into kitkat
Merge "Add explicit close of Scanner input" into kitkat
Frameworks: Translation Import Indonesian

Change-Id: If0c177a615e9bdd438febe27a3ce01a08d0d8eea