Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a43fd03b authored by Adrian Roos's avatar Adrian Roos
Browse files

Notify TrustAgentService when device policy configuration no longer applies

Also updates the outdated javadoc to match the current API.

Bug: 19500731
Change-Id: I7976bbcc815b84e168718672377a963ffea68c51
parent f855b0d2
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ public class TrustAgentService extends Service {
                case MSG_CONFIGURE:
                    ConfigurationData data = (ConfigurationData) msg.obj;
                    boolean result = onConfigure(data.options);
                    if (data.token != null) {
                        try {
                            synchronized (mLock) {
                                mCallback.onConfigureCompleted(result, data.token);
@@ -129,6 +130,7 @@ public class TrustAgentService extends Service {
                        } catch (RemoteException e) {
                            onError("calling onSetTrustAgentFeaturesEnabledCompleted()");
                        }
                    }
                    break;
                case MSG_TRUST_TIMEOUT:
                    onTrustTimeout();
@@ -203,7 +205,7 @@ public class TrustAgentService extends Service {
     * PersistableBundle)}.
     * <p>Agents that support configuration options should overload this method and return 'true'.
     *
     * @param options bundle containing all options or null if none.
     * @param options The aggregated list of options or an empty list if no restrictions apply.
     * @return true if the {@link TrustAgentService} supports configuration options.
     */
    public boolean onConfigure(List<PersistableBundle> options) {
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.util.Slog;
import android.service.trust.ITrustAgentService;
import android.service.trust.ITrustAgentServiceCallback;

import java.util.Collections;
import java.util.List;

/**
@@ -359,6 +360,8 @@ public class TrustAgentWrapper {
                        mSetTrustAgentFeaturesToken = new Binder();
                        mTrustAgentService.onConfigure(config, mSetTrustAgentFeaturesToken);
                    }
                } else {
                    mTrustAgentService.onConfigure(Collections.EMPTY_LIST, null);
                }
                final long maxTimeToLock = dpm.getMaximumTimeToLock(null);
                if (maxTimeToLock != mMaximumTimeToLock) {