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

Commit 13b02412 authored by Matthew Williams's avatar Matthew Williams
Browse files

Add test app for JobScheduler

Schedule either a delay/deadline task, or a task with
connectivity constraints
Change-Id: Ie7ea731d0f6673b680cef79f894cb609a61b795d
parent 2f98a26b
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -466,16 +466,14 @@ public class TaskServiceContext extends ITaskCallback.Stub implements ServiceCon
            removeMessages(MSG_TIMEOUT);
            removeMessages(MSG_TIMEOUT);
            mWakeLock.release();
            mWakeLock.release();
            mContext.unbindService(TaskServiceContext.this);
            mContext.unbindService(TaskServiceContext.this);
            mWakeLock = null;
            mCompletedListener.onTaskCompleted(mRunningTask, reschedule);


            mWakeLock = null;
            mRunningTask = null;
            mRunningTask = null;
            mParams = null;
            mParams = null;
            mVerb = -1;
            mVerb = -1;
            mCancelled.set(false);
            mCancelled.set(false);

            service = null;
            service = null;

            mCompletedListener.onTaskCompleted(mRunningTask, reschedule);
            synchronized (mAvailableLock) {
            synchronized (mAvailableLock) {
                mAvailable = true;
                mAvailable = true;
            }
            }
+15 −0
Original line number Original line Diff line number Diff line
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

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

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_PACKAGE_NAME := JobSchedulerTestApp

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)
+31 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.demo.jobSchedulerApp" >

    <uses-sdk
        android:minSdkVersion="18"
        android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.android.demo.jobSchedulerApp.MainActivity"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateHidden" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name=".service.TestJobService"
            android:exported="true"/>
    </application>

</manifest>
+5.34 KiB
Loading image diff...
+3.22 KiB
Loading image diff...
Loading