Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4 Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
This commit is contained in:
@@ -21,6 +21,7 @@ import android.annotation.RequiresPermission;
|
|||||||
import android.annotation.SdkConstant;
|
import android.annotation.SdkConstant;
|
||||||
import android.annotation.SdkConstant.SdkConstantType;
|
import android.annotation.SdkConstant.SdkConstantType;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
|
import android.annotation.SystemService;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -64,9 +65,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that answers queries about the state of network connectivity. It also
|
* Class that answers queries about the state of network connectivity. It also
|
||||||
* notifies applications when network connectivity changes. Get an instance
|
* notifies applications when network connectivity changes.
|
||||||
* of this class by calling
|
|
||||||
* {@link android.content.Context#getSystemService(String) Context.getSystemService(Context.CONNECTIVITY_SERVICE)}.
|
|
||||||
* <p>
|
* <p>
|
||||||
* The primary responsibilities of this class are to:
|
* The primary responsibilities of this class are to:
|
||||||
* <ol>
|
* <ol>
|
||||||
@@ -80,6 +79,7 @@ import java.util.Map;
|
|||||||
* traffic</li>
|
* traffic</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*/
|
*/
|
||||||
|
@SystemService(Context.CONNECTIVITY_SERVICE)
|
||||||
public class ConnectivityManager {
|
public class ConnectivityManager {
|
||||||
private static final String TAG = "ConnectivityManager";
|
private static final String TAG = "ConnectivityManager";
|
||||||
|
|
||||||
@@ -2110,6 +2110,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)
|
||||||
public void startTethering(int type, boolean showProvisioningUi,
|
public void startTethering(int type, boolean showProvisioningUi,
|
||||||
final OnStartTetheringCallback callback, Handler handler) {
|
final OnStartTetheringCallback callback, Handler handler) {
|
||||||
Preconditions.checkNotNull(callback, "OnStartTetheringCallback cannot be null.");
|
Preconditions.checkNotNull(callback, "OnStartTetheringCallback cannot be null.");
|
||||||
@@ -2146,6 +2147,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)
|
||||||
public void stopTethering(int type) {
|
public void stopTethering(int type) {
|
||||||
try {
|
try {
|
||||||
String pkgName = mContext.getOpPackageName();
|
String pkgName = mContext.getOpPackageName();
|
||||||
|
|||||||
Reference in New Issue
Block a user