package com.abominableshrine.taptounlock;

import android.os.IBinder;

/**
 * Helper class to communicate with the TapPatternDetectorService
 * <p/>
 * This class intends to provide simple interfaces for clients without going through the hassle of
 * Messaging.
 */
public abstract class TapPatternDetectorClient {

    /**
     * Create a new TapPatternDetectorClient to connect to the Service at the other end of the
     * binder
     *
     * @param binder The binder to use for the messaging
     */
    public TapPatternDetectorClient(IBinder binder) {
    }

    /**
     * Callback to be implemented by users when recent taps have been requested
     *
     * @param pattern The pattern that was tapped in the given time frame
     */
    abstract void onRecentTapsResponse(TapPattern pattern);

    /**
     * Callback to be implemented by users when a matching subscription has been found
     *
     * @param pattern The pattern what was matched
     */
    abstract void onPatternMatch(TapPattern pattern);

    /**
     * Request the recent taps detected in the given time span
     * <p/>
     * The time span is given by the nanoseconds from now, the following invocation will create a
     * message to retrieve all taps that happened 5 seconds until 1 nanosecond ago:
     * <p/>
     * <c>client.requestRecentTaps(-5000000000L, -1)</c>
     *
     * @param fromTime Beginning of the time span in nanoseconds from now. Must be less than <c>toTime</c>
     * @param toTime   End of the time span in nanoseconds from now. Must be less than 0
     */
    public void requestRecentTaps(long fromTime, long toTime) {
        throw new UnsupportedOperationException("Not Implemented");
    }

    /**
     * Subscribe to a certain tap pattern
     *
     * @param pattern The pattern to subscribe to. Must not be <c>null</c>
     */
    public void subscribe(TapPattern pattern) {
        throw new UnsupportedOperationException("Not Implemented");
    }

    /**
     * Unsubscribe from a certain tap pattern
     *
     * @param pattern The pattern to unsubscribe from. Must not be <c>null</c>
     */
    public void unsubscribe(TapPattern pattern) {
        throw new UnsupportedOperationException("Not Implemented");
    }
}

@@ -1,8 +1,625 @@
+/*%0A * Copyright 2015 Hannes Bibel, Valentin Sawadski%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     https://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A
 package 
@@ -1546,32 +1546,64 @@
 The 
-pattern what was matched
+subscription that matched, not the actual tapped pattern
 %0A   
@@ -1946,19 +1946,23 @@
 %0A     * 
-%3Cc%3E
+%7B@code 
 client.r
@@ -1995,20 +1995,17 @@
 00L, -1)
-%3C/c%3E
+%7D
 %0A     *%0A
@@ -2100,22 +2100,46 @@
 than
- %3Cc%3E
+%0A     *                 %7B@code 
 toTime
-%3C/c%3E
+%7D
 %0A   
@@ -2494,32 +2494,41 @@
 t be %3Cc%3Enull%3C/c%3E
+ or empty
 %0A     */%0A    pub
@@ -2782,16 +2782,25 @@
 null%3C/c%3E
+ or empty
 %0A     */

Fix ambiguity in the documentation