Rename sprint-api to vendor-api-sprintpcs.
[SquirrelJME.git] / modules / vendor-api-sprintpcs / src / main / java / com / sprintpcs / util / System.java
blob50ff61080637482400ccd6cc4a45a1fd7479178a
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // Multi-Phasic Applications: SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package com.sprintpcs.util;
12 import cc.squirreljme.runtime.cldc.annotation.Api;
13 import cc.squirreljme.runtime.cldc.debug.Debugging;
14 import cc.squirreljme.runtime.midlet.CleanupHandler;
16 /**
17 * Spring System Utilities.
19 * @since 2022/08/28
21 @Api
22 public class System
24 /**
25 * Adds a listener for system related events.
27 * @param __listener The listener used.
28 * @throws NullPointerException On null arguments.
29 * @since 2022/08/28
31 @Api
32 public static void addSystemListener(SystemEventListener __listener)
33 throws NullPointerException
35 if (__listener == null)
36 throw new NullPointerException("NARG");
38 // TODO: Currently there are no known events where this would make
39 // TODO: sense, add when they are known...
40 Debugging.todoNote("Add listeners...");
43 @Api
44 public static String[] getPropertiesList()
46 throw Debugging.todo();
49 @Api
50 public static String getProtectedProperty(String __key)
51 throws SecurityException
53 throw Debugging.todo();
56 /**
57 * Returns the state of the given option.
59 * @param __option The option to check.
60 * @return The state of the given option.
61 * @throws NullPointerException On null arguments.
62 * @since 2022/08/28
64 @Api
65 public static String getSystemState(String __option)
66 throws NullPointerException
68 if (__option == null)
69 throw new NullPointerException("NARG");
71 switch (__option)
73 // The form factor of the device, i.e. is the display flipped
74 // open ("OPEN") or is it closed ("CLOSED")?
75 // SquirrelJME currently only ever has the display opened...
76 case "sprint.device.formfactor":
77 return "OPEN";
79 default:
80 throw Debugging.todo(__option);
84 @Api
85 public static void promptMasterVolume()
87 throw Debugging.todo();
90 /**
91 * When the system exits, the specified URL will be activated in the
92 * browser.
94 * @param __uri The URL to execute on exit.
95 * @since 2022/08/28
97 @Api
98 public static void setExitURI(String __uri)
100 if (__uri != null)
101 CleanupHandler.add(new __ExitUri__(__uri));
104 @Api
105 public static void setSystemSetting(String __key, String __value)
106 throws SecurityException, IllegalArgumentException, NullPointerException
108 throw Debugging.todo();