Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
com.managexr.getserialsample.MXRAdminAppMessenger Class Reference

Classes

class  AdminAppMessageTypes
 
interface  BindStatusListener
 
class  IncomingMessageHandler
 
interface  SerialListener
 

Public Member Functions

 MXRAdminAppMessenger (Context _context)
 
boolean getDeviceStatusAsync ()
 
String getSerial ()
 
boolean isBound ()
 
boolean isManaged ()
 
void onBindStatusUpdated (BindStatusListener _listener)
 
void onSerialUpdated (SerialListener _listener)
 
boolean sendMessage (int what)
 
boolean sendMessage (int what, String jsonString)
 
void startBindToAdminServiceLoop ()
 

Protected Member Functions

void bindToAdminServiceLoop ()
 

Private Member Functions

ComponentName getInstalledAdminAdminServiceComponent ()
 
SharedPreferences getSharedPrefs ()
 
void launchAdminAppServiceIfNeeded (String packageName)
 
boolean registerAsClient ()
 
String removeQuotesAndUnescape (String uncleanJson)
 
void tryBindToAdminService ()
 
void unbindFromAdminService ()
 
void updateSerial (@NonNull String serial)
 

Private Attributes

BindStatusListener bindStatusListener
 
boolean bound
 
final int CHECK_BINDING_FREQUENCY = 60 * 1000
 
final Handler checkBindingHandler = new Handler()
 
final Context context
 
final Messenger incomingMessenger = new Messenger(new IncomingMessageHandler())
 
final ServiceConnection mConnection
 
Messenger outgoingMessenger
 
SerialListener serialListener
 

Static Private Attributes

static final String ADMIN_SERVICE_CLASS_NAME = "com.mightyimmersion.mightyplatform.AdminService"
 
static final String TAG = "MXRAdminAppMessenger"
 

Detailed Description

Definition at line 29 of file MXRAdminAppMessenger.java.

Constructor & Destructor Documentation

◆ MXRAdminAppMessenger()

com.managexr.getserialsample.MXRAdminAppMessenger.MXRAdminAppMessenger ( Context _context)
inline

Definition at line 57 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

Member Function Documentation

◆ bindToAdminServiceLoop()

void com.managexr.getserialsample.MXRAdminAppMessenger.bindToAdminServiceLoop ( )
inlineprotected

Definition at line 165 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDeviceStatusAsync()

boolean com.managexr.getserialsample.MXRAdminAppMessenger.getDeviceStatusAsync ( )
inline

Definition at line 219 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

◆ getInstalledAdminAdminServiceComponent()

ComponentName com.managexr.getserialsample.MXRAdminAppMessenger.getInstalledAdminAdminServiceComponent ( )
inlineprivate

Definition at line 251 of file MXRAdminAppMessenger.java.

Here is the caller graph for this function:

◆ getSerial()

String com.managexr.getserialsample.MXRAdminAppMessenger.getSerial ( )
inline

Gets the device's serial number. This may be null if this app has never queried the ManageXR Admin App for the device's serial number in the past. It is recommended to use the async onSerialUpdated method instead.

Returns
serial number of device

Definition at line 100 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSharedPrefs()

SharedPreferences com.managexr.getserialsample.MXRAdminAppMessenger.getSharedPrefs ( )
inlineprivate

Helper function to get a scoped SharedPreferences object.

Definition at line 123 of file MXRAdminAppMessenger.java.

Here is the caller graph for this function:

◆ isBound()

boolean com.managexr.getserialsample.MXRAdminAppMessenger.isBound ( )
inline
Returns
true if this app is bound to the ManageXR Admin App

Definition at line 90 of file MXRAdminAppMessenger.java.

◆ isManaged()

boolean com.managexr.getserialsample.MXRAdminAppMessenger.isManaged ( )
inline
Returns
true if this device is managed by ManageXR

Definition at line 83 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

◆ launchAdminAppServiceIfNeeded()

void com.managexr.getserialsample.MXRAdminAppMessenger.launchAdminAppServiceIfNeeded ( String packageName)
inlineprivate

Definition at line 263 of file MXRAdminAppMessenger.java.

Here is the caller graph for this function:

◆ onBindStatusUpdated()

void com.managexr.getserialsample.MXRAdminAppMessenger.onBindStatusUpdated ( BindStatusListener _listener)
inline

Sets a listener that will be called when the MXRAdminAppMessenger's bind status changes. If the ManageXRMessenger is bound, then this app is able to communicate with the ManageXR Admin App.

Definition at line 67 of file MXRAdminAppMessenger.java.

◆ onSerialUpdated()

