Loading api/current.txt +10 −6 Original line number Diff line number Diff line Loading @@ -6754,12 +6754,6 @@ package android.bluetooth.le { package android.content { public abstract class AbstractRestrictionsProvider extends android.content.BroadcastReceiver { ctor public AbstractRestrictionsProvider(); method public void onReceive(android.content.Context, android.content.Intent); method public abstract void requestPermission(android.content.Context, java.lang.String, java.lang.String, java.lang.String, android.os.PersistableBundle); } public abstract class AbstractThreadedSyncAdapter { ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean); ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean, boolean); Loading Loading @@ -27419,6 +27413,16 @@ package android.service.notification { } package android.service.restrictions { public abstract class RestrictionsReceiver extends android.content.BroadcastReceiver { ctor public RestrictionsReceiver(); method public void onReceive(android.content.Context, android.content.Intent); method public abstract void onRequestPermission(android.content.Context, java.lang.String, java.lang.String, java.lang.String, android.os.PersistableBundle); } } package android.service.textservice { public abstract class SpellCheckerService extends android.app.Service { core/java/android/app/admin/DevicePolicyManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.app.Activity; import android.app.admin.IDevicePolicyManager; import android.content.AbstractRestrictionsProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -39,6 +38,7 @@ import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.restrictions.RestrictionsReceiver; import android.util.Log; import com.android.org.conscrypt.TrustedCertificateStore; Loading Loading @@ -3037,7 +3037,7 @@ public class DevicePolicyManager { * Only a profile owner can designate the restrictions provider. * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param provider The component name of the service that implements * {@link AbstractRestrictionsProvider}. If this param is null, * {@link RestrictionsReceiver}. If this param is null, * it removes the restrictions provider previously assigned. */ public void setRestrictionsProvider(ComponentName admin, ComponentName provider) { Loading core/java/android/content/AbstractRestrictionsProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.IBinder; import android.os.PersistableBundle; /** * @hide * Abstract implementation of a Restrictions Provider BroadcastReceiver. To implement a * Restrictions Provider, extend from this class and implement the abstract methods. * Export this receiver in the manifest. A profile owner device admin can then register this Loading @@ -33,6 +34,8 @@ import android.os.PersistableBundle; * {@link RestrictionsManager#notifyPermissionResponse(String, PersistableBundle)}. * * @see RestrictionsManager * TODO: STOPSHIP: Remove before L ships, after clients have switched over * to android.service.restrictions.RestrictionsReceiver. Bug: 17006805 */ public abstract class AbstractRestrictionsProvider extends BroadcastReceiver { Loading core/java/android/content/RestrictionsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.res.XmlResourceParser; import android.os.Bundle; import android.os.PersistableBundle; import android.os.RemoteException; import android.service.restrictions.RestrictionsReceiver; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; Loading Loading @@ -107,7 +108,7 @@ import java.util.List; * </pre> * * @see RestrictionEntry * @see AbstractRestrictionsProvider * @see RestrictionsReceiver * @see DevicePolicyManager#setRestrictionsProvider(ComponentName, ComponentName) * @see DevicePolicyManager#setApplicationRestrictions(ComponentName, String, Bundle) */ Loading core/java/android/service/restrictions/RestrictionsReceiver.java 0 → 100644 +86 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.restrictions; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.RestrictionsManager; import android.os.IBinder; import android.os.PersistableBundle; /** * Abstract implementation of a Restrictions Provider BroadcastReceiver. To implement a * Restrictions Provider, extend from this class and implement the abstract methods. * Export this receiver in the manifest. A profile owner device admin can then register this * component as a Restrictions Provider using * {@link DevicePolicyManager#setRestrictionsProvider(ComponentName, ComponentName)}. * <p> * The function of a Restrictions Provider is to transport permission requests from apps on this * device to an administrator (most likely on a remote device or computer) and deliver back * responses. The response should be sent back to the app via * {@link RestrictionsManager#notifyPermissionResponse(String, PersistableBundle)}. * * @see RestrictionsManager */ public abstract class RestrictionsReceiver extends BroadcastReceiver { private static final String TAG = "RestrictionsReceiver"; /** * An asynchronous permission request made by an application for an operation that requires * authorization by a local or remote administrator other than the user. The Restrictions * Provider should transfer the request to the administrator and deliver back a response, when * available. The calling application is aware that the response could take an indefinite * amount of time. * <p> * If the request bundle contains the key {@link RestrictionsManager#REQUEST_KEY_NEW_REQUEST}, * then a new request must be sent. Otherwise the provider can look up any previous response * to the same requestId and return the cached response. * * @param packageName the application requesting permission. * @param requestType the type of request, which determines the content and presentation of * the request data. * @param request the request data bundle containing at a minimum a request id. * * @see RestrictionsManager#REQUEST_TYPE_APPROVAL * @see RestrictionsManager#REQUEST_TYPE_LOCAL_APPROVAL * @see RestrictionsManager#REQUEST_KEY_ID */ public abstract void onRequestPermission(Context context, String packageName, String requestType, String requestId, PersistableBundle request); /** * Intercept standard Restrictions Provider broadcasts. Implementations * should not override this method; it is better to implement the * convenience callbacks for each action. */ @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (RestrictionsManager.ACTION_REQUEST_PERMISSION.equals(action)) { String packageName = intent.getStringExtra(RestrictionsManager.EXTRA_PACKAGE_NAME); String requestType = intent.getStringExtra(RestrictionsManager.EXTRA_REQUEST_TYPE); String requestId = intent.getStringExtra(RestrictionsManager.EXTRA_REQUEST_ID); PersistableBundle request = (PersistableBundle) intent.getParcelableExtra(RestrictionsManager.EXTRA_REQUEST_BUNDLE); onRequestPermission(context, packageName, requestType, requestId, request); } } } Loading
api/current.txt +10 −6 Original line number Diff line number Diff line Loading @@ -6754,12 +6754,6 @@ package android.bluetooth.le { package android.content { public abstract class AbstractRestrictionsProvider extends android.content.BroadcastReceiver { ctor public AbstractRestrictionsProvider(); method public void onReceive(android.content.Context, android.content.Intent); method public abstract void requestPermission(android.content.Context, java.lang.String, java.lang.String, java.lang.String, android.os.PersistableBundle); } public abstract class AbstractThreadedSyncAdapter { ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean); ctor public AbstractThreadedSyncAdapter(android.content.Context, boolean, boolean); Loading Loading @@ -27419,6 +27413,16 @@ package android.service.notification { } package android.service.restrictions { public abstract class RestrictionsReceiver extends android.content.BroadcastReceiver { ctor public RestrictionsReceiver(); method public void onReceive(android.content.Context, android.content.Intent); method public abstract void onRequestPermission(android.content.Context, java.lang.String, java.lang.String, java.lang.String, android.os.PersistableBundle); } } package android.service.textservice { public abstract class SpellCheckerService extends android.app.Service {
core/java/android/app/admin/DevicePolicyManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.app.Activity; import android.app.admin.IDevicePolicyManager; import android.content.AbstractRestrictionsProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -39,6 +38,7 @@ import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.service.restrictions.RestrictionsReceiver; import android.util.Log; import com.android.org.conscrypt.TrustedCertificateStore; Loading Loading @@ -3037,7 +3037,7 @@ public class DevicePolicyManager { * Only a profile owner can designate the restrictions provider. * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param provider The component name of the service that implements * {@link AbstractRestrictionsProvider}. If this param is null, * {@link RestrictionsReceiver}. If this param is null, * it removes the restrictions provider previously assigned. */ public void setRestrictionsProvider(ComponentName admin, ComponentName provider) { Loading
core/java/android/content/AbstractRestrictionsProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.IBinder; import android.os.PersistableBundle; /** * @hide * Abstract implementation of a Restrictions Provider BroadcastReceiver. To implement a * Restrictions Provider, extend from this class and implement the abstract methods. * Export this receiver in the manifest. A profile owner device admin can then register this Loading @@ -33,6 +34,8 @@ import android.os.PersistableBundle; * {@link RestrictionsManager#notifyPermissionResponse(String, PersistableBundle)}. * * @see RestrictionsManager * TODO: STOPSHIP: Remove before L ships, after clients have switched over * to android.service.restrictions.RestrictionsReceiver. Bug: 17006805 */ public abstract class AbstractRestrictionsProvider extends BroadcastReceiver { Loading
core/java/android/content/RestrictionsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.res.XmlResourceParser; import android.os.Bundle; import android.os.PersistableBundle; import android.os.RemoteException; import android.service.restrictions.RestrictionsReceiver; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; Loading Loading @@ -107,7 +108,7 @@ import java.util.List; * </pre> * * @see RestrictionEntry * @see AbstractRestrictionsProvider * @see RestrictionsReceiver * @see DevicePolicyManager#setRestrictionsProvider(ComponentName, ComponentName) * @see DevicePolicyManager#setApplicationRestrictions(ComponentName, String, Bundle) */ Loading
core/java/android/service/restrictions/RestrictionsReceiver.java 0 → 100644 +86 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.restrictions; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.RestrictionsManager; import android.os.IBinder; import android.os.PersistableBundle; /** * Abstract implementation of a Restrictions Provider BroadcastReceiver. To implement a * Restrictions Provider, extend from this class and implement the abstract methods. * Export this receiver in the manifest. A profile owner device admin can then register this * component as a Restrictions Provider using * {@link DevicePolicyManager#setRestrictionsProvider(ComponentName, ComponentName)}. * <p> * The function of a Restrictions Provider is to transport permission requests from apps on this * device to an administrator (most likely on a remote device or computer) and deliver back * responses. The response should be sent back to the app via * {@link RestrictionsManager#notifyPermissionResponse(String, PersistableBundle)}. * * @see RestrictionsManager */ public abstract class RestrictionsReceiver extends BroadcastReceiver { private static final String TAG = "RestrictionsReceiver"; /** * An asynchronous permission request made by an application for an operation that requires * authorization by a local or remote administrator other than the user. The Restrictions * Provider should transfer the request to the administrator and deliver back a response, when * available. The calling application is aware that the response could take an indefinite * amount of time. * <p> * If the request bundle contains the key {@link RestrictionsManager#REQUEST_KEY_NEW_REQUEST}, * then a new request must be sent. Otherwise the provider can look up any previous response * to the same requestId and return the cached response. * * @param packageName the application requesting permission. * @param requestType the type of request, which determines the content and presentation of * the request data. * @param request the request data bundle containing at a minimum a request id. * * @see RestrictionsManager#REQUEST_TYPE_APPROVAL * @see RestrictionsManager#REQUEST_TYPE_LOCAL_APPROVAL * @see RestrictionsManager#REQUEST_KEY_ID */ public abstract void onRequestPermission(Context context, String packageName, String requestType, String requestId, PersistableBundle request); /** * Intercept standard Restrictions Provider broadcasts. Implementations * should not override this method; it is better to implement the * convenience callbacks for each action. */ @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (RestrictionsManager.ACTION_REQUEST_PERMISSION.equals(action)) { String packageName = intent.getStringExtra(RestrictionsManager.EXTRA_PACKAGE_NAME); String requestType = intent.getStringExtra(RestrictionsManager.EXTRA_REQUEST_TYPE); String requestId = intent.getStringExtra(RestrictionsManager.EXTRA_REQUEST_ID); PersistableBundle request = (PersistableBundle) intent.getParcelableExtra(RestrictionsManager.EXTRA_REQUEST_BUNDLE); onRequestPermission(context, packageName, requestType, requestId, request); } } }