The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

android: Annotation, docs, and formatting improvements for MonadoView

+17 -8
+17 -6
src/xrt/auxiliary/android/src/main/java/org/freedesktop/monado/auxiliary/MonadoView.java
··· 19 19 import android.view.View; 20 20 import android.view.WindowManager; 21 21 22 + import androidx.annotation.GuardedBy; 22 23 import androidx.annotation.Keep; 23 24 import androidx.annotation.NonNull; 24 25 import androidx.annotation.Nullable; ··· 31 32 @Keep 32 33 public class MonadoView extends SurfaceView implements SurfaceHolder.Callback, SurfaceHolder.Callback2 { 33 34 private static final String TAG = "MonadoView"; 35 + 34 36 @SuppressWarnings("deprecation") 35 37 private static final int sysUiVisFlags = 0 36 38 // Give us a stable view of content insets ··· 42 44 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 43 45 // we want sticky immersive 44 46 | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; 47 + 48 + @NonNull 45 49 private final Context context; 46 - /// Guards currentSurfaceHolder 47 - private final Object currentSurfaceHolderSync = new Object(); 50 + 48 51 /// The activity we've connected to. 49 52 @Nullable 50 - private final 51 - Activity activity; 53 + private final Activity activity; 54 + 55 + @Nullable 52 56 private final Method viewSetSysUiVis; 57 + 58 + private final Object currentSurfaceHolderSync = new Object(); 59 + 53 60 public int width = -1; 54 61 public int height = -1; 55 62 public int format = -1; 63 + 56 64 private NativeCounterpart nativeCounterpart; 57 - /// Guarded by currentSurfaceHolderSync 65 + 66 + @GuardedBy("currentSurfaceHolderSync") 67 + @Nullable 58 68 private SurfaceHolder currentSurfaceHolder = null; 59 69 60 70 public MonadoView(Context context) { ··· 97 107 /** 98 108 * Construct and start attaching a MonadoView to a client application. 99 109 * 100 - * @param activity The activity to attach to. 110 + * @param activity The activity to attach to. 111 + * @param nativePointer The native android_custom_surface pointer, cast to a long. 101 112 * @return The MonadoView instance created and asynchronously attached. 102 113 */ 103 114 @NonNull
-2
src/xrt/auxiliary/android/src/main/java/org/freedesktop/monado/auxiliary/UiProvider.kt
··· 9 9 package org.freedesktop.monado.auxiliary 10 10 11 11 import android.app.PendingIntent 12 - import android.content.Context 13 - import android.graphics.drawable.Drawable 14 12 import android.graphics.drawable.Icon 15 13 16 14 /**