Add experimental contract and associated build script

Bug: 64691432
Test: builds
Change-Id: I91916f3e3a5fea4744d1b25b4011a8c2f81bdd49
diff --git a/Android.mk b/Android.mk
index 1efed08..5971f74 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,6 +26,9 @@
 LOCAL_STATIC_ANDROID_LIBRARIES := \
     android-support-v4
 
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    settings-intelligence-contract
+
 LOCAL_USE_AAPT2 := true
 
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 94a5fec..d915295 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -21,6 +21,8 @@
     <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="25" />
 
     <application>
-
+        <service
+            android:name=".suggestions.SuggestionService"
+            android:exported="true" />
     </application>
 </manifest>
diff --git a/contract/Android.mk b/contract/Android.mk
new file mode 100644
index 0000000..068decf
--- /dev/null
+++ b/contract/Android.mk
@@ -0,0 +1,15 @@
+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)
diff --git a/contract/src/com/android/settings/intelligence/suggestions/ISuggestionService.aidl b/contract/src/com/android/settings/intelligence/suggestions/ISuggestionService.aidl
new file mode 100644
index 0000000..2269990
--- /dev/null
+++ b/contract/src/com/android/settings/intelligence/suggestions/ISuggestionService.aidl
@@ -0,0 +1,8 @@
+package com.android.settings.intelligence.suggestions;
+
+interface ISuggestionService {
+    /**
+     * Whether the suggestion service is enabled.
+     */
+    boolean isEnabled() = 0;
+}
\ No newline at end of file
diff --git a/src/com/android/settings/intelligence/suggestions/SuggestionService.java b/src/com/android/settings/intelligence/suggestions/SuggestionService.java
new file mode 100644
index 0000000..17a0278
--- /dev/null
+++ b/src/com/android/settings/intelligence/suggestions/SuggestionService.java
@@ -0,0 +1,37 @@
+/*
+ * 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;
+    }
+}
diff --git a/src/com/android/settings/intelligence/suggestions/SuggestionServiceBinder.java b/src/com/android/settings/intelligence/suggestions/SuggestionServiceBinder.java
new file mode 100644
index 0000000..b63ae3e
--- /dev/null
+++ b/src/com/android/settings/intelligence/suggestions/SuggestionServiceBinder.java
@@ -0,0 +1,34 @@
+/*
+ * 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.content.Context;
+import android.os.RemoteException;
+
+public class SuggestionServiceBinder extends ISuggestionService.Stub {
+
+    private final Context mContext;
+
+    public SuggestionServiceBinder(Context context) {
+        mContext = context;
+    }
+
+    @Override
+    public boolean isEnabled() throws RemoteException {
+        return true;
+    }
+}