public class ModDevice extends Object implements Parcelable
An application which needs to work with the ModDevice should use the mManager.getModList(true) method to retrieve the list of attached ModDevice, or get the attached ModDevice from a ModListener or MOD_ATTACH intent.
Modifier and Type | Class and Description |
---|---|
static class |
ModDevice.Interface
An interface descriptor describes an access point for a module to the
UniPro network; the difference between this class and ModDevice.InterfaceInfo is that, an instance of this class means there is an actual interface being created
|
static interface |
ModDevice.InterfaceInfo
The static information of a interface within a Moto Mod. This is statically
declared in the manifest and does not guarantee there will be an instance
of
ModDevice.Interface created at runtime. |
static class |
ModDevice.Subclass
The greybus device sub class corresponding to this ModDevice
|
Parcelable.ClassLoaderCreator, Parcelable.Creator
Modifier and Type | Field and Description |
---|---|
static int |
CAPABILITY_LEVEL_DISABLED
The capability status of the Moto Mod. The capability level will be returned as CAPABILITY_LEVEL_DISABLED when the Moto Mod indicates it disabled its capability.
|
static int |
CAPABILITY_LEVEL_FULL
The capability status of the Moto Mod. The capability level will be returned as CAPABILITY_LEVEL_FULL when the Moto Mod indicates it is fully functional.
|
static int |
CAPABILITY_LEVEL_REDUCED
The capability status of the Moto Mod. The capability level will be returned as CAPABILITY_LEVEL_REDUCED when the Moto Mod indicates it has reduced some of its function. An application shoud
use ModDevice.getCapabilityReason() to determine the reason the Moto Mod reduced its capabilities.
|
static int |
CAPABILITY_REASON_BATTERY
This indicates that the reason for change in the Moto Mod capabilities is due to
a battery on the Moto Mod (for example, the battery low).
|
static int |
CAPABILITY_REASON_CURRENT
This indicates that the reason for change in the Moto Mod capabilities is due to
the current limit on the Moto Mod has reached.
|
static int |
CAPABILITY_REASON_TEMP
This value indicates that the reason for change in the Moto Mod capabilities is due to
the thermal mitigation or a temperature issue.
|
static int |
CAPABILITY_REASON_UNKNOWN
This value indicates that the reason for change in the Moto Mod capabilities is unknown.
|
static int |
CONFIG_OFFSET_DISABLE_FPS_NAV_DISPLAY
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this configuration value means whether the FPS(fingerprint sensor) nav will be
disabled or not when there is an EXTERNAL display is active. |
static int |
CONFIG_OFFSET_DISABLE_FPS_NAV_VIEWFINDER
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this configuration value means whether the FPS(fingerprint sensor) nav will be
disabled or not when the viewfinder is active. |
static int |
CONFIG_OFFSET_DISABLE_NO_FOLLOW_DISPLAY
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this configuration item means whether the EXTERNAL display will be turned off, while
the main display is turned off(i.e., because of power button press on
the phone). |
static int |
CONFIG_OFFSET_DISABLE_REAR_CAMERA
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this configuration value indicates the rear camera should be disabled when the Moto Mod is attached. For example, when the Moto Mod indicates it covers the rear imager. |
static int |
CONFIG_OFFSET_DISABLE_REAR_FLASH
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this configuration value indicates the rear flash should be disabled when the Moto Mod is attached. For example, when the Moto Mod indicates it covers the rear flash. |
static int |
CONFIG_OFFSET_EFFICIENCY_MODE
An offset to the array returned by
ModDevice.getBuiltinConfigs() ,
this cofiguration value indicates whether the attached Moto Mod battery desires to expose a battery efficiency settings to the user. |
static Parcelable.Creator |
CREATOR |
static String |
ENG
The build type of the Moto Mod firmware is "engineering". The Moto
Mod firmware is an unsigned development build.
|
static String |
USER
The build type of the Moto Mod firmware is "user". The Moto
Mod firmware is a signed production build.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
ModDevice(ModDevice other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(Object o) |
byte[] |
getBuiltinConfigs()
Returns an array of built-in configuration that are supported by the
phone. A Moto Mod can a list of preferred configuration value in its hardware manifest.
|
int |
getCapabilityLevel()
Returns the capability level of this Moto Mod. The capability level is either CAPABILITY_LEVEL_FULL,CAPABILITY_LEVEL_REDUCED,CAPABILITY_LEVEL_DISABLED
|
int |
getCapabilityReason()
Returns the reason why the capability of this Moto Mod was last changed, as indicated by the Moto Mod.
|
int |
getCapabilityVendor()
Returns a Moto Mod vendor defined value for a capability change. This value can represent any custom value which a Moto Mod vendor
wants to expose.
|
ArrayList |
getDeclaredInterfaces()
Returns the interfaces declared by this Moto Mod.
|
ArrayList |
getDeclaredProtocols()
Returns the protocols this Moto Mod device supports.
|
String |
getFirmwareType()
Returns the type of the firmware on this Moto Mod, either
ModDevice.USER or
ModDevice.ENG . |
String |
getFirmwareVersion()
Returns the version of the firmware on this Moto Mod.
|
short |
getId()
Returns the numeric identifier of this Moto Mod.
|
List |
getInterfaceList()
Returns the list of active interfaces (equivalent of greybus bundle).
|
String |
getLegalURI()
Returns a string presenting an URL to a legal notice that the Moto Mod device
wants to show to the end user.
|
String |
getMinSdk()
Returns the minimum version of the Moto Mod SDK required by the Moto Mod.
|
String |
getPackage()
Returns the associated Android package of this Moto Mod.
|
int |
getProductId()
Returns the Product ID for the Moto Mod.
|
String |
getProductString()
Returns the Product String, which should correspond to the product name or
the vendor internal's name.
|
UUID |
getUniqueId()
Returns the Unique ID of this Moto Mod.
|
byte[] |
getVendorConfigs()
Returns an array of vendor configs that are supported by the phone, each
element of this array represents a configuration item, the exact meaning of
each config item is defined by the vendor of the Moto Mod.
|
int |
getVendorId()
Returns the Vendor ID for the Moto Mod.
|
String |
getVendorString()
Returns the Vendor String, which corresponds to the Moto Mod
vendor name.
|
boolean |
hasDeclaredProtocol(ModProtocol.Protocol p)
Returns whether a specific protocol has been declared by the Moto Mod
hardware manifest.
|
String |
toString() |
void |
writeToParcel(Parcel out,
int flags) |
public static final String USER
public static final String ENG
public static final int CAPABILITY_LEVEL_FULL
public static final int CAPABILITY_LEVEL_REDUCED
ModDevice.getCapabilityReason()
.public static final int CAPABILITY_LEVEL_DISABLED
ModDevice.getCapabilityReason()
.public static final int CAPABILITY_REASON_UNKNOWN
public static final int CAPABILITY_REASON_TEMP
public static final int CAPABILITY_REASON_BATTERY
public static final int CAPABILITY_REASON_CURRENT
public static final int CONFIG_OFFSET_EFFICIENCY_MODE
ModDevice.getBuiltinConfigs()
,
this one means whether the efficiency mode is supported or not.
If defined as 0, then efficiency mode is supported. If defined as 1 then disable efficiency mode setting for battery.
public static final int CONFIG_OFFSET_DISABLE_NO_FOLLOW_DISPLAY
ModDevice.getBuiltinConfigs()
,
this one means whether the EXTERNAL display will be turned off, while
the main display is turned off(i.e., because of power button press on
the phone).
If defined as 0, then no non-follow, a.k.a when the main display is turned OFF, the EXTERNAL display will be turned OFF too. If 1, then when main display is turned OFF, the EXTERNAL display will remain ON.
public static final Parcelable.Creator CREATOR
public ModDevice(ModDevice other)
public int describeContents()
describeContents
in interface Parcelable
public void writeToParcel(Parcel out, int flags)
writeToParcel
in interface Parcelable
public int getVendorId()
public int getProductId()
public String getVendorString()
public String getProductString()
public UUID getUniqueId()
public ArrayList getDeclaredProtocols()
public boolean hasDeclaredProtocol(ModProtocol.Protocol p)
public ArrayList getDeclaredInterfaces()
public String getFirmwareVersion()
public String getFirmwareType()
ModDevice.USER
or
ModDevice.ENG
.public String getPackage()
public String getMinSdk()
public short getId()
public int getCapabilityLevel()
The returned value will be either
ModDevice.CAPABILITY_LEVEL_FULL
, ModDevice.CAPABILITY_LEVEL_REDUCED
or
ModDevice.CAPABILITY_LEVEL_DISABLED
.
public int getCapabilityReason()
ModDevice.CAPABILITY_REASON_TEMP
, ModDevice.CAPABILITY_REASON_BATTERY
or
ModDevice.CAPABILITY_REASON_CURRENT
.public int getCapabilityVendor()
public byte[] getBuiltinConfigs()
public byte[] getVendorConfigs()
public String getLegalURI()
public List getInterfaceList()
(c) 2016 Motorola Mobility LLC. All Rights Reserved
MOTOROLA and the Stylized M Logo are registered trademarks of Motorola Trademark Holdings, LLC
Android, Google, Google Play, Nexus and other marks are trademarks of Google Inc.