<NME> NewService.java
<BEF> ADDFILE
<MSG> Add service to submit a new topic.

<DFF> @@ -0,0 +1,91 @@
+package com.lincanbin.carbonforum.service;
+
+import android.app.IntentService;
+import android.content.Context;
+import android.content.Intent;
+
+/**
+ * An {@link IntentService} subclass for handling asynchronous task requests in
+ * a service on a separate handler thread.
+ * <p/>
+ * TODO: Customize class - update intent actions, extra parameters and static
+ * helper methods.
+ */
+public class NewService extends IntentService {
+    // TODO: Rename actions, choose action names that describe tasks that this
+    // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS
+    private static final String ACTION_FOO = "com.lincanbin.carbonforum.service.action.FOO";
+    private static final String ACTION_BAZ = "com.lincanbin.carbonforum.service.action.BAZ";
+
+    // TODO: Rename parameters
+    private static final String EXTRA_PARAM1 = "com.lincanbin.carbonforum.service.extra.PARAM1";
+    private static final String EXTRA_PARAM2 = "com.lincanbin.carbonforum.service.extra.PARAM2";
+
+    /**
+     * Starts this service to perform action Foo with the given parameters. If
+     * the service is already performing a task this action will be queued.
+     *
+     * @see IntentService
+     */
+    // TODO: Customize helper method
+    public static void startActionFoo(Context context, String param1, String param2) {
+        Intent intent = new Intent(context, NewService.class);
+        intent.setAction(ACTION_FOO);
+        intent.putExtra(EXTRA_PARAM1, param1);
+        intent.putExtra(EXTRA_PARAM2, param2);
+        context.startService(intent);
+    }
+
+    /**
+     * Starts this service to perform action Baz with the given parameters. If
+     * the service is already performing a task this action will be queued.
+     *
+     * @see IntentService
+     */
+    // TODO: Customize helper method
+    public static void startActionBaz(Context context, String param1, String param2) {
+        Intent intent = new Intent(context, NewService.class);
+        intent.setAction(ACTION_BAZ);
+        intent.putExtra(EXTRA_PARAM1, param1);
+        intent.putExtra(EXTRA_PARAM2, param2);
+        context.startService(intent);
+    }
+
+    public NewService() {
+        super("NewService");
+    }
+
+    @Override
+    protected void onHandleIntent(Intent intent) {
+        if (intent != null) {
+            final String action = intent.getAction();
+            if (ACTION_FOO.equals(action)) {
+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);
+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);
+                handleActionFoo(param1, param2);
+            } else if (ACTION_BAZ.equals(action)) {
+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);
+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);
+                handleActionBaz(param1, param2);
+            }
+        }
+    }
+
+    /**
+     * Handle action Foo in the provided background thread with the provided
+     * parameters.
+     */
+    private void handleActionFoo(String param1, String param2) {
+        // TODO: Handle action Foo
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+    /**
+     * Handle action Baz in the provided background thread with the provided
+     * parameters.
+     */
+    private void handleActionBaz(String param1, String param2) {
+        // TODO: Handle action Baz
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+}

{'commit': 'diff --git a/.travis.yml b/.travis.yml\nindex 6540e11..b7558eb 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -29,7 +29,7 @@ android:\n \n env:\n   global:\n-    - ADB_INSTALL_TIMEOUT=8 # minutes (2 minutes by default)\n+    - ADB_INSTALL_TIMEOUT=12 # minutes (2 minutes by default)\n \n \n  # Emulator Management: Create, Start and Wait\ndiff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml\nindex a67b965..d5a40a8 100644\n--- a/app/src/main/AndroidManifest.xml\n+++ b/app/src/main/AndroidManifest.xml\n@@ -86,6 +86,10 @@\n                 android:name="android.support.PARENT_ACTIVITY"\r\n                 android:value="com.lincanbin.carbonforum.IndexActivity" />\r\n         </activity>\r\n+\r\n+        <service\r\n+            android:name=".service.NewService"\r\n+            android:exported="false"></service>\r\n     </application>\r\n \r\n </manifest>\r\ndiff --git a/app/src/main/java/com/lincanbin/carbonforum/service/NewService.java b/app/src/main/java/com/lincanbin/carbonforum/service/NewService.java\nnew file mode 100644\nindex 0000000..3f4d200\n--- /dev/null\n+++ b/app/src/main/java/com/lincanbin/carbonforum/service/NewService.java\n@@ -0,0 +1,91 @@\n+package com.lincanbin.carbonforum.service;\r\n+\r\n+import android.app.IntentService;\r\n+import android.content.Context;\r\n+import android.content.Intent;\r\n+\r\n+/**\r\n+ * An {@link IntentService} subclass for handling asynchronous task requests in\r\n+ * a service on a separate handler thread.\r\n+ * <p/>\r\n+ * TODO: Customize class - update intent actions, extra parameters and static\r\n+ * helper methods.\r\n+ */\r\n+public class NewService extends IntentService {\r\n+    // TODO: Rename actions, choose action names that describe tasks that this\r\n+    // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS\r\n+    private static final String ACTION_FOO = "com.lincanbin.carbonforum.service.action.FOO";\r\n+    private static final String ACTION_BAZ = "com.lincanbin.carbonforum.service.action.BAZ";\r\n+\r\n+    // TODO: Rename parameters\r\n+    private static final String EXTRA_PARAM1 = "com.lincanbin.carbonforum.service.extra.PARAM1";\r\n+    private static final String EXTRA_PARAM2 = "com.lincanbin.carbonforum.service.extra.PARAM2";\r\n+\r\n+    /**\r\n+     * Starts this service to perform action Foo with the given parameters. If\r\n+     * the service is already performing a task this action will be queued.\r\n+     *\r\n+     * @see IntentService\r\n+     */\r\n+    // TODO: Customize helper method\r\n+    public static void startActionFoo(Context context, String param1, String param2) {\r\n+        Intent intent = new Intent(context, NewService.class);\r\n+        intent.setAction(ACTION_FOO);\r\n+        intent.putExtra(EXTRA_PARAM1, param1);\r\n+        intent.putExtra(EXTRA_PARAM2, param2);\r\n+        context.startService(intent);\r\n+    }\r\n+\r\n+    /**\r\n+     * Starts this service to perform action Baz with the given parameters. If\r\n+     * the service is already performing a task this action will be queued.\r\n+     *\r\n+     * @see IntentService\r\n+     */\r\n+    // TODO: Customize helper method\r\n+    public static void startActionBaz(Context context, String param1, String param2) {\r\n+        Intent intent = new Intent(context, NewService.class);\r\n+        intent.setAction(ACTION_BAZ);\r\n+        intent.putExtra(EXTRA_PARAM1, param1);\r\n+        intent.putExtra(EXTRA_PARAM2, param2);\r\n+        context.startService(intent);\r\n+    }\r\n+\r\n+    public NewService() {\r\n+        super("NewService");\r\n+    }\r\n+\r\n+    @Override\r\n+    protected void onHandleIntent(Intent intent) {\r\n+        if (intent != null) {\r\n+            final String action = intent.getAction();\r\n+            if (ACTION_FOO.equals(action)) {\r\n+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);\r\n+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);\r\n+                handleActionFoo(param1, param2);\r\n+            } else if (ACTION_BAZ.equals(action)) {\r\n+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);\r\n+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);\r\n+                handleActionBaz(param1, param2);\r\n+            }\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Handle action Foo in the provided background thread with the provided\r\n+     * parameters.\r\n+     */\r\n+    private void handleActionFoo(String param1, String param2) {\r\n+        // TODO: Handle action Foo\r\n+        throw new UnsupportedOperationException("Not yet implemented");\r\n+    }\r\n+\r\n+    /**\r\n+     * Handle action Baz in the provided background thread with the provided\r\n+     * parameters.\r\n+     */\r\n+    private void handleActionBaz(String param1, String param2) {\r\n+        // TODO: Handle action Baz\r\n+        throw new UnsupportedOperationException("Not yet implemented");\r\n+    }\r\n+}\r\n', 'commit_subject': 'Add service to submit a new topic.', 'repo_name': 'lincanbin/Android-Carbon-Forum', 'committer': {'name': 'lincanbin', 'email': '98ca85e3d2d7c3b8eb698d84c1dc0700abbab716@hotmail.com', 'time_sec': '1447026550', 'tz_offset': '480', 'date': {'seconds': '1447026550'}}, 'commit_tree': '7560f87cc13012b7acf7d5d8e5e976d6a0b5c142', 'commit_message': 'Add service to submit a new topic.\n', 'language_name': 'Java', 'license': 'apache-2.0', 'hunks': '@@ -0,0 +1,91 @@\n+package com.lincanbin.carbonforum.service;\r\n+\r\n+import android.app.IntentService;\r\n+import android.content.Context;\r\n+import android.content.Intent;\r\n+\r\n+/**\r\n+ * An {@link IntentService} subclass for handling asynchronous task requests in\r\n+ * a service on a separate handler thread.\r\n+ * <p/>\r\n+ * TODO: Customize class - update intent actions, extra parameters and static\r\n+ * helper methods.\r\n+ */\r\n+public class NewService extends IntentService {\r\n+    // TODO: Rename actions, choose action names that describe tasks that this\r\n+    // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS\r\n+    private static final String ACTION_FOO = "com.lincanbin.carbonforum.service.action.FOO";\r\n+    private static final String ACTION_BAZ = "com.lincanbin.carbonforum.service.action.BAZ";\r\n+\r\n+    // TODO: Rename parameters\r\n+    private static final String EXTRA_PARAM1 = "com.lincanbin.carbonforum.service.extra.PARAM1";\r\n+    private static final String EXTRA_PARAM2 = "com.lincanbin.carbonforum.service.extra.PARAM2";\r\n+\r\n+    /**\r\n+     * Starts this service to perform action Foo with the given parameters. If\r\n+     * the service is already performing a task this action will be queued.\r\n+     *\r\n+     * @see IntentService\r\n+     */\r\n+    // TODO: Customize helper method\r\n+    public static void startActionFoo(Context context, String param1, String param2) {\r\n+        Intent intent = new Intent(context, NewService.class);\r\n+        intent.setAction(ACTION_FOO);\r\n+        intent.putExtra(EXTRA_PARAM1, param1);\r\n+        intent.putExtra(EXTRA_PARAM2, param2);\r\n+        context.startService(intent);\r\n+    }\r\n+\r\n+    /**\r\n+     * Starts this service to perform action Baz with the given parameters. If\r\n+     * the service is already performing a task this action will be queued.\r\n+     *\r\n+     * @see IntentService\r\n+     */\r\n+    // TODO: Customize helper method\r\n+    public static void startActionBaz(Context context, String param1, String param2) {\r\n+        Intent intent = new Intent(context, NewService.class);\r\n+        intent.setAction(ACTION_BAZ);\r\n+        intent.putExtra(EXTRA_PARAM1, param1);\r\n+        intent.putExtra(EXTRA_PARAM2, param2);\r\n+        context.startService(intent);\r\n+    }\r\n+\r\n+    public NewService() {\r\n+        super("NewService");\r\n+    }\r\n+\r\n+    @Override\r\n+    protected void onHandleIntent(Intent intent) {\r\n+        if (intent != null) {\r\n+            final String action = intent.getAction();\r\n+            if (ACTION_FOO.equals(action)) {\r\n+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);\r\n+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);\r\n+                handleActionFoo(param1, param2);\r\n+            } else if (ACTION_BAZ.equals(action)) {\r\n+                final String param1 = intent.getStringExtra(EXTRA_PARAM1);\r\n+                final String param2 = intent.getStringExtra(EXTRA_PARAM2);\r\n+                handleActionBaz(param1, param2);\r\n+            }\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Handle action Foo in the provided background thread with the provided\r\n+     * parameters.\r\n+     */\r\n+    private void handleActionFoo(String param1, String param2) {\r\n+        // TODO: Handle action Foo\r\n+        throw new UnsupportedOperationException("Not yet implemented");\r\n+    }\r\n+\r\n+    /**\r\n+     * Handle action Baz in the provided background thread with the provided\r\n+     * parameters.\r\n+     */\r\n+    private void handleActionBaz(String param1, String param2) {\r\n+        // TODO: Handle action Baz\r\n+        throw new UnsupportedOperationException("Not yet implemented");\r\n+    }\r\n+}\r\n', 'addition_count': 91, 'deletion_count': 0, 'src_file': '/dev/null', 'tgt_file': 'b/app/src/main/java/com/lincanbin/carbonforum/service/NewService.java', 'file_extension': '.java', 'before_file': 'ADDFILE', 'message': 'Add service to submit a new topic.\n', 'author_name': 'lincanbin', 'lang': 'java'}