OSDN Git Service

Expose network scoring APIs to /system apps.
authorJeff Davidson <jpd@google.com>
Thu, 17 Jul 2014 00:24:46 +0000 (17:24 -0700)
committerJeff Davidson <jpd@google.com>
Thu, 17 Jul 2014 00:24:46 +0000 (17:24 -0700)
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

core/java/android/net/NetworkKey.java
core/java/android/net/NetworkScoreManager.java
core/java/android/net/RssiCurve.java
core/java/android/net/ScoredNetwork.java
core/java/android/net/WifiKey.java
core/res/AndroidManifest.xml

index bc19658..ffbc401 100644 (file)
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -26,6 +27,7 @@ import java.util.Objects;
  *
  * @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,
index c599dfc..b497c6e 100644 (file)
@@ -18,6 +18,7 @@ package android.net;
 
 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 @@ import android.os.ServiceManager;
  *
  * @hide
  */
+@SystemApi
 public class NetworkScoreManager {
     /**
      * Activity action: ask the user to change the active network scorer. This will show a dialog
index dd744d3..f653f37 100644 (file)
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -49,6 +50,7 @@ import java.util.Objects;
  * @see ScoredNetwork
  * @hide
  */
+@SystemApi
 public class RssiCurve implements Parcelable {
 
     /** The starting dBm of the curve. */
index 7902313..2dfb061 100644 (file)
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -26,6 +27,7 @@ import java.util.Objects;
  *
  * @hide
  */
+@SystemApi
 public class ScoredNetwork implements Parcelable {
 
     /** A {@link NetworkKey} uniquely identifying this network. */
index 9e92e89..71df2f9 100644 (file)
@@ -16,6 +16,7 @@
 
 package android.net;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -28,6 +29,7 @@ import java.util.regex.Pattern;
  *
  * @hide
  */
+@SystemApi
 public class WifiKey implements Parcelable {
 
     // Patterns used for validation.
index 350660b..55e02fb 100644 (file)
         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"