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

Commit 77b7e113 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Add getter to retrieve interval between requests." into sc-dev am: 6ebcfff7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14522702

Change-Id: I7666362656c06e66f06b34c908404a3e5b5b966c
parents d385ad26 6ebcfff7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -318,7 +318,6 @@ package android {
  public static final class R.attr {
    field public static final int allowClearUserDataOnFailedRestore = 16844288; // 0x1010600
    field public static final int durationBetweenRequestsMillis;
    field public static final int hotwordDetectionService;
    field public static final int isVrOnly = 16844152; // 0x1010578
    field public static final int minExtensionVersion = 16844305; // 0x1010611
@@ -9894,9 +9893,9 @@ package android.service.displayhash {
    method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method public abstract void onGenerateDisplayHash(@NonNull byte[], @NonNull android.hardware.HardwareBuffer, @NonNull android.graphics.Rect, @NonNull String, @NonNull android.view.displayhash.DisplayHashResultCallback);
    method @NonNull public abstract java.util.Map<java.lang.String,android.service.displayhash.DisplayHashParams> onGetDisplayHashAlgorithms();
    method public abstract int onGetIntervalBetweenRequestsMillis();
    method @Nullable public abstract android.view.displayhash.VerifiedDisplayHash onVerifyDisplayHash(@NonNull byte[], @NonNull android.view.displayhash.DisplayHash);
    field public static final String SERVICE_INTERFACE = "android.service.displayhash.DisplayHashingService";
    field public static final String SERVICE_META_DATA = "android.displayhash.display_hashing_service";
  }
}
+25 −9
Original line number Diff line number Diff line
@@ -51,15 +51,9 @@ public abstract class DisplayHashingService extends Service {
    public static final String EXTRA_VERIFIED_DISPLAY_HASH =
            "android.service.displayhash.extra.VERIFIED_DISPLAY_HASH";

    /**
     * Name under which a DisplayHashingService component publishes information
     * about itself.  This meta-data must reference an XML resource containing a
     * {@link com.android.internal.R.styleable#DisplayHashingService} tag.
     *
     * @hide
     */
    @SystemApi
    public static final String SERVICE_META_DATA = "android.displayhash.display_hashing_service";
    /** @hide **/
    public static final String EXTRA_INTERVAL_BETWEEN_REQUESTS =
            "android.service.displayhash.extra.INTERVAL_BETWEEN_REQUESTS";

    /**
     * The {@link Intent} action that must be declared as handled by a service in its manifest
@@ -149,6 +143,21 @@ public abstract class DisplayHashingService extends Service {
        callback.sendResult(data);
    }

    /**
     * Call to get the interval required between display hash requests. Requests made faster than
     * this will be throttled.
     *
     * @return the interval value required between requests.
     */
    public abstract int onGetIntervalBetweenRequestsMillis();

    private void getDurationBetweenRequestsMillis(RemoteCallback callback) {
        int durationBetweenRequestMillis = onGetIntervalBetweenRequestsMillis();
        Bundle data = new Bundle();
        data.putInt(EXTRA_INTERVAL_BETWEEN_REQUESTS, durationBetweenRequestMillis);
        callback.sendResult(data);
    }

    private final class DisplayHashingServiceWrapper extends IDisplayHashingService.Stub {
        @Override
        public void generateDisplayHash(byte[] salt, HardwareBuffer buffer, Rect bounds,
@@ -187,5 +196,12 @@ public abstract class DisplayHashingService extends Service {
            mHandler.sendMessage(obtainMessage(DisplayHashingService::getDisplayHashAlgorithms,
                    DisplayHashingService.this, callback));
        }

        @Override
        public void getIntervalBetweenRequestsMillis(RemoteCallback callback) {
            mHandler.sendMessage(
                    obtainMessage(DisplayHashingService::getDurationBetweenRequestsMillis,
                            DisplayHashingService.this, callback));
        }
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -58,4 +58,13 @@ oneway interface IDisplayHashingService {
     * @param callback The callback invoked to send back the map of algorithms to DisplayHashParams.
     */
    void getDisplayHashAlgorithms(in RemoteCallback callback);

    /**
     * Call to get the interval required between display hash requests. Requests made faster than
     * this will be throttled. The result will be sent in the callback as an int with the key
     * {@link #EXTRA_INTERVAL_BETWEEN_REQUESTS}.
     *
     * @param callback The callback invoked to send back the interval duration.
     */
    void getIntervalBetweenRequestsMillis(in RemoteCallback callback);
}
+0 −7
Original line number Diff line number Diff line
@@ -9568,11 +9568,4 @@
    <attr name="iconfactoryBadgeSize" format="dimension"/>
    <!-- Perceptual luminance of a color, in accessibility friendly color space. From 0 to 100. -->
    <attr name="lStar" format="float"/>
    <declare-styleable name="DisplayHashingService">
        <!-- The interval required between display hash requests. Requests made faster than this
             delay will be throttled."
             @hide @SystemApi -->
        <attr name="durationBetweenRequestsMillis" format="integer" />
    </declare-styleable>
</resources>
+0 −2
Original line number Diff line number Diff line
@@ -3096,8 +3096,6 @@
    <!-- @hide @SystemApi -->
    <public name="playHomeTransitionSound" />
    <public name="lStar" />
    <!-- @hide @SystemApi -->
    <public name="durationBetweenRequestsMillis" />
    <public name="showInInputMethodPicker" />
    <public name="effectColor" />
    <!-- @hide @TestApi -->
Loading