Expose network scoring APIs to /system apps.

Ideally, we'd only expose the methods that we intend unbundled apps to
call (e.g. not NetworkScoreManager#setActiveScorer, which should only
be called by Settings), but this isn't harmful in terms of permissions
as the APIs still check security appropriately.

Bug: 15833200
Change-Id: I2047515b41c8be0cf7cb51dd495fe72309c05f68
diff --git a/core/java/android/net/NetworkKey.java b/core/java/android/net/NetworkKey.java
index bc19658..ffbc401 100644
--- a/core/java/android/net/NetworkKey.java
+++ b/core/java/android/net/NetworkKey.java
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -26,6 +27,7 @@
  *
  * @hide
  */
+@SystemApi
 // NOTE: Ideally, we would abstract away the details of what identifies a network of a specific
 // type, so that all networks appear the same and can be scored without concern to the network type
 // itself. However, because no such cross-type identifier currently exists in the Android framework,
diff --git a/core/java/android/net/NetworkScoreManager.java b/core/java/android/net/NetworkScoreManager.java
index c599dfc..b497c6e 100644
--- a/core/java/android/net/NetworkScoreManager.java
+++ b/core/java/android/net/NetworkScoreManager.java
@@ -18,6 +18,7 @@
 
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
+import android.annotation.SystemApi;
 import android.content.Context;
 import android.content.Intent;
 import android.net.NetworkScorerAppManager.NetworkScorerAppData;
@@ -52,6 +53,7 @@
  *
  * @hide
  */
+@SystemApi
 public class NetworkScoreManager {
     /**
      * Activity action: ask the user to change the active network scorer. This will show a dialog
diff --git a/core/java/android/net/RssiCurve.java b/core/java/android/net/RssiCurve.java
index dd744d3..f653f37 100644
--- a/core/java/android/net/RssiCurve.java
+++ b/core/java/android/net/RssiCurve.java
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -49,6 +50,7 @@
  * @see ScoredNetwork
  * @hide
  */
+@SystemApi
 public class RssiCurve implements Parcelable {
 
     /** The starting dBm of the curve. */
diff --git a/core/java/android/net/ScoredNetwork.java b/core/java/android/net/ScoredNetwork.java
index 7902313..2dfb061 100644
--- a/core/java/android/net/ScoredNetwork.java
+++ b/core/java/android/net/ScoredNetwork.java
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -26,6 +27,7 @@
  *
  * @hide
  */
+@SystemApi
 public class ScoredNetwork implements Parcelable {
 
     /** A {@link NetworkKey} uniquely identifying this network. */
diff --git a/core/java/android/net/WifiKey.java b/core/java/android/net/WifiKey.java
index 9e92e89..71df2f9 100644
--- a/core/java/android/net/WifiKey.java
+++ b/core/java/android/net/WifiKey.java
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -28,6 +29,7 @@
  *
  * @hide
  */
+@SystemApi
 public class WifiKey implements Parcelable {
 
     // Patterns used for validation.
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 350660b..55e02fb 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -819,7 +819,7 @@
         android:description="@string/permdesc_changeWimaxState"
         android:label="@string/permlab_changeWimaxState" />
 
-    <!-- Allows applications to act as network scorers. @hide -->
+    <!-- Allows applications to act as network scorers. @hide @SystemApi-->
     <permission android:name="android.permission.SCORE_NETWORKS"
         android:permissionGroup="android.permission-group.NETWORK"
         android:protectionLevel="normal"