void com.managexr.getserialsample.MXRAdminAppMessenger.onSerialUpdated ( SerialListener _listener)
inline

Sets a listener that will be called as soon as the device's serial number is known.

Definition at line 74 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

◆ registerAsClient()

boolean com.managexr.getserialsample.MXRAdminAppMessenger.registerAsClient ( )
inlineprivate

Definition at line 215 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

◆ removeQuotesAndUnescape()

String com.managexr.getserialsample.MXRAdminAppMessenger.removeQuotesAndUnescape ( String uncleanJson)
inlineprivate

Definition at line 151 of file MXRAdminAppMessenger.java.

Here is the caller graph for this function:

◆ sendMessage() [1/2]

boolean com.managexr.getserialsample.MXRAdminAppMessenger.sendMessage ( int what)
inline

Definition at line 223 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendMessage() [2/2]

boolean com.managexr.getserialsample.MXRAdminAppMessenger.sendMessage ( int what,
String jsonString )
inline

Definition at line 227 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:

◆ startBindToAdminServiceLoop()

void com.managexr.getserialsample.MXRAdminAppMessenger.startBindToAdminServiceLoop ( )
inline

Definition at line 161 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tryBindToAdminService()

void com.managexr.getserialsample.MXRAdminAppMessenger.tryBindToAdminService ( )
inlineprivate

Definition at line 170 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unbindFromAdminService()

void com.managexr.getserialsample.MXRAdminAppMessenger.unbindFromAdminService ( )
inlineprivate

Definition at line 187 of file MXRAdminAppMessenger.java.

◆ updateSerial()

void com.managexr.getserialsample.MXRAdminAppMessenger.updateSerial ( @NonNull String serial)
inlineprivate

If the provided serial number is different than what we already have stored locally, then update the serial number saved to disk and send a message to the serialListener.

Definition at line 108 of file MXRAdminAppMessenger.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ADMIN_SERVICE_CLASS_NAME

final String com.managexr.getserialsample.MXRAdminAppMessenger.ADMIN_SERVICE_CLASS_NAME = "com.mightyimmersion.mightyplatform.AdminService"
staticprivate

Definition at line 45 of file MXRAdminAppMessenger.java.

◆ bindStatusListener

BindStatusListener com.managexr.getserialsample.MXRAdminAppMessenger.bindStatusListener
private

Definition at line 51 of file MXRAdminAppMessenger.java.

◆ bound

boolean com.managexr.getserialsample.MXRAdminAppMessenger.bound
private

Definition at line 49 of file MXRAdminAppMessenger.java.

◆ CHECK_BINDING_FREQUENCY

final int com.managexr.getserialsample.MXRAdminAppMessenger.CHECK_BINDING_FREQUENCY = 60 * 1000
private

Definition at line 54 of file MXRAdminAppMessenger.java.

◆ checkBindingHandler

final Handler com.managexr.getserialsample.MXRAdminAppMessenger.checkBindingHandler = new Handler()
private

Definition at line 55 of file MXRAdminAppMessenger.java.

◆ context

final Context com.managexr.getserialsample.MXRAdminAppMessenger.context
private

Definition at line 50 of file MXRAdminAppMessenger.java.

◆ incomingMessenger

final Messenger com.managexr.getserialsample.MXRAdminAppMessenger.incomingMessenger = new Messenger(new IncomingMessageHandler())
private

Definition at line 47 of file MXRAdminAppMessenger.java.

◆ mConnection

final ServiceConnection com.managexr.getserialsample.MXRAdminAppMessenger.mConnection
private
Initial value:
= new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
Log.v(TAG, "onServiceConnected");
outgoingMessenger = new Messenger(service);
bound = true;
boolean registeredAsClient = registerAsClient();
if (registeredAsClient) {
Log.v(TAG, "Registered as client");
} else {
Log.e(TAG, "Failed to register as client. Unbinding...");
}
}
public void onServiceDisconnected(ComponentName className) {
Log.v(TAG, "onServiceDisconnected");
bound = false;
}
}

Definition at line 191 of file MXRAdminAppMessenger.java.

◆ outgoingMessenger

Messenger com.managexr.getserialsample.MXRAdminAppMessenger.outgoingMessenger
private

Definition at line 48 of file MXRAdminAppMessenger.java.

◆ serialListener

SerialListener com.managexr.getserialsample.MXRAdminAppMessenger.serialListener
private

Definition at line 52 of file MXRAdminAppMessenger.java.

◆ TAG

final String com.managexr.getserialsample.MXRAdminAppMessenger.TAG = "MXRAdminAppMessenger"
staticprivate

Definition at line 44 of file MXRAdminAppMessenger.java.


The documentation for this class was generated from the following file: