192973c7820129b724e589268cfcba4600ffb168cWill Drewrypackage com.android.verifiedboot.globalstate.owner;
292973c7820129b724e589268cfcba4600ffb168cWill Drewry
392973c7820129b724e589268cfcba4600ffb168cWill Drewryimport javacard.framework.Shareable;
492973c7820129b724e589268cfcba4600ffb168cWill Drewry
592973c7820129b724e589268cfcba4600ffb168cWill Drewrypublic interface OwnerInterface extends Shareable {
692973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
792973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Stores the calling applet's AID which must implement the NotifyInterface.
892973c7820129b724e589268cfcba4600ffb168cWill Drewry     * When a global data clear is requested, dataChanged() will be called.
992973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
1092973c7820129b724e589268cfcba4600ffb168cWill Drewry     * @param unregister whether to register or unregister for data change.
1192973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
1292973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Returns true if registered and false if not.
1392973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
1492973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean notifyOnDataClear(boolean unregister);
1592973c7820129b724e589268cfcba4600ffb168cWill Drewry
1692973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
1792973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Stores that the calling applet completed onDataClear() call.
1892973c7820129b724e589268cfcba4600ffb168cWill Drewry     * If this is called, the applet will received a onDataClear() will
1992973c7820129b724e589268cfcba4600ffb168cWill Drewry     * be renotified on each isDataCleared() call from any other applet.
2092973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
2192973c7820129b724e589268cfcba4600ffb168cWill Drewry    void reportDataCleared();
2292973c7820129b724e589268cfcba4600ffb168cWill Drewry
2392973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
2492973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Returns true if the caller has pending data to clear.
2592973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
2692973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean dataClearNeeded();
2792973c7820129b724e589268cfcba4600ffb168cWill Drewry
2892973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
2992973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Returns true if there is no pending clients needing to clear.
3092973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
3192973c7820129b724e589268cfcba4600ffb168cWill Drewry     * This is often called by the boot support client to determine
3292973c7820129b724e589268cfcba4600ffb168cWill Drewry     * if a new notify call is needed.
3392973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
3492973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean globalDataClearComplete();
3592973c7820129b724e589268cfcba4600ffb168cWill Drewry
3692973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
3792973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Notifies all applets that a dataClear is underway.
3892973c7820129b724e589268cfcba4600ffb168cWill Drewry     * (The calling applet will also be notified, if registered.)
3992973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
4092973c7820129b724e589268cfcba4600ffb168cWill Drewry     * @param resume indicates renotifying only pending applets.
4192973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
4292973c7820129b724e589268cfcba4600ffb168cWill Drewry    void triggerDataClear(boolean resume);
4392973c7820129b724e589268cfcba4600ffb168cWill Drewry
4492973c7820129b724e589268cfcba4600ffb168cWill Drewry
4592973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
4692973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Returns true if the external signal indicates the bootloader
4792973c7820129b724e589268cfcba4600ffb168cWill Drewry     * is still in control of the application proceesor.
4892973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
4992973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean inBootloader();
5092973c7820129b724e589268cfcba4600ffb168cWill Drewry
5192973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
5292973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Sets the {@link #production} value.
5392973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
5492973c7820129b724e589268cfcba4600ffb168cWill Drewry     * @param val
5592973c7820129b724e589268cfcba4600ffb168cWill Drewry     * @return true if the value could be assigned.
5692973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
5792973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean setProduction(boolean val);
5892973c7820129b724e589268cfcba4600ffb168cWill Drewry
5992973c7820129b724e589268cfcba4600ffb168cWill Drewry    /**
6092973c7820129b724e589268cfcba4600ffb168cWill Drewry     * Returns if the Interface has been transitioned to production mode.
6192973c7820129b724e589268cfcba4600ffb168cWill Drewry     *
6292973c7820129b724e589268cfcba4600ffb168cWill Drewry     * @return true if in production mode and false if in provisioning.
6392973c7820129b724e589268cfcba4600ffb168cWill Drewry     */
6492973c7820129b724e589268cfcba4600ffb168cWill Drewry    boolean production();
6592973c7820129b724e589268cfcba4600ffb168cWill Drewry};
66