···2626 */
2727 fun buildNotification(context: Context, pendingShutdownIntent: PendingIntent): Notification
28282929- /**
3030- * Return the notification ID to use
3131- */
2929+ /** Return the notification ID to use */
3230 fun getNotificationId(): Int
3331}
···1717 * Intended for use in dependency injection.
1818 */
1919interface NameAndLogoProvider {
2020- /**
2121- * Gets a localized runtime name string for the runtime/Monado-incorporating target.
2222- */
2020+ /** Gets a localized runtime name string for the runtime/Monado-incorporating target. */
2321 fun getLocalizedRuntimeName(): CharSequence
24222523 /**
2626- * Gets a drawable for use in the about activity and elsewhere, for the runtime/Monado-incorporating target.
2424+ * Gets a drawable for use in the about activity and elsewhere, for the
2525+ * runtime/Monado-incorporating target.
2726 */
2827 fun getLogoDrawable(): Drawable?
2928}
···2020 * Object that tracks the native counterpart object for a type. Must be initialized on construction,
2121 * and may have its native code destroyed/discarded, but may not "re-seat" it to new native code
2222 * pointer.
2323- * <p>
2424- * Use as a member of any type with a native counterpart (a native-allocated-and-owned object that
2525- * holds a reference to the owning class). Include the following field and delegating method to use
2626- * (note: assumes you have a tag for logging purposes as TAG)
2323+ *
2424+ * <p>Use as a member of any type with a native counterpart (a native-allocated-and-owned object
2525+ * that holds a reference to the owning class). Include the following field and delegating method to
2626+ * use (note: assumes you have a tag for logging purposes as TAG)
2727+ *
2728 * <p>
2929+ *
2830 * <pre>
2931 * private final NativeCounterpart nativeCounterpart;
3032 *
···3335 * nativeCounterpart.markAsDiscardedByNative(TAG);
3436 * }
3537 * </pre>
3838+ *
3639 * Then, initialize it in your constructor, call {@code markAsUsedByNativeCode()} where desired
3737- * (often in your constructor), and call {@code getNativePointer()} and
3838- * {@code blockUntilNativeDiscard()} as needed.
3939- * <p>
4040- * Your native code can use this to turn a void* into a jlong:
4141- * {@code static_cast<long long>(reinterpret_cast<intptr_t>(nativePointer))}
4040+ * (often in your constructor), and call {@code getNativePointer()} and {@code
4141+ * blockUntilNativeDiscard()} as needed.
4242+ *
4343+ * <p>Your native code can use this to turn a void* into a jlong: {@code static_cast<long
4444+ * long>(reinterpret_cast<intptr_t>(nativePointer))}
4245 */
4346public final class NativeCounterpart {
4444- /**
4545- * Guards the usedByNativeCodeSync.
4646- */
4747+ /** Guards the usedByNativeCodeSync. */
4748 private final Object usedByNativeCodeSync = new Object();
48494950 /**
5051 * Indicates if the containing object is in use by native code.
5151- * <p>
5252- * Guarded by usedByNativeCodeSync.
5252+ *
5353+ * <p>Guarded by usedByNativeCodeSync.
5354 */
5455 private boolean usedByNativeCode = false;
55565656- /**
5757- * Contains the pointer to the native counterpart object.
5858- */
5757+ /** Contains the pointer to the native counterpart object. */
5958 private long nativePointer = 0;
60596160 /**
6261 * Constructor
6362 *
6463 * @param nativePointer The native pointer, cast appropriately. Must be non-zero. Can cast like:
6565- * {@code static_cast<long long>(reinterpret_cast<intptr_t>(nativePointer))}
6464+ * {@code static_cast<long long>(reinterpret_cast<intptr_t>(nativePointer))}
6665 */
6766 public NativeCounterpart(long nativePointer) throws InvalidParameterException {
6867 if (nativePointer == 0) {
···9291 public void markAsDiscardedByNative(String TAG) {
9392 synchronized (usedByNativeCodeSync) {
9493 if (!usedByNativeCode) {
9595- Log.w(TAG,
9696- "This should not have happened: Discarding by native code, but not marked as used!");
9494+ Log.w(
9595+ TAG,
9696+ "This should not have happened: Discarding by native code, but not marked"
9797+ + " as used!");
9798 }
9899 usedByNativeCode = false;
99100 nativePointer = 0;
···130131 }
131132 } catch (InterruptedException e) {
132133 e.printStackTrace();
133133- Log.i(TAG,
134134- "Interrupted while waiting for native code to finish up: " + e);
134134+ Log.i(TAG, "Interrupted while waiting for native code to finish up: " + e);
135135 return false;
136136 }
137137-138137 }
139138}
···2424 */
2525 fun getNotificationIcon(): Icon? = null
26262727- /**
2828- * Make a {@code PendingIntent} to launch an "About" activity for the runtime/target.
2929- */
2727+ /** Make a {@code PendingIntent} to launch an "About" activity for the runtime/target. */
3028 fun makeAboutActivityPendingIntent(): PendingIntent
31293230 /**
3331 * Make a {@code PendingIntent} to launch a configuration activity, if provided by the target.
3432 */
3533 fun makeConfigureActivityPendingIntent(): PendingIntent? = null
3636-3734}