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

Commit 15ae140b authored by Jason Parks's avatar Jason Parks
Browse files

Add SupervisionAppService

This base class will be implemented by supervision apps and used by
the SupervisionService to handle callbacks.

Test: m
Bug: 389123070
Flag: EXEMPT flag definition android.app.superivsion.flags.enable_supervision_app_service
Change-Id: Ib6165bfd998dc7cc273c6605a3821fa507b57e84
parent e2bfbd6c
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.app.supervision;

/**
 * @hide
 */
interface ISupervisionAppService {
}
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.app.supervision;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

/**
 * Base class for a service that the {@code android.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION}
 * role holder must implement.
 *
 * @hide
 */
public class SupervisionAppService extends Service {
    private final ISupervisionAppService mBinder = new ISupervisionAppService.Stub() {
    };

    @Override
    public final IBinder onBind(Intent intent) {
        return mBinder.asBinder();
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -32,3 +32,11 @@ flag {
  description: "Flag that deprecates supervision methods in DPM"
  bug: "382034839"
}

flag {
  name: "enable_supervision_app_service"
  is_exported: true
  namespace: "supervision"
  description: "Flag to enable the SupervisionAppService"
  bug: "389123070"
}