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

Commit 9e2df600 authored by Fan Zhang's avatar Fan Zhang
Browse files

Add experimental contract and associated build script

Bug: 64691432
Test: builds
Change-Id: I91916f3e3a5fea4744d1b25b4011a8c2f81bdd49
parent 32c9cf74
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_ANDROID_LIBRARIES := \
    android-support-v4

LOCAL_STATIC_JAVA_LIBRARIES := \
    settings-intelligence-contract

LOCAL_USE_AAPT2 := true

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
    <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="25" />

    <application>

        <service
            android:name=".suggestions.SuggestionService"
            android:exported="true" />
    </application>
</manifest>

contract/Android.mk

0 → 100644
+15 −0
Original line number Diff line number Diff line
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := settings-intelligence-contract

LOCAL_STATIC_JAVA_LIBRARIES := android-support-annotations

LOCAL_SRC_FILES := \
        $(call all-java-files-under, src) \
        $(call all-aidl-files-under, src) \
        $(call all-Iaidl-files-under, src)

LOCAL_SDK_VERSION := system_current

include $(BUILD_STATIC_JAVA_LIBRARY)
+8 −0
Original line number Diff line number Diff line
package com.android.settings.intelligence.suggestions;

interface ISuggestionService {
    /**
     * Whether the suggestion service is enabled.
     */
    boolean isEnabled() = 0;
}
 No newline at end of file
+37 −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 com.android.settings.intelligence.suggestions;

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

public class SuggestionService extends Service {

    private SuggestionServiceBinder mServiceBinder;

    @Override
    public void onCreate() {
        super.onCreate();
        mServiceBinder = new SuggestionServiceBinder(this);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return mServiceBinder;
    }
}
Loading