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

Commit 8f5f7ff5 authored by Jason Monk's avatar Jason Monk
Browse files

Add system service for slices

Will be used to manage permissions and possibly pinned state for slices.

Test: manual
Change-Id: Ie53f4988f817ac5b920087567dbac751e2857dbf
parent d52efa56
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ java_library {
        "core/java/android/app/backup/IRestoreObserver.aidl",
        "core/java/android/app/backup/IRestoreSession.aidl",
        "core/java/android/app/backup/ISelectBackupTransportCallback.aidl",
        "core/java/android/app/slice/ISliceManager.aidl",
        "core/java/android/app/timezone/ICallback.aidl",
        "core/java/android/app/timezone/IRulesManager.aidl",
        "core/java/android/app/usage/ICacheQuotaService.aidl",
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ aidl_files := \
	frameworks/base/core/java/android/app/admin/NetworkEvent.aidl \
	frameworks/base/core/java/android/app/admin/SystemUpdatePolicy.aidl \
	frameworks/base/core/java/android/app/admin/PasswordMetrics.aidl \
	frameworks/base/core/java/android/app/slice/ISliceManager.aidl \
	frameworks/base/core/java/android/print/PrintDocumentInfo.aidl \
	frameworks/base/core/java/android/print/PageRange.aidl \
	frameworks/base/core/java/android/print/PrintAttributes.aidl \
+11 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.app.admin.DevicePolicyManager;
import android.app.admin.IDevicePolicyManager;
import android.app.job.IJobScheduler;
import android.app.job.JobScheduler;
import android.app.slice.SliceManager;
import android.app.timezone.RulesManager;
import android.app.trust.TrustManager;
import android.app.usage.IStorageStatsManager;
@@ -944,6 +945,16 @@ final class SystemServiceRegistry {
                                ICrossProfileApps.Stub.asInterface(b));
                    }
                });

        registerService(Context.SLICE_SERVICE, SliceManager.class,
                new CachedServiceFetcher<SliceManager>() {
                    @Override
                    public SliceManager createService(ContextImpl ctx)
                            throws ServiceNotFoundException {
                        return new SliceManager(ctx.getOuterContext(),
                                ctx.mMainThread.getHandler());
                    }
            });
    }

    /**
+21 −0
Original line number Diff line number Diff line
/**
 * Copyright (c) 2017, 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.slice;

/** @hide */
interface ISliceManager {
}
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.slice;

import android.annotation.SystemService;
import android.content.Context;
import android.os.Handler;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;

/**
 * @hide
 */
@SystemService(Context.SLICE_SERVICE)
public class SliceManager {

    private final ISliceManager mService;
    private final Context mContext;

    public SliceManager(Context context, Handler handler) throws ServiceNotFoundException {
        mContext = context;
        mService = ISliceManager.Stub.asInterface(
                ServiceManager.getServiceOrThrow(Context.SLICE_SERVICE));
    }
}
Loading