Fix issue #22989030: Separate battery whitelists

We now have a new whitelist you can put apps in, which
opts them out of the old battery saver mode and new app idle,
but doesn't keep them from going in to doze.  This is for a few
special cases that we had previously whitelisted for battery saver,
and inherited to the new modes...  ultimately we should figure out
how to get these apps out of the whitelist completely, but this
will help for now.

Apps in this new whitelist are not shown in the UI, because they
are still significantly restricted by not being able to operate
normally in doze.  This also means they are still visible in the
list of all apps for the user to be able to put them on/off the
complete whitelist if that is what they really want.

In the course of doing this, I needed to clean up code in the
network policy manager to better separate management of the
two firewall rules that now have different whitelists applied
to them.  This also hopefully just generally simplifies and cleans
up that code.  Hopefully!

Change-Id: I92e15f2f85899571dd8b049b5e3eb1354f55f353
diff --git a/core/java/android/util/SparseIntArray.java b/core/java/android/util/SparseIntArray.java
index 2b85a21..e5c729d 100644
--- a/core/java/android/util/SparseIntArray.java
+++ b/core/java/android/util/SparseIntArray.java
@@ -184,6 +184,14 @@
     }
 
     /**
+     * Directly set the value at a particular index.
+     * @hide
+     */
+    public void setValueAt(int index, int value) {
+        mValues[index] = value;
+    }
+
+    /**
      * Returns the index for which {@link #keyAt} would return the
      * specified key, or a negative number if the specified
      * key is not mapped.