com.jcdecaux.jcdroid.fwk.api.settings
Class InternalSettingsManager

java.lang.Object
  extended by com.jcdecaux.jcdroid.fwk.api.settings.InternalSettingsManager

public class InternalSettingsManager
extends java.lang.Object

Class that operates with InternalSettings. To obtain an instance of InternalSettingsManager, call Context.getSystemService(java.lang.String) with JCDroidService.INTERNAL_SETTINGS_SERVICE as argument. All setters or actions requires the caller to hold the permission Manifest.permission#MODIFY.


Field Summary
static java.lang.String QUALIFICATION_MAC_ADDRESS
          Since API 12
 
Constructor Summary
InternalSettingsManager(android.content.Context context, com.jcdecaux.jcdroid.fwk.api.settings.IInternalSettingsService service)
           
 
Method Summary
 JCDroidEnvironment getAppEnvironment()
          Returns the current device running environment
 java.util.List<java.lang.String> getCleanSDCardFiles()
           
 java.util.List<java.lang.String> getCleanWhitelist()
           
 java.lang.String getConfigEndpoint()
          Deprecated.  
 ConnectivityMode getConnectivityMode()
           
 java.lang.String getContractCode()
          Returns the contract code (as it's declared in its contract from MCP data)
 java.lang.String getCountryCode()
          Returns the devices country code (as it's declared in its contract from MCP data)
 int getCurrentOrientation()
          Retrieves current screen orientation according to InternalSettingsObserver values.
 int getCurrentRotation()
          Retrieves the current screens rotation (from its natural axis) according to InternalSettingsObserver values.
 java.lang.String getDateFormat()
           
 java.util.Locale getDefaultLocale()
          Returns the default locale for this device
 java.lang.String getDeviceID()
          Returns the device identifier.
 java.lang.String getDeviceName()
          Returns the device name.
 java.lang.String getDeviceType()
          Returns the device type (as it's declared in MCP)
 java.lang.String getDiagPackage()
           
 long getForceKillTimeout()
           
 int getGoogleMapsPackageVersion()
          Gets GoogleMapsPackageVersion
 java.lang.String getHomePackage()
           
 java.lang.String getHoursFormat()
           
 java.lang.String getIdentityEndpoint()
          Deprecated.  
 java.lang.String getImePackageForLocale(java.util.Locale locale)
          Returns IME package for given locale.
 long getLastUserActivity()
          Get elapsed time (in ms) since user last touched the screen.
 double getLatitude()
           
 java.util.List<java.lang.String> getLocalProxyBlackList()
          Deprecated.  
 int getLocalProxyPort()
          Deprecated.  
 java.util.List<java.lang.String> getLocalProxyWhiteList()
          Deprecated.  
 double getLongitude()
           
 java.lang.String getNameEndpoint()
          Deprecated.  
 int getOsSoundVoiceCallVolumeDefaultLevel()
          Gets desired voicecall volume level in percentage.
 java.lang.String getOtaUpdateEndpoint()
           
 JCDroidEnvironment getPlatformEnvironment()
           
 java.lang.String getProvisioningEndpoint()
          Since API 10
 java.lang.String getProxyHost()
           
 int getProxyPort()
           
 java.lang.String getProxyScheme()
           
 java.lang.String getQualificationSystemApplicationsEndpoint()
          Deprecated.  
 java.lang.String getQualificationUserApplicationsEndpoint()
          Deprecated.  
 java.lang.String getQualifMacAddress()
          Since API 12
 double getScaleFactor()
           
 int getScreenOffTimeout()
           
 java.lang.String getScreensaverPackage()
          Since SdkVersion.API14
 int getScreensaverTimeout()
          Since SdkVersion.API14
 java.lang.String getServiceMqttHost()
           
 java.lang.String getServiceMqttPassword()
           
 int getServiceMqttPort()
           
 java.lang.String getServiceMqttUsername()
           
 java.lang.String getServiceSipHost()
           
 int getServiceSipPort()
           
 java.lang.String getServiceSipScheme()
           
 java.lang.String getServiceSyslogHost()
           
 int getSessionOffTimeout()
           
 java.lang.String getSystemApplicationsEndpoint()
          Deprecated.  
 java.util.TimeZone getTimezone()
           
 java.lang.String getUserApplicationsEndpoint()
          Deprecated.  
 int getWidgetBarHeight()
          Since SdkVersion.API14
 java.lang.String getWidgetBarPackage()
          Since SdkVersion.API14
 boolean hasProxy()
           
 boolean isAccessibilityButtonEnabled()
           
 boolean isBarcodeReaderAutoStartEnabled()
           
 boolean isCleanSDCardDisabled()
           
 boolean isConnectivityModeConfigured()
           
 boolean isDebugCoreAppsEnabled()
          Returns configuration flag to activate debug in core apps.
 boolean isDebugJCDroidEnabled()
           
 boolean isDeviceProvisioned()
          Get device is provisioned.
 boolean isInfraSyncDone()
          Gets infrastructure synchronization status.
 boolean isInMaintenanceMode()
           
 boolean isLocalProxyActive()
          Deprecated.  
 boolean isMaintenanceOnNetworkTimeout()
           
 boolean isMCPInfraProvider()
           
 boolean isNavigationBarEnabled()
           
 boolean isNavigationBarHidden()
           
 boolean isNetworkMode()
           
 boolean isQualificationMode()
           
 boolean isScreenInvertVertical()
          Returns if the screen vertically inverted.
 boolean isScreenLandscape()
          Returns if the screen is in landscape.
 boolean isScreensaverDisabled()
          Since SdkVersion.API14 Returns true if the session timeout <= 0
 boolean isSessionTimeoutDisabled()
          Returns true if the session timeout <= 0
 boolean isSystemConfigured()
           
 boolean isUSBMode()
           
 boolean isWidgetBarEnabled()
          Since SdkVersion.API14
 boolean isWipeOnRebootConfigured()
           
 boolean removeConnectivityMode()
          Permission Manifest.permission#MODIFY is needed.
 boolean removeWipeOnReboot()
          Permission Manifest.permission#MODIFY is needed.
 boolean setConnectivityMode(ConnectivityMode mode)
          Permission Manifest.permission#MODIFY is needed.
 boolean setConnectivityQualifMode(java.lang.String macAddress)
          Since API 12
 void setDefaultImePackage(java.lang.String imePackage)
          Updates default ime package.
 void setDefaultImePackageForLocale(java.util.Locale locale)
          Helper method to set the default IME package for the given locale Since SdkVersion.API13
 void setDeviceProvisioned(boolean isProvisioned)
          Set the device provisioned.
 void setInfraSyncDone(boolean isSyncDone)
          Sets infrastructure synchronization status.
 void setLastUserActivity(long lastUserActivity)
           
 void setMaintenanceMode(boolean active)
          Permission Manifest.permission#MODIFY is needed.
 void setMCPInfraProvider(boolean isMCPProvider)
          Changes the infrastructure provider (mcp or kali).
 void setPlatformEnvironment(JCDroidEnvironment env)
           
 boolean setSystemStateBcd(int hexValue)
          Updates BCD display with hexValue.
 boolean setWipeOnReboot(ConnectivityMode connectivityMode)
          Permission Manifest.permission#MODIFY is needed.
 boolean showTouches()
           
 boolean useMockedLocationProviders()
           
 void wipe()
          Wipes internalsettings values and cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUALIFICATION_MAC_ADDRESS

public static final java.lang.String QUALIFICATION_MAC_ADDRESS
Since API 12

See Also:
Constant Field Values
Constructor Detail

InternalSettingsManager

public InternalSettingsManager(android.content.Context context,
                               com.jcdecaux.jcdroid.fwk.api.settings.IInternalSettingsService service)
Method Detail

isMCPInfraProvider

public boolean isMCPInfraProvider()

setMCPInfraProvider

public void setMCPInfraProvider(boolean isMCPProvider)
Changes the infrastructure provider (mcp or kali). If true, mcp will be chosen. Calling this method will trigger a reboot to make sure new values are correctly loaded. Permission Manifest.permission#MODIFY is needed.

Parameters:
isMCPProvider -

isDeviceProvisioned

public boolean isDeviceProvisioned()
Get device is provisioned. It its considered to be provisioned when a mui configuration has been selected.

Returns:
true if the device is provisioned.

setDeviceProvisioned

public void setDeviceProvisioned(boolean isProvisioned)
Set the device provisioned. Should be set only when a mui config has been selected. Permission Manifest.permission#MODIFY is needed.

Parameters:
isProvisioned -

isInfraSyncDone

public boolean isInfraSyncDone()
Gets infrastructure synchronization status. Is true if the the infrastructure provider (mcp) have been reached at least once and all configuration files have been successfully downloaded.

Returns:
true if the infrastructure has been sync'ed at least once.

setInfraSyncDone

public void setInfraSyncDone(boolean isSyncDone)
Sets infrastructure synchronization status. Should be true if the infrastructure has been reached and all configuration files have been downloaded. Permission Manifest.permission#MODIFY is needed.

Parameters:
isSyncDone -

wipe

public void wipe()
Wipes internalsettings values and cache. Permission Manifest.permission#MODIFY is needed.


getDefaultLocale

public java.util.Locale getDefaultLocale()
Returns the default locale for this device

Returns:
The default locale

getImePackageForLocale

public java.lang.String getImePackageForLocale(java.util.Locale locale)
Returns IME package for given locale. This value can be used to modified default_input_method in secure settings. Since SdkVersion.API13

Parameters:
locale -
Returns:
ImePackage

setDefaultImePackage

public void setDefaultImePackage(java.lang.String imePackage)
Updates default ime package. Since SdkVersion.API13

Parameters:
imePackage - (e.g. com.android.inputmethod.latin/.LatinIME)

setDefaultImePackageForLocale

public void setDefaultImePackageForLocale(java.util.Locale locale)
Helper method to set the default IME package for the given locale Since SdkVersion.API13


getDeviceName

public java.lang.String getDeviceName()
Returns the device name.

Returns:
The device human readable name.

getCurrentOrientation

public int getCurrentOrientation()
Retrieves current screen orientation according to InternalSettingsObserver values.

Returns:
the current screen orientation. Value is a type of ActivityInfo.SCREEN_ORIENTATION_PORTRAIT).

getCurrentRotation

public int getCurrentRotation()
Retrieves the current screens rotation (from its natural axis) according to InternalSettingsObserver values.

Returns:
the current screens rotation. Value is a type of Surface.ROTATION_0).

getPlatformEnvironment

public JCDroidEnvironment getPlatformEnvironment()

setPlatformEnvironment

public void setPlatformEnvironment(JCDroidEnvironment env)

getAppEnvironment

public JCDroidEnvironment getAppEnvironment()
Returns the current device running environment

Returns:
The device running environment

getConnectivityMode

public ConnectivityMode getConnectivityMode()

setConnectivityMode

public boolean setConnectivityMode(ConnectivityMode mode)
Permission Manifest.permission#MODIFY is needed.

Parameters:
mode -
Returns:

setConnectivityQualifMode

public boolean setConnectivityQualifMode(java.lang.String macAddress)
Since API 12

Parameters:
macAddress -
Returns:

getQualifMacAddress

public java.lang.String getQualifMacAddress()
Since API 12


isConnectivityModeConfigured

public boolean isConnectivityModeConfigured()

removeConnectivityMode

public boolean removeConnectivityMode()
Permission Manifest.permission#MODIFY is needed.

Returns:

setWipeOnReboot

public boolean setWipeOnReboot(ConnectivityMode connectivityMode)
Permission Manifest.permission#MODIFY is needed.

Parameters:
connectivityMode -
Returns:

isWipeOnRebootConfigured

public boolean isWipeOnRebootConfigured()

isSystemConfigured

public boolean isSystemConfigured()

removeWipeOnReboot

public boolean removeWipeOnReboot()
Permission Manifest.permission#MODIFY is needed.

Returns:

isInMaintenanceMode

public boolean isInMaintenanceMode()

setMaintenanceMode

public void setMaintenanceMode(boolean active)
Permission Manifest.permission#MODIFY is needed.

Parameters:
active -

getLastUserActivity

public long getLastUserActivity()
Get elapsed time (in ms) since user last touched the screen.

Returns:

setLastUserActivity

public void setLastUserActivity(long lastUserActivity)
Parameters:
lastUserActivity -

setSystemStateBcd

public boolean setSystemStateBcd(int hexValue)
Updates BCD display with hexValue. Permission Manifest.permission#BCD_DISPLAY is needed.

Parameters:
hexValue - : value to display in hex format. To display the value 42 => 0x42.
Returns:
true if bcd update succeeded.

isUSBMode

public boolean isUSBMode()

isNetworkMode

public boolean isNetworkMode()

isQualificationMode

public boolean isQualificationMode()

getDiagPackage

public java.lang.String getDiagPackage()

getHomePackage

public java.lang.String getHomePackage()

isDebugCoreAppsEnabled

public boolean isDebugCoreAppsEnabled()
Returns configuration flag to activate debug in core apps.

Returns:
debug flag for core apps

isDebugJCDroidEnabled

public boolean isDebugJCDroidEnabled()

isMaintenanceOnNetworkTimeout

public boolean isMaintenanceOnNetworkTimeout()

isNavigationBarEnabled

public boolean isNavigationBarEnabled()

isAccessibilityButtonEnabled

public boolean isAccessibilityButtonEnabled()

isWidgetBarEnabled

public boolean isWidgetBarEnabled()
Since SdkVersion.API14


getWidgetBarPackage

public java.lang.String getWidgetBarPackage()
Since SdkVersion.API14


getWidgetBarHeight

public int getWidgetBarHeight()
Since SdkVersion.API14


showTouches

public boolean showTouches()

getTimezone

public java.util.TimeZone getTimezone()

getHoursFormat

public java.lang.String getHoursFormat()

getDateFormat

public java.lang.String getDateFormat()

getScreenOffTimeout

public int getScreenOffTimeout()

getScreensaverPackage

public java.lang.String getScreensaverPackage()
Since SdkVersion.API14


getScreensaverTimeout

public int getScreensaverTimeout()
Since SdkVersion.API14


isScreensaverDisabled

public boolean isScreensaverDisabled()
Since SdkVersion.API14 Returns true if the session timeout <= 0


getSessionOffTimeout

public int getSessionOffTimeout()

isSessionTimeoutDisabled

public boolean isSessionTimeoutDisabled()
Returns true if the session timeout <= 0


isScreenLandscape

public boolean isScreenLandscape()
Returns if the screen is in landscape.

Returns:
true if the screen is in landscape.

getForceKillTimeout

public long getForceKillTimeout()

getCleanWhitelist

public java.util.List<java.lang.String> getCleanWhitelist()

isCleanSDCardDisabled

public boolean isCleanSDCardDisabled()

getCleanSDCardFiles

public java.util.List<java.lang.String> getCleanSDCardFiles()

useMockedLocationProviders

public boolean useMockedLocationProviders()

getDeviceID

public java.lang.String getDeviceID()
Returns the device identifier.

Returns:
The device identifier.

getCountryCode

public java.lang.String getCountryCode()
Returns the devices country code (as it's declared in its contract from MCP data)

Returns:
the country code (e.g. FR, US)

getContractCode

public java.lang.String getContractCode()
Returns the contract code (as it's declared in its contract from MCP data)

Returns:
the contract code (e.g. PLA, BAR)

getDeviceType

public java.lang.String getDeviceType()
Returns the device type (as it's declared in MCP)

Returns:
the device type (e.g. MUI, PLA)

getLatitude

public double getLatitude()

getLongitude

public double getLongitude()

getProxyScheme

public java.lang.String getProxyScheme()

getProxyHost

public java.lang.String getProxyHost()

getProxyPort

public int getProxyPort()

isLocalProxyActive

public boolean isLocalProxyActive()
Deprecated. 


getLocalProxyPort

public int getLocalProxyPort()
Deprecated. 


getLocalProxyWhiteList

public java.util.List<java.lang.String> getLocalProxyWhiteList()
Deprecated. 


getLocalProxyBlackList

public java.util.List<java.lang.String> getLocalProxyBlackList()
Deprecated. 


getOtaUpdateEndpoint

public java.lang.String getOtaUpdateEndpoint()

getProvisioningEndpoint

public java.lang.String getProvisioningEndpoint()
Since API 10


getNameEndpoint

public java.lang.String getNameEndpoint()
Deprecated. 


getConfigEndpoint

public java.lang.String getConfigEndpoint()
Deprecated. 


getIdentityEndpoint

public java.lang.String getIdentityEndpoint()
Deprecated. 


hasProxy

public boolean hasProxy()

isScreenInvertVertical

public boolean isScreenInvertVertical()
Returns if the screen vertically inverted.

Returns:
true if vertically inverted.

getServiceSipScheme

public java.lang.String getServiceSipScheme()

getServiceSipHost

public java.lang.String getServiceSipHost()

getServiceSipPort

public int getServiceSipPort()

getServiceSyslogHost

public java.lang.String getServiceSyslogHost()

isBarcodeReaderAutoStartEnabled

public boolean isBarcodeReaderAutoStartEnabled()

getOsSoundVoiceCallVolumeDefaultLevel

public int getOsSoundVoiceCallVolumeDefaultLevel()
Gets desired voicecall volume level in percentage.

Returns:
an int between 0 and 100. The caller has to calculate the real value base on stream max level.

getGoogleMapsPackageVersion

public int getGoogleMapsPackageVersion()
Gets GoogleMapsPackageVersion

Returns:
the package version to be verified against

getScaleFactor

public double getScaleFactor()

isNavigationBarHidden

public boolean isNavigationBarHidden()

getServiceMqttHost

public java.lang.String getServiceMqttHost()

getServiceMqttPort

public int getServiceMqttPort()

getServiceMqttUsername

public java.lang.String getServiceMqttUsername()

getServiceMqttPassword

public java.lang.String getServiceMqttPassword()

getQualificationUserApplicationsEndpoint

public java.lang.String getQualificationUserApplicationsEndpoint()
Deprecated. 


getQualificationSystemApplicationsEndpoint

public java.lang.String getQualificationSystemApplicationsEndpoint()
Deprecated. 


getUserApplicationsEndpoint

public java.lang.String getUserApplicationsEndpoint()
Deprecated. 


getSystemApplicationsEndpoint

public java.lang.String getSystemApplicationsEndpoint()
Deprecated.