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

Commit bd5e03b6 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "Notify TrustAgentService when device policy configuration no longer applies"

parents b7f10122 a43fd03b
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) {