@@ -241,49 +241,6 @@ public void onDismiss(DialogInterface dialog)
241241 }
242242 }
243243
244- /**
245- * Installs an application package from the specified path.
246- *
247- * @param path The path to the application package (.apk file).
248- * @return true if the installation was successful, false otherwise.
249- */
250- public static boolean installPackage (final String path )
251- {
252- try
253- {
254- boolean retVal = true ;
255-
256- if (Build .VERSION .SDK_INT >= 26 )
257- retVal = mainContext .getPackageManager ().canRequestPackageInstalls ();
258-
259- final File file = new File (path );
260-
261- if (file .exists ())
262- {
263- Intent intent = new Intent (Intent .ACTION_VIEW );
264-
265- if (Build .VERSION .SDK_INT >= 24 )
266- intent .setDataAndType (FileProvider .getUriForFile (mainContext , packageName + ".provider" , file ), "application/vnd.android.package-archive" );
267- else
268- intent .setDataAndType (Uri .fromFile (file ), "application/vnd.android.package-archive" );
269-
270- intent .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
271- intent .addFlags (Intent .FLAG_GRANT_READ_URI_PERMISSION );
272- mainContext .startActivity (intent );
273- }
274- else
275- Log .e (LOG_TAG , "Attempted to install an application package from " + file .getAbsolutePath () + " but the file doesn't exist." );
276-
277- return retVal ;
278- }
279- catch (Exception e )
280- {
281- Log .e (LOG_TAG , e .toString ());
282-
283- return false ;
284- }
285- }
286-
287244 /**
288245 * Enables secure mode for the application window.
289246 */
@@ -430,6 +387,7 @@ public static boolean isDolbyAtmos()
430387 * @param channelName The name of the notification channel.
431388 * @param ID The ID of the notification.
432389 */
390+ @ SuppressWarnings ("deprecation" )
433391 public static void showNotification (final String title , final String message , final String channelID , final String channelName , final int ID )
434392 {
435393 mainActivity .runOnUiThread (new Runnable ()
@@ -466,36 +424,6 @@ public void run()
466424 });
467425 }
468426
469- /**
470- * Retrieves the bounding rectangles for the display cutout (notch) if present.
471- * Each rectangle represents an area of the display that is obstructed by the cutout.
472- *
473- * @return An array of Rect objects representing the bounding rectangles of the display cutout.
474- * Returns an empty array if there is no cutout or if cutouts are not supported on the device.
475- */
476- public static Rect [] getCutoutDimensions ()
477- {
478- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .P )
479- {
480- WindowInsets insets = mainActivity .getWindow ().getDecorView ().getRootWindowInsets ();
481-
482- if (insets != null )
483- {
484- DisplayCutout cutout = insets .getDisplayCutout ();
485-
486- if (cutout != null )
487- {
488- List <Rect > boundingRects = cutout .getBoundingRects ();
489-
490- if (boundingRects != null && !boundingRects .isEmpty ())
491- return boundingRects .toArray (new Rect [0 ]);
492- }
493- }
494- }
495-
496- return new Rect [0 ];
497- }
498-
499427 /**
500428 * Retrieves the application's private files directory.
501429 *
@@ -649,6 +577,7 @@ public static int getStreamVolume(final int streamType)
649577 * @param durationHint The duration of the audio focus request (e.g., AudioManager.AUDIOFOCUS_GAIN).
650578 * @return The result of the audio focus request (e.g., AudioManager.AUDIOFOCUS_REQUEST_GRANTED or AUDIOFOCUS_REQUEST_FAILED).
651579 */
580+ @ SuppressWarnings ("deprecation" )
652581 public static int requestAudioFocus (final HaxeObject haxeCallbackObject , final int streamType , final int durationHint )
653582 {
654583 try
@@ -681,6 +610,7 @@ public void onAudioFocusChange(int focusChange)
681610 * @param haxeCallbackObject The HaxeObject that was used to request audio focus.
682611 * @return The result of the abandon audio focus request (e.g., AudioManager.AUDIOFOCUS_REQUEST_GRANTED or AUDIOFOCUS_REQUEST_FAILED).
683612 */
613+ @ SuppressWarnings ("deprecation" )
684614 public static int abandonAudioFocus (final HaxeObject haxeCallbackObject )
685615 {
686616 try
0 commit comments