diff options
52 files changed, 2972 insertions, 2057 deletions
@@ -194,7 +194,8 @@ LOCAL_SRC_FILES += \ vpn/java/android/net/vpn/IVpnService.aidl \ voip/java/android/net/sip/ISipSession.aidl \ voip/java/android/net/sip/ISipSessionListener.aidl \ - voip/java/android/net/sip/ISipService.aidl + voip/java/android/net/sip/ISipService.aidl \ + core/java/com/authentec/TrueSuiteMobile/RelayReceiverService.aidl # diff --git a/api/current.xml b/api/current.xml index d6f2e87..e10b357 100644 --- a/api/current.xml +++ b/api/current.xml @@ -727,17 +727,6 @@ visibility="public" > </field> -<field name="PREVENT_POWER_KEY" - type="java.lang.String" - transient="false" - volatile="false" - value=""android.permission.PREVENT_POWER_KEY"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="PROCESS_OUTGOING_CALLS" type="java.lang.String" transient="false" @@ -19609,18 +19598,6 @@ <parameter name="context" type="android.content.Context"> </parameter> </constructor> -<constructor name="AlertDialog.Builder" - type="android.app.AlertDialog.Builder" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="context" type="android.content.Context"> -</parameter> -<parameter name="theme" type="int"> -</parameter> -</constructor> <method name="create" return="android.app.AlertDialog" abstract="false" @@ -24755,315 +24732,6 @@ </parameter> </method> </interface> -<class name="Profile" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<implements name="android.os.Parcelable"> -</implements> -<method name="describeContents" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getDefaultGroup" - return="android.app.ProfileGroup" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getName" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getProfileGroup" - return="android.app.ProfileGroup" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="name" type="java.lang.String"> -</parameter> -</method> -<method name="getProfileGroups" - return="android.app.ProfileGroup[]" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="writeToParcel" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="dest" type="android.os.Parcel"> -</parameter> -<parameter name="flags" type="int"> -</parameter> -</method> -</class> -<class name="ProfileGroup" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<implements name="android.os.Parcelable"> -</implements> -<method name="describeContents" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getLightsMode" - return="android.app.ProfileGroup.Mode" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getName" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getRingerMode" - return="android.app.ProfileGroup.Mode" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getRingerOverride" - return="android.net.Uri" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getSoundMode" - return="android.app.ProfileGroup.Mode" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getSoundOverride" - return="android.net.Uri" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getVibrateMode" - return="android.app.ProfileGroup.Mode" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="isDefaultGroup" - return="boolean" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="writeToParcel" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="dest" type="android.os.Parcel"> -</parameter> -<parameter name="flags" type="int"> -</parameter> -</method> -</class> -<class name="ProfileGroup.Mode" - extends="java.lang.Enum" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<method name="valueOf" - return="android.app.ProfileGroup.Mode" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="name" type="java.lang.String"> -</parameter> -</method> -<method name="values" - return="android.app.ProfileGroup.Mode[]" - abstract="false" - native="false" - synchronized="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</method> -</class> -<class name="ProfileManager" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<method name="getActiveProfile" - return="android.app.Profile" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getProfile" - return="android.app.Profile" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="profileName" type="java.lang.String"> -</parameter> -</method> -<method name="getProfileNames" - return="java.lang.String[]" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getProfiles" - return="android.app.Profile[]" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="setActiveProfile" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="profileName" type="java.lang.String"> -</parameter> -</method> -</class> <class name="ProgressDialog" extends="android.app.AlertDialog" abstract="false" @@ -30473,50 +30141,6 @@ visibility="public" > </field> -<field name="PERIPHERAL_COMBO_KEYBORD_POINTING" - type="int" - transient="false" - volatile="false" - value="1472" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="PERIPHERAL_KEYBORD" - type="int" - transient="false" - volatile="false" - value="1344" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="PERIPHERAL_POINTING_DEVICE" - type="int" - transient="false" - volatile="false" - value="1408" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="PERIPHERAL_UNCATEGORIZED" - type="int" - transient="false" - volatile="false" - value="1280" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="PHONE_CELLULAR" type="int" transient="false" @@ -36114,17 +35738,6 @@ visibility="public" > </field> -<field name="PROFILE_SERVICE" - type="java.lang.String" - transient="false" - volatile="false" - value=""profile"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="SEARCH_SERVICE" type="java.lang.String" transient="false" @@ -61567,7 +61180,7 @@ <method name="drawText" return="void" abstract="false" - native="false" + native="true" synchronized="false" static="false" final="false" @@ -74062,47 +73675,6 @@ > </field> </class> -<class name="Camera.Coordinate" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<constructor name="Camera.Coordinate" - type="android.hardware.Camera.Coordinate" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="x" type="int"> -</parameter> -<parameter name="y" type="int"> -</parameter> -</constructor> -<field name="xCoordinate" - type="int" - transient="false" - volatile="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="yCoordinate" - type="int" - transient="false" - volatile="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> <interface name="Camera.ErrorCallback" abstract="true" static="true" @@ -74194,28 +73766,6 @@ visibility="public" > </method> -<method name="getAutoExposure" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getBrightness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getColorEffect" return="java.lang.String" abstract="false" @@ -74227,72 +73777,6 @@ visibility="public" > </method> -<method name="getContinuousAf" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getContrast" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getDefaultBrightness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getDefaultContrast" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getDefaultSaturation" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getDefaultSharpness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getExposureCompensation" return="int" abstract="false" @@ -74372,17 +73856,6 @@ visibility="public" > </method> -<method name="getISOValue" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getInt" return="int" abstract="false" @@ -74429,39 +73902,6 @@ visibility="public" > </method> -<method name="getLensShade" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getMaxBrightness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getMaxContrast" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getMaxExposureCompensation" return="int" abstract="false" @@ -74473,28 +73913,6 @@ visibility="public" > </method> -<method name="getMaxSaturation" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getMaxSharpness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getMaxZoom" return="int" abstract="false" @@ -74574,17 +73992,6 @@ visibility="public" > </method> -<method name="getPreviewFrameRateMode" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getPreviewSize" return="android.hardware.Camera.Size" abstract="false" @@ -74596,17 +74003,6 @@ visibility="public" > </method> -<method name="getSaturation" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSceneMode" return="java.lang.String" abstract="false" @@ -74618,17 +74014,6 @@ visibility="public" > </method> -<method name="getSharpness" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedAntibanding" return="java.util.List<java.lang.String>" abstract="false" @@ -74640,17 +74025,6 @@ visibility="public" > </method> -<method name="getSupportedAutoexposure" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedColorEffects" return="java.util.List<java.lang.String>" abstract="false" @@ -74662,17 +74036,6 @@ visibility="public" > </method> -<method name="getSupportedContinuousAfModes" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedFlashModes" return="java.util.List<java.lang.String>" abstract="false" @@ -74695,17 +74058,6 @@ visibility="public" > </method> -<method name="getSupportedIsoValues" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedJpegThumbnailSizes" return="java.util.List<android.hardware.Camera.Size>" abstract="false" @@ -74717,17 +74069,6 @@ visibility="public" > </method> -<method name="getSupportedLensShadeModes" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedPictureFormats" return="java.util.List<java.lang.Integer>" abstract="false" @@ -74772,17 +74113,6 @@ visibility="public" > </method> -<method name="getSupportedPreviewFrameRateModes" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedPreviewFrameRates" return="java.util.List<java.lang.Integer>" abstract="false" @@ -74816,17 +74146,6 @@ visibility="public" > </method> -<method name="getSupportedTouchAfAec" - return="java.util.List<java.lang.String>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getSupportedWhiteBalance" return="java.util.List<java.lang.String>" abstract="false" @@ -74838,39 +74157,6 @@ visibility="public" > </method> -<method name="getTouchAfAec" - return="java.lang.String" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getTouchIndexAec" - return="android.hardware.Camera.Coordinate" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getTouchIndexAf" - return="android.hardware.Camera.Coordinate" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getVerticalViewAngle" return="float" abstract="false" @@ -74915,17 +74201,6 @@ visibility="public" > </method> -<method name="isSmartContrastEnabled" - return="boolean" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="isSmoothZoomSupported" return="boolean" abstract="false" @@ -75015,32 +74290,6 @@ <parameter name="antibanding" type="java.lang.String"> </parameter> </method> -<method name="setAutoExposure" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="value" type="java.lang.String"> -</parameter> -</method> -<method name="setBrightness" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="brightness" type="int"> -</parameter> -</method> <method name="setColorEffect" return="void" abstract="false" @@ -75054,32 +74303,6 @@ <parameter name="value" type="java.lang.String"> </parameter> </method> -<method name="setContinuousAf" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="value" type="java.lang.String"> -</parameter> -</method> -<method name="setContrast" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="contrast" type="int"> -</parameter> -</method> <method name="setExposureCompensation" return="void" abstract="false" @@ -75184,19 +74407,6 @@ <parameter name="timestamp" type="long"> </parameter> </method> -<method name="setISOValue" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="iso" type="java.lang.String"> -</parameter> -</method> <method name="setJpegQuality" return="void" abstract="false" @@ -75238,19 +74448,6 @@ <parameter name="height" type="int"> </parameter> </method> -<method name="setLensShade" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="lensshade" type="java.lang.String"> -</parameter> -</method> <method name="setPictureFormat" return="void" abstract="false" @@ -75320,19 +74517,6 @@ <parameter name="fps" type="int"> </parameter> </method> -<method name="setPreviewFrameRateMode" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="value" type="java.lang.String"> -</parameter> -</method> <method name="setPreviewSize" return="void" abstract="false" @@ -75361,19 +74545,6 @@ <parameter name="rotation" type="int"> </parameter> </method> -<method name="setSaturation" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="saturation" type="int"> -</parameter> -</method> <method name="setSceneMode" return="void" abstract="false" @@ -75387,75 +74558,6 @@ <parameter name="value" type="java.lang.String"> </parameter> </method> -<method name="setSharpness" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="sharpness" type="int"> -</parameter> -</method> -<method name="setSmartContrastEnabled" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="enabled" type="boolean"> -</parameter> -</method> -<method name="setTouchAfAec" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="value" type="java.lang.String"> -</parameter> -</method> -<method name="setTouchIndexAec" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="x" type="int"> -</parameter> -<parameter name="y" type="int"> -</parameter> -</method> -<method name="setTouchIndexAf" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="x" type="int"> -</parameter> -<parameter name="y" type="int"> -</parameter> -</method> <method name="setWhiteBalance" return="void" abstract="false" @@ -75539,61 +74641,6 @@ visibility="public" > </field> -<field name="AUTO_EXPOSURE_CENTER_WEIGHTED" - type="java.lang.String" - transient="false" - volatile="false" - value=""meter-center"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="AUTO_EXPOSURE_FRAME_AVG" - type="java.lang.String" - transient="false" - volatile="false" - value=""meter-average"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="AUTO_EXPOSURE_SPOT_METERING" - type="java.lang.String" - transient="false" - volatile="false" - value=""meter-spot"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CAF_OFF" - type="java.lang.String" - transient="false" - volatile="false" - value=""caf-off"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CAF_ON" - type="java.lang.String" - transient="false" - volatile="false" - value=""caf-on"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="EFFECT_AQUA" type="java.lang.String" transient="false" @@ -75847,105 +74894,6 @@ visibility="public" > </field> -<field name="ISO_100" - type="java.lang.String" - transient="false" - volatile="false" - value=""100"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_1250" - type="java.lang.String" - transient="false" - volatile="false" - value=""1250"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_200" - type="java.lang.String" - transient="false" - volatile="false" - value=""200"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_400" - type="java.lang.String" - transient="false" - volatile="false" - value=""400"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_800" - type="java.lang.String" - transient="false" - volatile="false" - value=""800"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_AUTO" - type="java.lang.String" - transient="false" - volatile="false" - value=""auto"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ISO_HJR" - type="java.lang.String" - transient="false" - volatile="false" - value=""deblur"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="LENSSHADE_DISABLE" - type="java.lang.String" - transient="false" - volatile="false" - value=""disable"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="LENSSHADE_ENABLE" - type="java.lang.String" - transient="false" - volatile="false" - value=""enable"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="PREVIEW_FPS_MAX_INDEX" type="int" transient="false" @@ -76144,28 +75092,6 @@ visibility="public" > </field> -<field name="TOUCH_AF_AEC_OFF" - type="java.lang.String" - transient="false" - volatile="false" - value=""touch-off"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="TOUCH_AF_AEC_ON" - type="java.lang.String" - transient="false" - volatile="false" - value=""touch-on"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="WHITE_BALANCE_AUTO" type="java.lang.String" transient="false" @@ -77381,7 +76307,7 @@ type="float" transient="false" volatile="false" - value="0.001f" + value="0.0010f" static="true" final="true" deprecated="not deprecated" @@ -86037,17 +84963,6 @@ <parameter name="quality" type="int"> </parameter> </method> -<field name="QUALITY_HD" - type="int" - transient="false" - volatile="false" - value="2" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="QUALITY_HIGH" type="int" transient="false" @@ -86070,17 +84985,6 @@ visibility="public" > </field> -<field name="QUALITY_WIDE" - type="int" - transient="false" - volatile="false" - value="3" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="audioBitRate" type="int" transient="false" @@ -86280,226 +85184,6 @@ > </field> </class> -<class name="EncoderCapabilities" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<method name="getAudioEncoders" - return="java.util.List<android.media.EncoderCapabilities.AudioEncoderCap>" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getOutputFileFormats" - return="int[]" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -<method name="getVideoEncoders" - return="java.util.List<android.media.EncoderCapabilities.VideoEncoderCap>" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> -</class> -<class name="EncoderCapabilities.AudioEncoderCap" - extends="java.lang.Object" - abstract="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<field name="mCodec" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxBitRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxChannels" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxSampleRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinBitRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinChannels" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinSampleRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> -<class name="EncoderCapabilities.VideoEncoderCap" - extends="java.lang.Object" - abstract="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<field name="mCodec" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxBitRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxFrameHeight" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxFrameRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMaxFrameWidth" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinBitRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinFrameHeight" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinFrameRate" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="mMinFrameWidth" - type="int" - transient="false" - volatile="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> <class name="ExifInterface" extends="java.lang.Object" abstract="false" @@ -88789,21 +87473,6 @@ <parameter name="c" type="android.hardware.Camera"> </parameter> </method> -<method name="setCameraParameters" - return="void" - abstract="false" - native="true" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="params" type="java.lang.String"> -</parameter> -<exception name="IllegalStateException" type="java.lang.IllegalStateException"> -</exception> -</method> <method name="setMaxDuration" return="void" abstract="false" @@ -99286,17 +97955,6 @@ visibility="public" > </method> -<method name="getKeepAliveInterval" - return="int" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getPassword" return="java.lang.String" abstract="false" @@ -99503,19 +98161,6 @@ <parameter name="displayName" type="java.lang.String"> </parameter> </method> -<method name="setKeepAliveInterval" - return="android.net.sip.SipProfile.Builder" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="interval" type="int"> -</parameter> -</method> <method name="setOutboundProxy" return="android.net.sip.SipProfile.Builder" abstract="false" @@ -100386,16 +99031,6 @@ visibility="public" > </field> -<field name="adhocSSID" - type="boolean" - transient="false" - volatile="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="allowedAuthAlgorithms" type="java.util.BitSet" transient="false" @@ -100446,16 +99081,6 @@ visibility="public" > </field> -<field name="frequency" - type="int" - transient="false" - volatile="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="hiddenSSID" type="boolean" transient="false" @@ -100592,169 +99217,6 @@ > </field> </class> -<class name="WifiConfiguration.ChannelFrequency" - extends="java.lang.Object" - abstract="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<field name="CHANNEL_1" - type="int" - transient="false" - volatile="false" - value="2412" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_10" - type="int" - transient="false" - volatile="false" - value="2457" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_11" - type="int" - transient="false" - volatile="false" - value="2462" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_12" - type="int" - transient="false" - volatile="false" - value="2467" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_13" - type="int" - transient="false" - volatile="false" - value="2472" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_14" - type="int" - transient="false" - volatile="false" - value="2484" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_2" - type="int" - transient="false" - volatile="false" - value="2417" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_3" - type="int" - transient="false" - volatile="false" - value="2422" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_4" - type="int" - transient="false" - volatile="false" - value="2427" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_5" - type="int" - transient="false" - volatile="false" - value="2432" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_6" - type="int" - transient="false" - volatile="false" - value="2437" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_7" - type="int" - transient="false" - volatile="false" - value="2442" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_8" - type="int" - transient="false" - volatile="false" - value="2447" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CHANNEL_9" - type="int" - transient="false" - volatile="false" - value="2452" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> <class name="WifiConfiguration.GroupCipher" extends="java.lang.Object" abstract="false" @@ -143472,17 +141934,6 @@ visibility="public" > </field> -<field name="EXTRA_MEDIA_ALBUM_ARTIST" - type="java.lang.String" - transient="false" - volatile="false" - value=""android.intent.extra.albumartist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="EXTRA_MEDIA_ARTIST" type="java.lang.String" transient="false" @@ -143719,17 +142170,6 @@ visibility="public" > </field> -<field name="ALBUM_ARTIST" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="ALBUM_ID" type="java.lang.String" transient="false" @@ -143796,17 +142236,6 @@ visibility="public" > </field> -<field name="NUMBER_OF_SONGS_FOR_ALBUM_ARTIST" - type="java.lang.String" - transient="false" - volatile="false" - value=""numsongs_by_album_artist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="NUMBER_OF_SONGS_FOR_ARTIST" type="java.lang.String" transient="false" @@ -143819,179 +142248,6 @@ > </field> </interface> -<interface name="MediaStore.Audio.AlbumartistColumns" - abstract="true" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<field name="ALBUM_ARTIST" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ALBUM_ARTIST_KEY" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist_key"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="NUMBER_OF_ALBUMS" - type="java.lang.String" - transient="false" - volatile="false" - value=""number_of_albums"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="NUMBER_OF_TRACKS" - type="java.lang.String" - transient="false" - volatile="false" - value=""number_of_tracks"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</interface> -<class name="MediaStore.Audio.Albumartists" - extends="java.lang.Object" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<implements name="android.provider.BaseColumns"> -</implements> -<implements name="android.provider.MediaStore.Audio.AlbumartistColumns"> -</implements> -<constructor name="MediaStore.Audio.Albumartists" - type="android.provider.MediaStore.Audio.Albumartists" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> -<method name="getContentUri" - return="android.net.Uri" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="volumeName" type="java.lang.String"> -</parameter> -</method> -<field name="CONTENT_TYPE" - type="java.lang.String" - transient="false" - volatile="false" - value=""vnd.android.cursor.dir/albumartists"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="DEFAULT_SORT_ORDER" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist_key"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ENTRY_CONTENT_TYPE" - type="java.lang.String" - transient="false" - volatile="false" - value=""vnd.android.cursor.item/albumartist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="EXTERNAL_CONTENT_URI" - type="android.net.Uri" - transient="false" - volatile="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="INTERNAL_CONTENT_URI" - type="android.net.Uri" - transient="false" - volatile="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> -<class name="MediaStore.Audio.Albumartists.Albums" - extends="java.lang.Object" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<implements name="android.provider.MediaStore.Audio.AlbumColumns"> -</implements> -<constructor name="MediaStore.Audio.Albumartists.Albums" - type="android.provider.MediaStore.Audio.Albumartists.Albums" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> -<method name="getContentUri" - return="android.net.Uri" - abstract="false" - native="false" - synchronized="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<parameter name="volumeName" type="java.lang.String"> -</parameter> -<parameter name="albumArtistId" type="long"> -</parameter> -</method> -</class> <class name="MediaStore.Audio.Albums" extends="java.lang.Object" abstract="false" @@ -144283,39 +142539,6 @@ visibility="public" > </field> -<field name="ALBUM_ARTIST" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ALBUM_ARTIST_ID" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist_id"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="ALBUM_ARTIST_KEY" - type="java.lang.String" - transient="false" - volatile="false" - value=""album_artist_key"" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="ALBUM_ID" type="java.lang.String" transient="false" @@ -177237,122 +175460,6 @@ > </field> </class> -<class name="PhoneGoggles" - extends="java.lang.Object" - abstract="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -<constructor name="PhoneGoggles" - type="android.util.PhoneGoggles" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> -<method name="processCommunication" - return="void" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="context" type="android.content.Context"> -</parameter> -<parameter name="type" type="int"> -</parameter> -<parameter name="phoneNumbers" type="java.lang.String[]"> -</parameter> -<parameter name="onCommunicate" type="java.lang.Runnable"> -</parameter> -<parameter name="onCancel" type="java.lang.Runnable"> -</parameter> -<parameter name="title" type="int"> -</parameter> -<parameter name="titleUnlocked" type="int"> -</parameter> -<parameter name="dialogContent" type="int"> -</parameter> -<parameter name="communicationUnauthorized" type="int"> -</parameter> -<parameter name="communicate" type="int"> -</parameter> -<parameter name="cancel" type="int"> -</parameter> -</method> -<field name="CONFIRMATION_MODE_MATHS" - type="int" - transient="false" - volatile="false" - value="2" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CONFIRMATION_MODE_NONE" - type="int" - transient="false" - volatile="false" - value="0" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="CONFIRMATION_MODE_PROMPT" - type="int" - transient="false" - volatile="false" - value="1" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -</class> -<class name="PhoneGoggles.Level" - extends="java.lang.Enum" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<method name="valueOf" - return="android.util.PhoneGoggles.Level" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="name" type="java.lang.String"> -</parameter> -</method> -<method name="values" - return="android.util.PhoneGoggles.Level[]" - abstract="false" - native="false" - synchronized="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</method> -</class> <class name="PrintStreamPrinter" extends="java.lang.Object" abstract="false" @@ -197482,17 +195589,6 @@ visibility="public" > </field> -<field name="PREVENT_POWER_KEY" - type="int" - transient="false" - volatile="false" - value="-2147483648" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="SCREEN_BRIGHTNESS_CHANGED" type="int" transient="false" diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java index 9712b2b..a88eac1 100644 --- a/core/java/android/app/AlertDialog.java +++ b/core/java/android/app/AlertDialog.java @@ -277,6 +277,7 @@ public class AlertDialog extends Dialog implements DialogInterface { /** * Constructor using a context and theme for this builder and * the {@link AlertDialog} it creates. + * @hide */ public Builder(Context context, int theme) { P = new AlertController.AlertParams(context); diff --git a/core/java/android/app/Profile.java b/core/java/android/app/Profile.java index 20cac21..5b4260c 100644 --- a/core/java/android/app/Profile.java +++ b/core/java/android/app/Profile.java @@ -33,6 +33,9 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; +/** + * @hide +*/ public final class Profile implements Parcelable { private String mName; diff --git a/core/java/android/app/ProfileGroup.java b/core/java/android/app/ProfileGroup.java index 503b550..1c44a21 100644 --- a/core/java/android/app/ProfileGroup.java +++ b/core/java/android/app/ProfileGroup.java @@ -31,6 +31,9 @@ import android.util.Log; import java.io.IOException; import java.util.UUID; +/** + * @hide +*/ public final class ProfileGroup implements Parcelable { private static final String TAG = "ProfileGroup"; diff --git a/core/java/android/app/ProfileManager.java b/core/java/android/app/ProfileManager.java index aacd651..14b2b1b 100644 --- a/core/java/android/app/ProfileManager.java +++ b/core/java/android/app/ProfileManager.java @@ -26,6 +26,9 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; +/** + * @hide +*/ public class ProfileManager { diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 570351d..802b3ef 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -190,7 +190,15 @@ public class DevicePolicyManager { * are ordered so that higher values are more restrictive. */ public static final int PASSWORD_QUALITY_SOMETHING = 0x10000; - + + /** + * Constant for {@link #setPasswordQuality}: the user must swipe a finger + * to unlock the screen. Note that quality constants are + * ordered so that higher values are more restrictive. + * @hide + */ + public static final int PASSWORD_QUALITY_FINGER = 0x1FFFF; + /** * Constant for {@link #setPasswordQuality}: the user must have entered a * password containing at least numeric characters. Note that quality @@ -418,7 +426,15 @@ public class DevicePolicyManager { * the password again until the user has entered it. */ public static final int RESET_PASSWORD_REQUIRE_ENTRY = 0x0001; - + + /** + * Flag for {@link #resetPassword}: Enable/Disable finger lock + */ + /** @hide */ + public static final int ENABLE_FINGER_LOCK = 0x1000; + /** @hide */ + public static final int DISABLE_FINGER_LOCK = 0x1001; + /** * Force a new device unlock password (the password needed to access the * entire device, not for individual accounts) on the user. This takes diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java index a420de0..0fa451ab 100644 --- a/core/java/android/bluetooth/BluetoothClass.java +++ b/core/java/android/bluetooth/BluetoothClass.java @@ -202,9 +202,13 @@ public final class BluetoothClass implements Parcelable { public static final int AUDIO_VIDEO_VIDEO_GAMING_TOY = 0x0448; // Devices in the PERIPHERAL major class + /** @hide */ public static final int PERIPHERAL_UNCATEGORIZED = 0x0500; - public static final int PERIPHERAL_KEYBORD = 0x0540; + /** @hide */ + public static final int PERIPHERAL_KEYBOARD = 0x0540; + /** @hide */ public static final int PERIPHERAL_POINTING_DEVICE = 0x0580; + /** @hide */ public static final int PERIPHERAL_COMBO_KEYBORD_POINTING = 0x05C0; // Devices in the WEARABLE major class diff --git a/core/java/android/bluetooth/BluetoothHid.java b/core/java/android/bluetooth/BluetoothHid.java index 45347d3..65c5abd 100644 --- a/core/java/android/bluetooth/BluetoothHid.java +++ b/core/java/android/bluetooth/BluetoothHid.java @@ -264,7 +264,7 @@ public class BluetoothHid { */ public static boolean doesClassMatch(BluetoothClass btClass) { switch (btClass.getDeviceClass()) { - case BluetoothClass.Device.PERIPHERAL_KEYBORD: + case BluetoothClass.Device.PERIPHERAL_KEYBOARD: case BluetoothClass.Device.PERIPHERAL_POINTING_DEVICE: case BluetoothClass.Device.PERIPHERAL_COMBO_KEYBORD_POINTING: return true; diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index f64fe1c..dc8f0fb 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -1339,6 +1339,7 @@ public abstract class Context { * * @see #getSystemService * @see android.app.ProfileManager + * @hide */ public static final String PROFILE_SERVICE = "profile"; diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index d03f931..aff017e 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -973,6 +973,7 @@ public class Camera { /** * Handles the Touch Co-ordinate. + * @hide */ public class Coordinate { /** @@ -1114,12 +1115,17 @@ public class Camera { public static final String EFFECT_AQUA = "aqua"; // Values for touch af/aec settings. + /** @hide */ public static final String TOUCH_AF_AEC_OFF = "touch-off"; + /** @hide */ public static final String TOUCH_AF_AEC_ON = "touch-on"; // Values for auto exposure settings. + /** @hide */ public static final String AUTO_EXPOSURE_FRAME_AVG = "meter-average"; + /** @hide */ public static final String AUTO_EXPOSURE_CENTER_WEIGHTED = "meter-center"; + /** @hide */ public static final String AUTO_EXPOSURE_SPOT_METERING = "meter-spot"; // Values for antibanding settings. @@ -1130,17 +1136,26 @@ public class Camera { //Values for ISO settings + /** @hide */ public static final String ISO_AUTO = "auto"; + /** @hide */ public static final String ISO_HJR = "deblur"; + /** @hide */ public static final String ISO_100 = "100"; + /** @hide */ public static final String ISO_200 = "200"; + /** @hide */ public static final String ISO_400 = "400"; + /** @hide */ public static final String ISO_800 = "800"; + /** @hide */ public static final String ISO_1250 = "1250"; //Values for Lens Shading + /** @hide */ public static final String LENSSHADE_ENABLE = "enable"; + /** @hide */ public static final String LENSSHADE_DISABLE= "disable"; @@ -1346,7 +1361,9 @@ public class Camera { //Values for Continuous AF + /** @hide */ public static final String CAF_OFF = "caf-off"; + /** @hide */ public static final String CAF_ON = "caf-on"; private HashMap<String, String> mMap; @@ -2067,6 +2084,7 @@ public class Camera { * @return one of TOUCH_AF_AEC_XXX string constant. null if Touch AF/AEC * setting is not supported. * + * @hide */ public String getTouchAfAec() { return get(KEY_TOUCH_AF_AEC); @@ -2077,6 +2095,7 @@ public class Camera { * * @param value TOUCH_AF_AEC_XXX string constants. * + * @hide */ public void setTouchAfAec(String value) { set(KEY_TOUCH_AF_AEC, value); @@ -2088,6 +2107,7 @@ public class Camera { * @return a List of TOUCH_AF_AEC_XXX string constants. null if TOUCH AF/AEC * setting is not supported. * + * @hide */ public List<String> getSupportedTouchAfAec() { String str = get(KEY_TOUCH_AF_AEC + SUPPORTED_VALUES_SUFFIX); @@ -2100,6 +2120,7 @@ public class Camera { * @param x the x co-ordinate of the touch event * @param y the y co-ordinate of the touch event * + * @hide */ public void setTouchIndexAec(int x, int y) { String v = Integer.toString(x) + "x" + Integer.toString(y); @@ -2112,6 +2133,7 @@ public class Camera { * @return a Index object with the x and y co-ordinated * for the touch event * + * @hide */ public Coordinate getTouchIndexAec() { String pair = get(KEY_TOUCH_INDEX_AEC); @@ -2124,6 +2146,7 @@ public class Camera { * @param x the x co-ordinate of the touch event * @param y the y co-ordinate of the touch event * + * @hide */ public void setTouchIndexAf(int x, int y) { String v = Integer.toString(x) + "x" + Integer.toString(y); @@ -2136,6 +2159,7 @@ public class Camera { * @return a Index object with the x and y co-ordinated * for the touch event * + * @hide */ public Coordinate getTouchIndexAf() { String pair = get(KEY_TOUCH_INDEX_AF); @@ -2146,6 +2170,7 @@ public class Camera { * Get Sharpness level * * @return sharpness level + * @hide */ public int getSharpness(){ return getInt(KEY_SHARPNESS, 0); @@ -2155,6 +2180,7 @@ public class Camera { * Set Sharpness Level * * @param sharpness level + * @hide */ public void setSharpness(int sharpness){ if((sharpness < 0) || (sharpness > getMaxSharpness()) ) @@ -2168,6 +2194,7 @@ public class Camera { * Get Max Sharpness Level * * @return max sharpness level + * @hide */ public int getMaxSharpness(){ return getInt(KEY_MAX_SHARPNESS, 0); @@ -2177,6 +2204,7 @@ public class Camera { * Get default sharpness level * * @return default sharpness level + * @hide */ public int getDefaultSharpness() { return getInt(KEY_DEFAULT_SHARPNESS, 0); @@ -2186,6 +2214,7 @@ public class Camera { * Get Contrast level * * @return contrast level + * @hide */ public int getContrast(){ return getInt(KEY_CONTRAST, 0); @@ -2195,6 +2224,7 @@ public class Camera { * Set Contrast Level * * @param contrast level + * @hide */ public void setContrast(int contrast){ if((contrast < 0 ) || (contrast > getMaxContrast())) @@ -2208,6 +2238,7 @@ public class Camera { * Get Max Contrast Level * * @return max contrast level + * @hide */ public int getMaxContrast(){ return getInt(KEY_MAX_CONTRAST, 0); @@ -2217,6 +2248,7 @@ public class Camera { * Get default contrast level * * @return default contrast level + * @hide */ public int getDefaultContrast() { return getInt(KEY_DEFAULT_CONTRAST, 0); @@ -2226,6 +2258,7 @@ public class Camera { * Get Saturation level * * @return saturation level + * @hide */ public int getSaturation(){ return getInt(KEY_SATURATION, 0); @@ -2235,6 +2268,7 @@ public class Camera { * Set Saturation Level * * @param saturation level + * @hide */ public void setSaturation(int saturation){ if((saturation < 0 ) || (saturation > getMaxSaturation())) @@ -2248,6 +2282,7 @@ public class Camera { * Get Max Saturation Level * * @return max contrast level + * @hide */ public int getMaxSaturation(){ return getInt(KEY_MAX_SATURATION, 0); @@ -2257,6 +2292,7 @@ public class Camera { * Get default saturation level * * @return default saturation level + * @hide */ public int getDefaultSaturation() { return getInt(KEY_DEFAULT_SATURATION, 0); @@ -2266,6 +2302,7 @@ public class Camera { * Get brightness level * * @return brightness level + * @hide */ public int getBrightness(){ return getInt(KEY_BRIGHTNESS, 0); @@ -2275,6 +2312,7 @@ public class Camera { * Set brightness level * * @param brightness level + * @hide */ public void setBrightness(int brightness){ if((brightness < 0 ) || (brightness > getMaxBrightness())) @@ -2288,6 +2326,7 @@ public class Camera { * Get Max Brightness Level * * @return max brightness level + * @hide */ public int getMaxBrightness(){ return getInt(KEY_MAX_BRIGHTNESS, 0); @@ -2297,6 +2336,7 @@ public class Camera { * Get default brightness level * * @return default brightness level + * @hide */ public int getDefaultBrightness() { return getInt(KEY_DEFAULT_BRIGHTNESS, 0); @@ -2343,6 +2383,7 @@ public class Camera { * * @return one of FRAME_RATE_XXX_MODE string constant. null if this * setting is not supported. + * @hide */ public String getPreviewFrameRateMode() { return get(KEY_PREVIEW_FRAME_RATE_MODE); @@ -2352,6 +2393,7 @@ public class Camera { * Sets the frame rate mode. * * @param value FRAME_RATE_XXX_MODE string constants. + * @hide */ public void setPreviewFrameRateMode(String value) { set(KEY_PREVIEW_FRAME_RATE_MODE, value); @@ -2362,6 +2404,7 @@ public class Camera { * * @return a List of FRAME_RATE_XXX_MODE string constant. null if this * setting is not supported. + * @hide */ public List<String> getSupportedPreviewFrameRateModes() { String str = get(KEY_PREVIEW_FRAME_RATE_MODE + SUPPORTED_VALUES_SUFFIX); @@ -2706,6 +2749,7 @@ public class Camera { * @return one of CONTINUOUS_AF_XXX string constant. null if continuous AF * setting is not supported. * + * @hide */ public String getContinuousAf() { return get(KEY_CAF); @@ -2715,6 +2759,7 @@ public class Camera { * Sets the current Continuous AF mode. * @param value CONTINUOUS_AF_XXX string constants. * + * @hide */ public void setContinuousAf(String value) { set(KEY_CAF, value); @@ -2726,6 +2771,7 @@ public class Camera { * @return a List of CONTINUOUS_AF_XXX string constant. null if continuous AF * setting is not supported. * + * @hide */ public List<String> getSupportedContinuousAfModes() { String str = get(KEY_CAF + SUPPORTED_VALUES_SUFFIX); @@ -2737,6 +2783,7 @@ public class Camera { * * @return one of ISO_XXX string constant. null if ISO * setting is not supported. + * @hide */ public String getISOValue() { return get(KEY_ISO_MODE); @@ -2746,6 +2793,7 @@ public class Camera { * Sets the ISO. * * @param iso ISO_XXX string constant. + * @hide */ public void setISOValue(String iso) { set(KEY_ISO_MODE, iso); @@ -2756,6 +2804,7 @@ public class Camera { * * @return a List of FLASH_MODE_XXX string constants. null if flash mode * setting is not supported. + * @hide */ public List<String> getSupportedIsoValues() { String str = get(KEY_ISO_MODE + SUPPORTED_VALUES_SUFFIX); @@ -2775,6 +2824,7 @@ public class Camera { * Gets the current LensShade Mode. * * @return LensShade Mode + * @hide */ public String getLensShade() { return get(KEY_LENSSHADE); @@ -2784,6 +2834,7 @@ public class Camera { * Sets the current LensShade Mode. * * @return LensShade Mode + * @hide */ public void setLensShade(String lensshade) { set(KEY_LENSSHADE, lensshade); @@ -2794,6 +2845,7 @@ public class Camera { * * @return a List of LENS_MODE_XXX string constants. null if lens mode * setting is not supported. + * @hide */ public List<String> getSupportedLensShadeModes() { String str = get(KEY_LENSSHADE + SUPPORTED_VALUES_SUFFIX); @@ -2805,6 +2857,7 @@ public class Camera { * * @return one of AUTO_EXPOSURE_XXX string constant. null if auto exposure * setting is not supported. + * @hide */ public String getAutoExposure() { return get(KEY_AUTO_EXPOSURE); @@ -2814,6 +2867,7 @@ public class Camera { * Sets the current auto exposure setting. * * @param value AUTO_EXPOSURE_XXX string constants. + * @hide */ public void setAutoExposure(String value) { set(KEY_AUTO_EXPOSURE, value); @@ -2824,6 +2878,7 @@ public class Camera { * * @return a List of AUTO_EXPOSURE_XXX string constants. null if auto exposure * setting is not supported. + * @hide */ public List<String> getSupportedAutoexposure() { String str = get(KEY_AUTO_EXPOSURE + SUPPORTED_VALUES_SUFFIX); @@ -2833,6 +2888,7 @@ public class Camera { /** * Sets the smart-contrast feature * @param enabled SMART_CONTRAST desired status. + * @hide */ public void setSmartContrastEnabled(boolean enabled) { set(KEY_SMART_CONTRAST, enabled ? "on" : "off"); @@ -2842,6 +2898,7 @@ public class Camera { * Gets the value of smart-contrast * * @return if smart-contrast is enabled + * @hide */ public boolean isSmartContrastEnabled() { return "on".equals(get(KEY_SMART_CONTRAST)); diff --git a/core/java/android/preference/MultiSelectListPreference.java b/core/java/android/preference/MultiSelectListPreference.java index 582df6c..5dc4ebe 100644 --- a/core/java/android/preference/MultiSelectListPreference.java +++ b/core/java/android/preference/MultiSelectListPreference.java @@ -22,6 +22,9 @@ import android.content.DialogInterface; import android.text.TextUtils; import android.util.AttributeSet; +/** + * @hide +*/ public class MultiSelectListPreference extends ListPreference { private static final String SEPARATOR = "OV=I=XseparatorX=I=VO"; diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index fd178f5..cab7d2a 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -98,6 +98,7 @@ public final class MediaStore { public static final String EXTRA_MEDIA_ARTIST = "android.intent.extra.artist"; /** * The name of the Intent-extra used to define the album artist + * @hide */ public static final String EXTRA_MEDIA_ALBUM_ARTIST = "android.intent.extra.albumartist"; /** @@ -908,12 +909,14 @@ public final class MediaStore { /** * The id of the artist credited for the album that contains the audio file * <P>Type: INTEGER (long)</P> + * @hide */ public static final String ALBUM_ARTIST_ID = "album_artist_id"; /** * The artist credited for the album that contains the audio file * <P>Type: TEXT</P> + * @hide */ public static final String ALBUM_ARTIST = "album_artist"; @@ -921,6 +924,7 @@ public final class MediaStore { * A non human readable key calculated from the ALBUM_ARTIST, used for * searching, sorting and grouping * <P>Type: TEXT</P> + * @hide */ public static final String ALBUM_ARTIST_KEY = "album_artist_key"; @@ -1458,6 +1462,7 @@ public final class MediaStore { /** * Columns representing an album artist + * @hide */ public interface AlbumartistColumns { /** @@ -1486,6 +1491,7 @@ public final class MediaStore { /** * Contains album artists for audio files + * @hide */ public static final class Albumartists implements BaseColumns, AlbumartistColumns { /** @@ -1567,6 +1573,7 @@ public final class MediaStore { /** * The album artist credited on this album * <P>Type: TEXT</P> + * @hide */ public static final String ALBUM_ARTIST = "album_artist"; @@ -1589,6 +1596,7 @@ public final class MediaStore { * and indicates the number of songs on the album credited to the given * album artist. * <P>Type: INTEGER</P> + * @hide */ public static final String NUMBER_OF_SONGS_FOR_ALBUM_ARTIST = "numsongs_by_album_artist"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index f70744f..04ce014 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3577,6 +3577,7 @@ public final class Settings { /** * The TCP/IP port to run ADB on, or -1 for USB + * @hide */ public static final String ADB_PORT = "adb_port"; diff --git a/core/java/android/util/PhoneGoggles.java b/core/java/android/util/PhoneGoggles.java index 617f8b8..19e73f9 100644 --- a/core/java/android/util/PhoneGoggles.java +++ b/core/java/android/util/PhoneGoggles.java @@ -126,6 +126,7 @@ import com.android.internal.R; * onRun.run(); * } * + * @hide */ public class PhoneGoggles { diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index ce91041..cbe7556 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -630,7 +630,8 @@ public interface WindowManager extends ViewManager { * {@hide} */ public static final int FLAG_SYSTEM_ERROR = 0x40000000; - /** Window flag: Overrides default power key behavior */ + /** Window flag: Overrides default power key behavior + * {@hide} */ public static final int PREVENT_POWER_KEY = 0x80000000; /** diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 668b029..cbd1317 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -101,8 +101,9 @@ public class LockPatternUtils { private final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently"; private final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline"; private final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen"; - public final static String PASSWORD_TYPE_KEY = "lockscreen.password_type"; private final static String LOCK_PASSWORD_SALT_KEY = "lockscreen.password_salt"; + private final static String LOCK_FINGER_ENABLED = "lockscreen.lockfingerenabled"; + public final static String PASSWORD_TYPE_KEY = "lockscreen.password_type"; private final Context mContext; private final ContentResolver mContentResolver; @@ -251,6 +252,14 @@ public class LockPatternUtils { } /** + * Check to see if the user has stored a finger. + * @return Whether a saved finger exists. + */ + public boolean savedFingerExists() { + return true; + } + + /** * Return true if the user has ever chosen a pattern. This is true even if the pattern is * currently cleared. * @@ -287,6 +296,11 @@ public class LockPatternUtils { activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC; } break; + case DevicePolicyManager.PASSWORD_QUALITY_FINGER: + if (isLockFingerEnabled()) { + activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_FINGER; + } + break; } return activePasswordQuality; } @@ -560,6 +574,15 @@ public class LockPatternUtils { } /** + * @return Whether the lock finger is enabled. + */ + public boolean isLockFingerEnabled() { + return getBoolean(LOCK_FINGER_ENABLED) + && getLong(PASSWORD_TYPE_KEY, 0) + == DevicePolicyManager.PASSWORD_QUALITY_FINGER; + } + + /** * Set whether the lock pattern is enabled. */ public void setLockPatternEnabled(boolean enabled) { @@ -567,6 +590,18 @@ public class LockPatternUtils { } /** + * Set whether the lock finger is enabled. + */ + public void setLockFingerEnabled(boolean enabled) { + setBoolean(LOCK_FINGER_ENABLED, enabled); + if (enabled) { + setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_FINGER); + } else { + setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING); + } + } + + /** * @return Whether the visible pattern is enabled. */ public boolean isVisiblePatternEnabled() { @@ -593,59 +628,59 @@ public class LockPatternUtils { public void setTactileFeedbackEnabled(boolean enabled) { setBoolean(Settings.Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, enabled); } - + public void setVisibleDotsEnabled(boolean enabled) { - setBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, enabled); + setBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, enabled); } - + public boolean isVisibleDotsEnabled() { return getBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, true); } - + public void setShowErrorPath(boolean enabled) { - setBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, enabled); + setBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, enabled); } - + public boolean isShowErrorPath() { return getBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, true); } - + public void setShowCustomMsg(boolean enabled) { setBoolean(Settings.Secure.LOCK_SHOW_CUSTOM_MSG, enabled); } - + public boolean isShowCustomMsg() { return getBoolean(Settings.Secure.LOCK_SHOW_CUSTOM_MSG, false); } - + public void setCustomMsg(String msg) { setString(Settings.Secure.LOCK_CUSTOM_MSG, msg); } - + public String getCustomMsg() { return getString(Settings.Secure.LOCK_CUSTOM_MSG); } - + public int getIncorrectDelay() { return getInt(Settings.Secure.LOCK_INCORRECT_DELAY, 2000); } - + public void setIncorrectDelay(int delay) { setInt(Settings.Secure.LOCK_INCORRECT_DELAY, delay); } - + public void setShowUnlockMsg(boolean enabled) { setBoolean(Settings.Secure.SHOW_UNLOCK_TEXT, enabled); } - + public boolean isShowUnlockMsg() { return getBoolean(Settings.Secure.SHOW_UNLOCK_TEXT, true); } - + public void setShowUnlockErrMsg(boolean enabled) { setBoolean(Settings.Secure.SHOW_UNLOCK_ERR_TEXT, enabled); } - + public boolean isShowUnlockErrMsg() { return getBoolean(Settings.Secure.SHOW_UNLOCK_ERR_TEXT, true); } @@ -852,7 +887,7 @@ public class LockPatternUtils { return 1 == android.provider.Settings.Secure.getInt(mContentResolver, secureSettingKey, 0); } - + private boolean getBoolean(String systemSettingKey, boolean defaultValue) { return 1 == android.provider.Settings.Secure.getInt( @@ -872,7 +907,7 @@ public class LockPatternUtils { private void setLong(String secureSettingKey, long value) { android.provider.Settings.Secure.putLong(mContentResolver, secureSettingKey, value); } - + private int getInt(String systemSettingKey, int def) { return android.provider.Settings.Secure.getInt(mContentResolver, systemSettingKey, def); } @@ -880,16 +915,16 @@ public class LockPatternUtils { private void setInt(String systemSettingKey, int value) { android.provider.Settings.Secure.putInt(mContentResolver, systemSettingKey, value); } - + private String getString(String systemSettingKey) { String s = android.provider.Settings.Secure.getString(mContentResolver, systemSettingKey); - + if (s == null) return ""; - + return s; } - + private void setString(String systemSettingKey, String value) { android.provider.Settings.Secure.putString(mContentResolver, systemSettingKey, value); } @@ -897,10 +932,12 @@ public class LockPatternUtils { public boolean isSecure() { long mode = getKeyguardStoredPasswordQuality(); final boolean isPattern = mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING; + final boolean isFinger = mode == DevicePolicyManager.PASSWORD_QUALITY_FINGER; final boolean isPassword = mode == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC || mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC || mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC; final boolean secure = isPattern && isLockPatternEnabled() && savedPatternExists() + || isFinger && isLockFingerEnabled() && savedFingerExists() || isPassword && savedPasswordExists(); return secure; } diff --git a/core/java/com/authentec/AuthentecHelper.java b/core/java/com/authentec/AuthentecHelper.java new file mode 100644 index 0000000..7a5b17b --- /dev/null +++ b/core/java/com/authentec/AuthentecHelper.java @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2011 The CyanogenMOD Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.authentec; + +import dalvik.system.DexClassLoader; + +import android.content.Context; +import android.content.ContextWrapper; + +import android.os.SystemProperties; + +import java.lang.reflect.Constructor; + +public class AuthentecHelper +{ + private static DexClassLoader sAuthentecClassLoader = null; + private Class TSM = null; + private Class AuthentecMobile = null; + private Object am = null; + + /* AM_STATUS codes */ + public static final int eAM_STATUS_ACCESS_ERROR = 6; + public static final int eAM_STATUS_APPLICATION_IO_ERROR = 11; + public static final int eAM_STATUS_CAPTURE_FAILED = 15; + public static final int eAM_STATUS_CLIENT_CANCELED = 17; + public static final int eAM_STATUS_CLIENT_NOT_PERMITTED = 18; + public static final int eAM_STATUS_CREDENTIAL_LOCKED = 3; + public static final int eAM_STATUS_CREDENTIAL_TOO_LARGE = 5; + public static final int eAM_STATUS_DATABASE_FULL = 7; + public static final int eAM_STATUS_FINGERS_NOT_PROVISIONED = 19; + public static final int eAM_STATUS_FOREIGN_DATABASE = 8; + public static final int eAM_STATUS_GUI_IS_OFFLINE = 21; + public static final int eAM_STATUS_INVALID_APP_CONTEXT = 10; + public static final int eAM_STATUS_INVALID_PARAMETER = 4; + public static final int eAM_STATUS_INVALID_USER_ID = 22; + public static final int eAM_STATUS_LIBRARY_NOT_AVAILABLE = 14; + public static final int eAM_STATUS_NO_ACTIVE_USER = 20; + public static final int eAM_STATUS_NO_STORED_CREDENTIAL = 2; + public static final int eAM_STATUS_OK = 0; + public static final int eAM_STATUS_TIMEOUT = 12; + public static final int eAM_STATUS_UI_TIMEOUT = 16; + public static final int eAM_STATUS_UNKNOWN_COMMAND = 1; + public static final int eAM_STATUS_UNKNOWN_ERROR = 99; + public static final int eAM_STATUS_USER_CANCELED = 9; + public static final int eAM_STATUS_USURP_FAILURE = 13; + + private AuthentecHelper(Context ctx) + { + try { + AuthentecMobile = sAuthentecClassLoader.loadClass("com.authentec.amjni.AuthentecMobile"); + TSM = sAuthentecClassLoader.loadClass("com.authentec.amjni.TSM"); + Constructor ctor = AuthentecMobile.getDeclaredConstructors()[0]; + am = ctor.newInstance(ctx); + } catch (Exception ex) { + ex.printStackTrace(); + return; + } + } + + public int fingerprintUnlock(String sScreen, Context ctx) { + int iResult = 0; + + try { + if (! (Boolean) AuthentecMobile.getMethod("AM2ClientLibraryLoaded").invoke(am)) { + return eAM_STATUS_LIBRARY_NOT_AVAILABLE; + } + + if(null == ctx) { + return eAM_STATUS_INVALID_PARAMETER; + } + + //int iResult = TSM.LAP(ctx).verify().viaGfxScreen(sScreen).exec(); + Class partTypes[] = new Class[1]; + Object argList[] = new Object[1]; + + partTypes[0] = Context.class; + argList[0] = ctx; + Object TSMi = TSM.getMethod("LAP", partTypes).invoke(null, argList); + + TSM.getMethod("verify").invoke(TSMi); + + partTypes[0] = String.class; + argList[0] = sScreen; + TSM.getMethod("viaGfxScreen", partTypes).invoke(TSMi, argList); + + iResult = (Integer) TSM.getMethod("exec").invoke(TSMi); + TSMi = null; + + try { + Thread.sleep(1500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return iResult; + } + + public int startEnrollmentWizard(Context choosefinger, String msTempPasscode) + { + int miResult = eAM_STATUS_LIBRARY_NOT_AVAILABLE; + + try { + Class partTypes[] = new Class[1]; + Object argList[] = new Object[1]; + + partTypes[0] = Context.class; + argList[0] = choosefinger; + Object TSMi = TSM.getMethod("LAP", partTypes).invoke(null, argList); + + if (msTempPasscode != null) { + partTypes[0] = String.class; + argList[0] = msTempPasscode; + argList[0] = (String) TSM.getMethod("Hexify", partTypes).invoke(null, argList); + + TSM.getMethod("usingPasscode", partTypes).invoke(TSMi, argList); + + TSM.getMethod("enroll").invoke(TSMi); + //miResult = TSM.LAP(ChooseLockFinger.this).usingPasscode(TSM.Hexify(msTempPasscode)).enroll().exec(); + } else { + partTypes[0] = String.class; + argList[0] = "_classicEnroll"; + TSM.getMethod("addFunction", partTypes).invoke(TSMi, argList); + //miResult = TSM.LAP(ChooseLockFinger.this).addFunction("_classicEnroll").exec(); + } + + miResult = (Integer) TSM.getMethod("exec").invoke(TSMi); + TSMi = null; + + } catch (Exception e) { + e.printStackTrace(); + } + + return miResult; + } + + public int startVerification(Context choosefinger) + { + int miResult = eAM_STATUS_LIBRARY_NOT_AVAILABLE; + + try { + //miResult = TSM.LAP(ChooseLockFinger.this).verify().viaGfxScreen("lap-verify").exec(); + Class partTypes[] = new Class[1]; + Object argList[] = new Object[1]; + + partTypes[0] = Context.class; + argList[0] = choosefinger; + Object TSMi = TSM.getMethod("LAP", partTypes).invoke(null, argList); + + TSM.getMethod("verify").invoke(TSMi); + + partTypes[0] = String.class; + argList[0] = "lap-verify"; + TSM.getMethod("viaGfxScreen", partTypes).invoke(TSMi, argList); + + miResult = (Integer) TSM.getMethod("exec").invoke(TSMi); + TSMi = null; + + } catch (Exception e) { + e.printStackTrace(); + } + + return miResult; + } + + public int verifyPolicy(Context ctx) + { + int iResult = eAM_STATUS_LIBRARY_NOT_AVAILABLE; + + try { + //iResult = TSM.LAP(m_Context).waitForUI().verify().exec(); + Class partTypes[] = new Class[1]; + Object argList[] = new Object[1]; + + partTypes[0] = Context.class; + argList[0] = ctx; + Object TSMi = TSM.getMethod("LAP", partTypes).invoke(null, argList); + + TSM.getMethod("waitForUI").invoke(TSMi, (Object[]) null); + + TSM.getMethod("verify").invoke(TSMi, (Object[]) null); + + iResult = (Integer) TSM.getMethod("exec").invoke(TSMi, (Object[]) null); + TSMi = null; + + } catch (Exception e) { + e.printStackTrace(); + } + + return iResult; + } + + public static AuthentecHelper getInstance(Context ctx) + { + ensureClassLoader(ctx); + return new AuthentecHelper(ctx); + } + + public static void ensureClassLoader(Context ctx) + { + if (sAuthentecClassLoader != null) { + return; + } + + String authentecJarLocation = SystemProperties.get("ro.authentec.fingerprint.jar",""); + String authentecSoLocation = SystemProperties.get("ro.authentec.fingerprint.so",""); + + if ("".equals(authentecJarLocation) || "".equals(authentecSoLocation)) + return; + + sAuthentecClassLoader = new DexClassLoader(authentecJarLocation, + new ContextWrapper(ctx).getCacheDir().getAbsolutePath(), + authentecSoLocation,ClassLoader.getSystemClassLoader()); + } +} diff --git a/core/java/com/authentec/GfxEngineRelayService.java b/core/java/com/authentec/GfxEngineRelayService.java new file mode 100644 index 0000000..53a4d68 --- /dev/null +++ b/core/java/com/authentec/GfxEngineRelayService.java @@ -0,0 +1,127 @@ +package com.authentec; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.os.RemoteException; + +import com.authentec.TrueSuiteMobile.RelayReceiverService; + +public class GfxEngineRelayService extends Service { + + public interface Receiver + { + public void receiveCommand(String command, String args); + } + + static Receiver mLocalReceiver = null; + public static void setLocalReceiver(Receiver localReceiver) { + // first send any queued commands to the activity + while (!mCommandBuffer.isEmpty()) { + Command storedCommand = mCommandBuffer.remove(0); + if (null == localReceiver) continue; + + // send the command on to the receiver + localReceiver.receiveCommand( + storedCommand.mCommand, storedCommand.mArguments); + + } + + // finally record who the receiver is + mLocalReceiver = localReceiver; + } + + static private ArrayList<Command> mCommandBuffer = new ArrayList<Command>(); + static private List<String> mEventBuffer = new ArrayList<String>(); + static private Semaphore mEventBufferSemaphore = null; + + private class Command { + public String mCommand; + public String mArguments; + public Command(String command, String arguments) { + mCommand = command; + mArguments = arguments; + } + } + + static public void queueEvent(String event) { + if (null == mEventBufferSemaphore) return; + mEventBuffer.add(event); + mEventBufferSemaphore.release(); + } + + @Override + public IBinder onBind(Intent intent) { + /* when we're bound to, we want to have an empty event buffer */ + mEventBuffer.clear(); + mEventBufferSemaphore = new Semaphore(0); + return new RelayReceiverServiceImpl(); + } + + private class RelayReceiverServiceImpl extends RelayReceiverService.Stub + implements RelayReceiverService { + + /* remote clients call sendCommand() when the GfxEngine has provided */ + /* a new command to apply to the UI */ + public void sendCommand(String command, String args) throws RemoteException { + + /* if we've got a local receiver, pass the command to it */ + if (null != mLocalReceiver) { + while (!mCommandBuffer.isEmpty()) { + // first pull items from the buffer. if anything is in here, + // it came in before the activity was ready to receive them. + Command storedCommand = mCommandBuffer.remove(0); + mLocalReceiver.receiveCommand( + storedCommand.mCommand, storedCommand.mArguments); + } + mLocalReceiver.receiveCommand(command, args); + } + else { + // append it to a buffer to be delivered later + mCommandBuffer.add(new Command(command, args)); + } + } + + /* remote clients call receiveEvent() to get the next event from the */ + /* UI's event queue -- things like #cancel and #timeout */ + public String receiveEvent() throws RemoteException { + /* block until there's something in the event queue */ + try { + // mEventBufferSemaphore.acquire(); + + // This method runs in the service's main thread (and there's no way + // to move it to a child thread, since it needs to return an answer + // to the GfxEngine), and when the keyguard blocks here, Android has + // problems. So it's better to add a timeout to the block waiting. + if (!mEventBufferSemaphore.tryAcquire(10, TimeUnit.SECONDS)) { + + // The GfxEngine is not currently expecting this exception and it will + // try to use the null pointer. We should probably fix this in the GfxEngine, + // but a short term solution is to return "" instead of null. + return ""; + } + } catch (InterruptedException e) { + // return null; + return ""; + } + + /* remove the next event from the queue and return it */ + if (mEventBuffer.isEmpty()) { + return ""; + } + else{ + return mEventBuffer.remove(0); + } + } + + /* remote clients call receiveEvent() to release mEventBufferSemaphore */ + public void quit() throws RemoteException { + mEventBufferSemaphore.release(); + } + } +} diff --git a/core/java/com/authentec/TrueSuiteMobile/RelayReceiverService.aidl b/core/java/com/authentec/TrueSuiteMobile/RelayReceiverService.aidl new file mode 100644 index 0000000..ac8c8af --- /dev/null +++ b/core/java/com/authentec/TrueSuiteMobile/RelayReceiverService.aidl @@ -0,0 +1,7 @@ +package com.authentec.TrueSuiteMobile; +interface RelayReceiverService +{ + void sendCommand(String command, String args); + String receiveEvent(); + void quit(); +} diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 85f791d..11d849b 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -448,6 +448,7 @@ android:label="@string/permlab_recordAudio" android:description="@string/permdesc_recordAudio" /> + <!-- @hide --> <permission android:name="android.permission.RAW_AUDIO" android:permissionGroup="android.permission-group.HARDWARE_CONTROLS" android:protectionLevel="dangerous" @@ -467,7 +468,8 @@ android:label="@string/permlab_camera" android:description="@string/permdesc_camera" /> - <!-- Allows an application to override the power key action --> + <!-- Allows an application to override the power key action + @hide --> <permission android:name="android.permission.PREVENT_POWER_KEY" android:permissionGroup="android.permission-group.HARDWARE_CONTROLS" android:protectionLevel="dangerous" @@ -1393,6 +1395,12 @@ android:permission="android.permission.BIND_WALLPAPER"> </service> + <service android:name="com.authentec.GfxEngineRelayService"> + <intent-filter> + <action android:name="com.authentec.Keyguard" /> + </intent-filter> + </service> + <receiver android:name="com.android.server.BootReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> diff --git a/core/res/res/drawable/cmfp.png b/core/res/res/drawable/cmfp.png Binary files differnew file mode 100644 index 0000000..b120773 --- /dev/null +++ b/core/res/res/drawable/cmfp.png diff --git a/core/res/res/layout/keyguard_screen_finger_landscape.xml b/core/res/res/layout/keyguard_screen_finger_landscape.xml new file mode 100644 index 0000000..928c7d4 --- /dev/null +++ b/core/res/res/layout/keyguard_screen_finger_landscape.xml @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License") +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<!-- This is the screen that shows the 9 circle unlock widget and instructs + the user how to unlock their device, or make an emergency call. This + is the portrait layout. --> + +<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#70000000" + > + + <!-- left side: instructions and emergency call button --> + <LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:layout_marginLeft="24dip" + android:gravity="left" + > + + <TextView + android:id="@+id/status1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dip" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <TextView + android:id="@+id/carrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="17sp" + android:drawablePadding="4dip" + android:layout_marginTop="32dip" + android:singleLine="true" + android:ellipsize="marquee" + android:gravity="right|bottom" + /> + + <com.android.internal.widget.DigitalClock android:id="@+id/time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_marginTop="8dip" + android:paddingBottom="8dip" + > + + <TextView android:id="@+id/timeDisplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="none" + android:textSize="72sp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:shadowColor="#C0000000" + android:shadowDx="0" + android:shadowDy="0" + android:shadowRadius="3.0" + android:layout_marginBottom="6dip" + /> + + + <TextView android:id="@+id/am_pm" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/timeDisplay" + android:layout_alignBaseline="@id/timeDisplay" + android:singleLine="true" + android:ellipsize="none" + android:textSize="22sp" + android:layout_marginLeft="8dip" + android:textAppearance="?android:attr/textAppearanceMedium" + android:shadowColor="#C0000000" + android:shadowDx="0" + android:shadowDy="0" + android:shadowRadius="3.0" + /> + + </com.android.internal.widget.DigitalClock> + + <TextView + android:id="@+id/date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/time" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <!-- used for instructions such as "draw pattern to unlock", the next alarm, and charging + status. --> + <LinearLayout + android:orientation="horizontal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dip" + android:gravity="center" + > + <TextView + android:id="@+id/statusSep" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dip" + android:layout_marginRight="5dip" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="17sp" + /> + <TextView + android:id="@+id/status2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="17sp" + android:drawablePadding="4dip" + /> + </LinearLayout> + + <!-- fill space between header and button below --> + <View + android:layout_weight="1.0" + android:layout_width="match_parent" + android:layout_height="0dip" + /> + + <!-- footer --> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dip" + > + + <!-- option 1: a single emergency call button --> + <RelativeLayout android:id="@+id/footerNormal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="left" + > + <Button android:id="@+id/emergencyCallAlone" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/lockscreen_emergency_call" + style="@style/Widget.Button.Transparent" + android:drawableLeft="@drawable/ic_emergency" + android:drawablePadding="8dip" + /> + </RelativeLayout> + + <!-- option 2: an emergency call button, and a 'forgot pattern?' button --> + <LinearLayout android:id="@+id/footerForgotPattern" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="left" + > + <Button android:id="@+id/forgotPattern" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/Widget.Button.Transparent" + android:visibility="invisible" + /> + <Button android:id="@+id/emergencyCallTogether" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/lockscreen_emergency_call" + style="@style/Widget.Button.Transparent" + android:drawableLeft="@drawable/ic_emergency" + android:drawablePadding="8dip" + /> + </LinearLayout> + </FrameLayout> + </LinearLayout> + + <!-- right side: lock finger --> + <include + layout="@layout/unlock_finger" + android:id="@+id/unlock_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + /> + +</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> diff --git a/core/res/res/layout/keyguard_screen_finger_portrait.xml b/core/res/res/layout/keyguard_screen_finger_portrait.xml new file mode 100644 index 0000000..8bb9a22 --- /dev/null +++ b/core/res/res/layout/keyguard_screen_finger_portrait.xml @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License") +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<!-- This is the screen that shows the 9 circle unlock widget and instructs + the user how to unlock their device, or make an emergency call. This + is the portrait layout. --> +<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_horizontal" + android:background="#70000000" + > + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + > + <TextView + android:id="@+id/carrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginTop="6dip" + android:layout_alignParentRight="true" + android:layout_marginRight="8dip" + android:layout_toRightOf="@+id/time" + android:singleLine="true" + android:ellipsize="marquee" + android:gravity="right|bottom" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <com.android.internal.widget.DigitalClock android:id="@+id/time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:layout_marginTop="15dip" + android:layout_marginLeft="20dip" + android:paddingBottom="8dip" + > + + <TextView android:id="@+id/timeDisplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="none" + android:textSize="56sp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:shadowColor="#C0000000" + android:shadowDx="0" + android:shadowDy="0" + android:shadowRadius="3.0" + android:layout_marginBottom="6dip" + /> + + <TextView android:id="@+id/am_pm" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/timeDisplay" + android:layout_alignBaseline="@id/timeDisplay" + android:singleLine="true" + android:ellipsize="none" + android:textSize="18sp" + android:layout_marginLeft="4dip" + android:textAppearance="?android:attr/textAppearanceMedium" + android:shadowColor="#C0000000" + android:shadowDx="0" + android:shadowDy="0" + android:shadowRadius="3.0" + /> + + </com.android.internal.widget.DigitalClock> + + <TextView + android:id="@+id/date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/time" + android:layout_marginLeft="24dip" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + </RelativeLayout> + + <View + android:id="@+id/divider" + android:layout_width="match_parent" + android:layout_height="1dip" + android:layout_marginTop="8dip" + android:layout_marginBottom="8dip" + android:background="@android:drawable/divider_horizontal_dark" + /> + + <!-- used for instructions such as "draw pattern to unlock", the next alarm, and charging + status. --> + <LinearLayout + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="0dip" + android:layout_marginLeft="12dip" + android:gravity="left" + > + <TextView + android:id="@+id/status1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="18sp" + android:drawablePadding="4dip" + /> + <TextView + android:id="@+id/statusSep" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dip" + android:layout_marginRight="5dip" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="18sp" + /> + <TextView + android:id="@+id/status2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="18sp" + android:drawablePadding="4dip" + /> + </LinearLayout> + + <include + layout="@layout/unlock_finger" + android:id="@+id/unlock_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="12dip" + /> + + <!-- footer --> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + > + + <!-- option 1: a single emergency call button --> + <RelativeLayout android:id="@+id/footerNormal" + android:layout_width="match_parent" + android:layout_height="match_parent" + > + <Button android:id="@+id/emergencyCallAlone" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:text="@string/lockscreen_emergency_call" + style="@style/Widget.Button.Transparent" + android:drawableLeft="@drawable/ic_emergency" + android:drawablePadding="8dip" + /> + + </RelativeLayout> + + <!-- option 2: an emergency call button, and a 'forgot pattern?' button --> + <LinearLayout android:id="@+id/footerForgotPattern" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + > + <Button android:id="@+id/emergencyCallTogether" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1.0" + android:layout_marginTop="4dip" + android:layout_marginBottom="4dip" + android:layout_marginLeft="4dip" + android:layout_marginRight="2dip" + android:text="@string/lockscreen_emergency_call" + style="@style/Widget.Button.Transparent" + android:drawableLeft="@drawable/ic_emergency" + android:drawablePadding="8dip" + /> + <Button android:id="@+id/forgotPattern" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1.0" + android:layout_marginTop="4dip" + android:layout_marginBottom="4dip" + android:layout_marginLeft="2dip" + android:layout_marginRight="4dip" + style="@style/Widget.Button.Transparent" + android:visibility="invisible" + /> + </LinearLayout> + + </FrameLayout> + +</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> diff --git a/core/res/res/layout/unlock_finger.xml b/core/res/res/layout/unlock_finger.xml new file mode 100644 index 0000000..f3a74f6 --- /dev/null +++ b/core/res/res/layout/unlock_finger.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License") +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="8dip" + android:paddingBottom="8dip" + android:gravity="left" + > + <LinearLayout + android:id="@+id/userPrompt" + android:orientation="horizontal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + > + <ImageView + android:src="@drawable/ic_lock_lock" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + /> + <TextView + android:id="@+id/usageMessage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="8dip" + /> + </LinearLayout> + + <TextView + android:id="@+id/errorMessage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:paddingTop="2dip" + android:paddingBottom="2dip" + /> + + <ImageView + android:src="@drawable/cmfp" + android:paddingLeft="1dip" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + /> + +</LinearLayout> diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml index 4a359eb..edd46d9 100644 --- a/core/res/res/values-es/strings.xml +++ b/core/res/res/values-es/strings.xml @@ -957,4 +957,20 @@ <!-- Description of an application permission that lets lets an application view/edit revoked permissions. --> <string name="permdesc_revokePermissions">Permitir ver y editar los permisos revocados a las aplicaciones. No utilizar para aplicaciones normales.</string> + <string name="keyguard_finger_please_swipe">Pase el dedo sobre el sensor para desbloquear</string> + <string name="keyguard_finger_ui_timeout">La IU ha superado el tiempo de espera</string> + <string name="keyguard_finger_failed_to_unlock">No se ha podido desbloquear</string> + <string name="keyguard_finger_screen_off">Pantalla apagada</string> + <string name="keyguard_finger_screen_on">Pantalla encendida</string> + <string name="keyguard_finger_match">El dedo coincide, desbloqueando la pantalla...</string> + <string name="keyguard_finger_not_match">El dedo no coincide...</string> + <string name="keyguard_finger_swipe_too_far_right">Pase el dedo por el centro.</string> + <string name="keyguard_finger_swipe_too_far_left">Pase el dedo por el centro.</string> + <string name="keyguard_finger_swipe_too_fast">Pase demasiado rápido.</string> + <string name="keyguard_finger_swipe_too_short">Pase demasiado corto.</string> + <string name="keyguard_finger_swipe_too_slow">Pase demasiado lento.</string> + <string name="keyguard_finger_swipe_too_skewed">Pase demasiado fraccionado.</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">La huella dactilar ha dado error al identificarle %1$d veces. \n\nVuelva a intentarlo en %2$d segundos. </string> + <string name="lockscreen_failed_fingers_almost_glogin">La huella dactilar ha dado error al identificarle %1$d veces. Tras %2$d identificaciones correctas más, se le pedirá que desbloquee el teléfono mediante el inicio de sesión de Google.\n\n Vuelva a intentarlo en %3$d segundos. </string> + <string name="lockscreen_forgot_finger_button_text">¿Ha olvidado el dedo?</string> </resources> diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml index afd887c..acbf696 100644 --- a/core/res/res/values-fr/strings.xml +++ b/core/res/res/values-fr/strings.xml @@ -943,4 +943,21 @@ <item quantity="one">%d seconde restante</item> <item quantity="other">%d secondes restantes</item> </plurals> + + <string name="keyguard_finger_please_swipe">Passez le doigt sur le capteur pour déverrouiller</string> + <string name="keyguard_finger_ui_timeout">Délai d\'attente de l\'interface utilisateur !</string> + <string name="keyguard_finger_failed_to_unlock">Échec du déverrouillage !</string> + <string name="keyguard_finger_screen_off">Écran désactivé</string> + <string name="keyguard_finger_screen_on">Écran activé</string> + <string name="keyguard_finger_match">Le doigt correspond, déverrouillage de l\'écran...</string> + <string name="keyguard_finger_not_match">Le doigt ne correspond pas...</string> + <string name="keyguard_finger_swipe_too_far_right">Faites glisser le doigt au centre.</string> + <string name="keyguard_finger_swipe_too_far_left">Faites glisser le doigt au centre.</string> + <string name="keyguard_finger_swipe_too_fast">Vous avez fait glisser votre doigt trop rapidement.</string> + <string name="keyguard_finger_swipe_too_short">La distance sur laquelle vous avez fait glisser votre doigt est trop courte.</string> + <string name="keyguard_finger_swipe_too_slow">Vous avez fait glisser votre doigt trop lentement.</string> + <string name="keyguard_finger_swipe_too_skewed">Vous avez fait glisser votre doigt de travers.</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">L\'identification avec votre empreinte digitale à échoué %1$d fois.\n\nVeuillez réessayer dans %2$d secondes.</string> + <string name="lockscreen_failed_fingers_almost_glogin">L\'identification avec votre empreinte digitale à échoué %1$d fois. Après %2$d autres échecs d\'identification, il vous sera demandé de déverrouiller votre téléphone à l\'aide de votre connexion Google.\n\n Veuillez réessayer dans %3$d secondes.</string> + <string name="lockscreen_forgot_finger_button_text">Vous ne vous souvenez plus du doigt utilisé ?</string> </resources> diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml index 1c64dac..0e846ca 100644 --- a/core/res/res/values-ja/strings.xml +++ b/core/res/res/values-ja/strings.xml @@ -978,4 +978,20 @@ <!-- Description of an application permission that lets lets an application view/edit revoked permissions. --> <string name="permdesc_revokePermissions">取り消された権限を読み書きする。通常のアプリケーションでは不要です。</string> + <string name="keyguard_finger_please_swipe">ロックを解除するには指をセンサー上で滑らせてください</string> + <string name="keyguard_finger_ui_timeout">UI がタイムアウトしました!</string> + <string name="keyguard_finger_failed_to_unlock">ロックを解除できませんでした!</string> + <string name="keyguard_finger_screen_off">画面オフ</string> + <string name="keyguard_finger_screen_on">画面オン</string> + <string name="keyguard_finger_match">指が一致しました。画面のロックを解除しています...</string> + <string name="keyguard_finger_not_match">指が一致しませんでした...</string> + <string name="keyguard_finger_swipe_too_far_right">中央で指を滑らせてください。</string> + <string name="keyguard_finger_swipe_too_far_left">中央で指を滑らせてください。</string> + <string name="keyguard_finger_swipe_too_fast">滑らせ方が速すぎます。</string> + <string name="keyguard_finger_swipe_too_short">滑らせる距離が短すぎます。</string> + <string name="keyguard_finger_swipe_too_slow">滑らせ方が遅すぎます。</string> + <string name="keyguard_finger_swipe_too_skewed">滑らせ方が傾きすぎです。</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">指紋の識別に %1$d 回失敗しました。\n\n%2$d 秒後に再試行してください。</string> + <string name="lockscreen_failed_fingers_almost_glogin">指紋の識別に %1$d 回失敗しました。識別にあと %2$d 回失敗すると、Google サインインを使用して電話のロックを解除するように求められます。\n\n%3$d 秒後に再試行してください。</string> + <string name="lockscreen_forgot_finger_button_text">どの指かわからなくなった場合</string> </resources> diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml new file mode 100644 index 0000000..6e93e15 --- /dev/null +++ b/core/res/res/values-pt-rBR/strings.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- THIS FILE WAS AUTO-GENERATED, MANUAL MODIFICATIONS WILL BE LOST! --> +<!-- resource category: keyguard --> +<!-- file generated at 05:10:05 on 2011/08/12--> +<resources> + <string name="keyguard_finger_please_swipe">Deslize o dedo sobre o sensor para desbloquear</string> + <string name="keyguard_finger_ui_timeout">O tempo limite da interface do usuário expirou!</string> + <string name="keyguard_finger_failed_to_unlock">Falha ao desbloquear!</string> + <string name="keyguard_finger_screen_off">Tela apagada</string> + <string name="keyguard_finger_screen_on">Tela acesa</string> + <string name="keyguard_finger_match">Correspondência encontrada para o dedo. Desbloqueando tela...</string> + <string name="keyguard_finger_not_match">Nenhuma correspondência encontrada para o dedo...</string> + <string name="keyguard_finger_swipe_too_far_right">Deslize o dedo pelo centro.</string> + <string name="keyguard_finger_swipe_too_far_left">Deslize o dedo pelo centro.</string> + <string name="keyguard_finger_swipe_too_fast">Movimento rápido demais.</string> + <string name="keyguard_finger_swipe_too_short">Movimento curto demais.</string> + <string name="keyguard_finger_swipe_too_slow">Movimento lento demais.</string> + <string name="keyguard_finger_swipe_too_skewed">Movimento inclinado demais.</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">Sua impressão digital não identificou você %1$d vezes.\n\nTente novamente em %2$d segundos.</string> + <string name="lockscreen_failed_fingers_almost_glogin">Sua impressão digital não identificou você %1$d vezes. Depois de mais %2$d identificação(ões) malsucedida(s), você será solicitado a desbloquear o telefone usando seu logon do Google.\n\n Tente novamente em %3$d segundos.</string> + <string name="lockscreen_forgot_finger_button_text">Esqueceu o dedo?</string> +</resources> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index 2c66101..0e988e7 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -954,4 +954,21 @@ <item quantity="one">还剩 %d 秒</item> <item quantity="other">还剩 %d 秒</item> </plurals> + + <string name="keyguard_finger_please_swipe">将手指滑过传感器以解锁</string> + <string name="keyguard_finger_ui_timeout">UI 超时!</string> + <string name="keyguard_finger_failed_to_unlock">无法解锁!</string> + <string name="keyguard_finger_screen_off">屏幕关闭</string> + <string name="keyguard_finger_screen_on">屏幕打开</string> + <string name="keyguard_finger_match">手指吻合,解锁屏幕...</string> + <string name="keyguard_finger_not_match">手指不吻合...</string> + <string name="keyguard_finger_swipe_too_far_right">在中心滑动。</string> + <string name="keyguard_finger_swipe_too_far_left">在中心滑动。</string> + <string name="keyguard_finger_swipe_too_fast">滑得太快。</string> + <string name="keyguard_finger_swipe_too_short">滑得太短。</string> + <string name="keyguard_finger_swipe_too_slow">滑得太慢。</string> + <string name="keyguard_finger_swipe_too_skewed">滑得太偏。</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">您的指纹识别已失败 %1$d 次。\n\n请在 %2$d 秒内重试。</string> + <string name="lockscreen_failed_fingers_almost_glogin">您的指纹识别已失败 %1$d 次。如果识别再失败 %2$d 次,系统将要求您使用 Google 登录来解锁您的电话。\n\n请在 %3$d 秒内重试。</string> + <string name="lockscreen_forgot_finger_button_text">忘记手指?</string> </resources> diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml index 8b851bf..2c85287 100644 --- a/core/res/res/values-zh-rTW/strings.xml +++ b/core/res/res/values-zh-rTW/strings.xml @@ -2230,4 +2230,20 @@ <!-- Description of an application permission that lets lets an application view/edit revoked permissions. --> <string name="permdesc_revokePermissions">允許讀取及寫入被撤消的權限。不應使用於正常的應用程式。</string> + <string name="keyguard_finger_please_swipe">在感應器上劃一下手指以解除鎖定</string> + <string name="keyguard_finger_ui_timeout">UI 逾時!</string> + <string name="keyguard_finger_failed_to_unlock">無法解除鎖定!</string> + <string name="keyguard_finger_screen_off">螢幕關閉</string> + <string name="keyguard_finger_screen_on">螢幕開啟</string> + <string name="keyguard_finger_match">手指符合,解除鎖定螢幕...</string> + <string name="keyguard_finger_not_match">手指不符合...</string> + <string name="keyguard_finger_swipe_too_far_right">在中心位置劃一下。</string> + <string name="keyguard_finger_swipe_too_far_left">在中心位置劃一下。</string> + <string name="keyguard_finger_swipe_too_fast">劃太快。</string> + <string name="keyguard_finger_swipe_too_short">劃太短。</string> + <string name="keyguard_finger_swipe_too_slow">劃太慢。</string> + <string name="keyguard_finger_swipe_too_skewed">劃太歪。</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">您的指紋無法識別您的身分達 %1$d 次。\n\n請在 %2$d 秒內再試一次。</string> + <string name="lockscreen_failed_fingers_almost_glogin">您的指紋無法識別您的身分達 %1$d 次。如果識別再失敗 %2$d 次,系統將要求您使用 Google 登入資訊來解除鎖定您的電話。\n\n請在 %3$d 秒內再試一次。</string> + <string name="lockscreen_forgot_finger_button_text">忘記手指?</string> </resources> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 6d5c256..07de23c 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -636,4 +636,7 @@ -SourcePortDestPort-SourcePortDestPort-OMADM PDU If false, not supported. --> <bool name="config_duplicate_port_omadm_wappush">false</bool> + + <!-- Location of the Authentec framework jar --> + <string name="config_authentecJarLocation"></string> </resources> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index e91d0d2..ed94087 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2471,4 +2471,20 @@ <!-- Description of an application permission that lets lets an application view/edit revoked permissions. --> <string name="permdesc_revokePermissions">Allows read and write for revoked permissions. Not for use by normal applications.</string> + <string name="keyguard_finger_please_swipe">Swipe finger over sensor to unlock</string> + <string name="keyguard_finger_ui_timeout">UI timeout!</string> + <string name="keyguard_finger_failed_to_unlock">Failed to unlock!</string> + <string name="keyguard_finger_screen_off">Screen off</string> + <string name="keyguard_finger_screen_on">Screen on</string> + <string name="keyguard_finger_match">Finger match, unlock screen...</string> + <string name="keyguard_finger_not_match">Finger did not match...</string> + <string name="keyguard_finger_swipe_too_far_right">Swipe in the center.</string> + <string name="keyguard_finger_swipe_too_far_left">Swipe in the center.</string> + <string name="keyguard_finger_swipe_too_fast">Swipe was too fast.</string> + <string name="keyguard_finger_swipe_too_short">Swipe was too short.</string> + <string name="keyguard_finger_swipe_too_slow">Swipe was too slow.</string> + <string name="keyguard_finger_swipe_too_skewed">Swipe was too skewed.</string> + <string name="lockscreen_too_many_failed_fingers_dialog_message">Your fingerprint failed to identify you %1$d times.\n\nPlease try again in %2$d seconds.</string> + <string name="lockscreen_failed_fingers_almost_glogin">Your fingerprint failed to identify you %1$d times. After %2$d more unsuccessful identifications, you will be asked to unlock your phone using your Google sign-in.\n\n Please try again in %3$d seconds.</string> + <string name="lockscreen_forgot_finger_button_text">Forgot finger?</string> </resources> diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 42e4318..2e44437 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -272,6 +272,7 @@ public class LocationManager { return provider; } + /** @hide */ public void setGPSSource(String device) { try { mService.setGPSSource(device); diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java index 863039c..40aeb91 100644 --- a/media/java/android/media/CamcorderProfile.java +++ b/media/java/android/media/CamcorderProfile.java @@ -56,7 +56,9 @@ public class CamcorderProfile */ public static final int QUALITY_LOW = 0; public static final int QUALITY_HIGH = 1; + /** @hide */ public static final int QUALITY_HD = 2; + /** @hide */ public static final int QUALITY_WIDE = 3; /** diff --git a/media/java/android/media/EncoderCapabilities.java b/media/java/android/media/EncoderCapabilities.java index 1f285bb..71cb1b3 100644 --- a/media/java/android/media/EncoderCapabilities.java +++ b/media/java/android/media/EncoderCapabilities.java @@ -24,6 +24,7 @@ import android.util.Log; * The EncoderCapabilities class is used to retrieve the * capabilities for different video and audio * encoders supported on a specific Android platform. + * {@hide} */ public class EncoderCapabilities { diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 9215d4f..3d7cd41 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -288,6 +288,7 @@ public class MediaRecorder public native void setVideoSource(int video_source) throws IllegalStateException; + /** @hide */ public native void setCameraParameters(String params) throws IllegalStateException; diff --git a/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java b/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java new file mode 100644 index 0000000..d658280 --- /dev/null +++ b/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java @@ -0,0 +1,1402 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.policy.impl; + +import dalvik.system.DexClassLoader; + +import android.content.Context; +import android.content.ContextWrapper; +import android.content.res.Configuration; +import android.content.res.Resources; +import android.os.CountDownTimer; +import android.os.SystemClock; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.MotionEvent; +import android.widget.Button; +import android.widget.TextView; +import android.text.format.DateFormat; +import android.text.TextUtils; +import android.util.Log; +import com.android.internal.R; +import com.android.internal.telephony.IccCard; +import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient; +import com.android.internal.widget.LockPatternUtils; +import com.android.internal.widget.LockPatternView; +import com.android.internal.widget.LockPatternView.Cell; + +import java.util.List; +import java.util.Date; + +// For the finger keyguard +import android.os.Handler; +import android.os.Vibrator; +import android.os.PowerManager; +import android.os.Message; +import android.os.SystemProperties; + +import com.authentec.AuthentecHelper; +import com.authentec.GfxEngineRelayService; + + +/** + * This is the screen that shows the 9 circle unlock widget and instructs + * the user how to unlock their device, or make an emergency call. + */ +class FingerUnlockScreen extends LinearLayoutWithDefaultTouchRecepient + implements KeyguardScreen, KeyguardUpdateMonitor.InfoCallback, + KeyguardUpdateMonitor.SimStateCallback, + GfxEngineRelayService.Receiver { + + private static final boolean DEBUG = true; + private static final boolean DEBUG_CONFIGURATION = true; + private static final String TAG = "FingerUnlockScreen"; + + // how long we stay awake once the user is ready to enter a pattern + private static final int UNLOCK_FINGER_WAKE_INTERVAL_MS = 7000; + + private int mFailedPatternAttemptsSinceLastTimeout = 0; + private int mTotalFailedPatternAttempts = 0; + private CountDownTimer mCountdownTimer = null; + + private CountDownTimer mCountdownTimerToast = null; + private final LockPatternUtils mLockPatternUtils; + private final KeyguardUpdateMonitor mUpdateMonitor; + private final KeyguardScreenCallback mCallback; + + /** + * whether there is a fallback option available when the pattern is forgotten. + */ + private boolean mEnableFallback; + + private static boolean m_bVerifyied; + + // Do we still hold a wakelock? + // Initialize this value to "true" since the screen is off at the very beginning. + private static boolean m_bPaused = true; + + // The key guard would be put into lockout state every four bad swipes. + private static boolean m_bAttemptLockout; + + // A flag to indicate if you are currently connected to the GfxEngine or not. + private boolean m_bGfxEngineAttached; + + // A flag to indicate that there is a delayed #cancel command to send. + private boolean m_bSendDelayedCancel; + + // Make sure that you do not double-cancel. + private boolean m_bCancelHasBeenSent; + + // A flag to indicate that there is a successive power on to the previous power off. + // If the previous #cancel command has not terminate the verify runner yet, set this + // flag to let the verify runner start again. + private boolean m_bStartAgain; + + // Below four are related with tactile feedback... + // A flag to indicate if tactile feedback is supported. + private boolean mTactileFeedbackEnabled = false; + // Vibrator pattern for creating a tactile bump + private static final long[] DEFAULT_VIBE_PATTERN = {0, 1, 40, 41}; + // Vibrator for creating tactile feedback + private Vibrator vibe; + // Vibration pattern, either default or customized + private long[] mVibePattern; + + private String mDateFormatString; + + private TextView mCarrier; + private TextView mDate; + + // are we showing battery information? + private boolean mShowingBatteryInfo = false; + + // last known plugged in state + private boolean mPluggedIn = false; + + // last known battery level + private int mBatteryLevel = 100; + + private String mNextAlarm = null; + + private String mInstructions = null; + private TextView mStatus1; + private TextView mStatusSep; + private TextView mStatus2; + private TextView mUserPrompt; + private TextView mErrorPrompt; + + private ViewGroup mFooterNormal; + private ViewGroup mFooterForgotPattern; + + /** + * Keeps track of the last time we poked the wake lock during dispatching + * of the touch event, initalized to something gauranteed to make us + * poke it when the user starts drawing the pattern. + * @see #dispatchTouchEvent(android.view.MotionEvent) + */ + private long mLastPokeTime = -UNLOCK_FINGER_WAKE_INTERVAL_MS; + + /** + * Useful for clearing out the wrong pattern after a delay + */ + private Runnable mCancelPatternRunnable = new Runnable() { + public void run() { + //mLockPatternView.clearPattern(); + } + }; + + private Button mForgotPatternButton; + private Button mEmergencyAlone; + private Button mEmergencyTogether; + private int mCreationOrientation; + + static Thread mExecutionThread = null; + private Thread mUiThread; + private boolean mbFeedbackDelivered = false; + private VerifyRunner mVerifyRunner = new VerifyRunner(); + private Context m_Context; + + /** High level access to the power manager for WakeLocks */ + private PowerManager mPM; + + /** + * Used to keep the device awake while the keyguard is showing, i.e for + * calls to {@link #pokeWakelock()} + * Note: Unlike the mWakeLock in KeyguardViewMediator (which has the + * ACQUIRE_CAUSES_WAKEUP flag), this one doesn't actually turn + * on the illumination. Instead, they cause the illumination to + * remain on once it turns on. + */ + private PowerManager.WakeLock mWakeLock; + + /** + * Does not turn on screen, used to keep the device awake until the + * fingerprint verification is ready. The KeyguardViewMediator only + * poke the wake lock for 5 seconds, which is not enough for the + * initialization of the fingerprint verification. + */ + private PowerManager.WakeLock mHandOffWakeLock; + + private int mWakelockSequence; + + // used for handler messages + private static final int TIMEOUT = 1; + + enum FooterMode { + Normal, + ForgotLockPattern, + VerifyUnlocked + } + + private void updateFooter(FooterMode mode) { + switch (mode) { + case Normal: + mFooterNormal.setVisibility(View.VISIBLE); + mFooterForgotPattern.setVisibility(View.GONE); + break; + case ForgotLockPattern: + mFooterNormal.setVisibility(View.GONE); + mFooterForgotPattern.setVisibility(View.VISIBLE); + mForgotPatternButton.setVisibility(View.VISIBLE); + break; + case VerifyUnlocked: + mFooterNormal.setVisibility(View.GONE); + mFooterForgotPattern.setVisibility(View.GONE); + } + } + + private AuthentecHelper fingerhelper = null; + + /** + * @param context The context. + * @param lockPatternUtils Used to lookup lock pattern settings. + * @param updateMonitor Used to lookup state affecting keyguard. + * @param callback Used to notify the manager when we're done, etc. + * @param totalFailedAttempts The current number of failed attempts. + * @param enableFallback True if a backup unlock option is available when the user has forgotten + * their pattern (e.g they have a google account so we can show them the account based + * backup option). + */ + FingerUnlockScreen(Context context, + Configuration configuration, + LockPatternUtils LockPatternUtils, + KeyguardUpdateMonitor updateMonitor, + KeyguardScreenCallback callback, + int totalFailedAttempts) { + super(context); + + fingerhelper = AuthentecHelper.getInstance(context); + + m_Context = context; + + /* goToSleep of PowerManagerService class would cancel all of the wake locks. */ + mPM = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + mWakeLock = mPM.newWakeLock( + PowerManager.FULL_WAKE_LOCK, + "FpKeyguard"); + mWakeLock.setReferenceCounted(false); + mHandOffWakeLock = mPM.newWakeLock( + PowerManager.FULL_WAKE_LOCK, + "FpKeyguardHandOff"); + mHandOffWakeLock.setReferenceCounted(false); + + mLockPatternUtils = LockPatternUtils; + mUpdateMonitor = updateMonitor; + mCallback = callback; + mTotalFailedPatternAttempts = totalFailedAttempts; + mFailedPatternAttemptsSinceLastTimeout = + totalFailedAttempts % mLockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT; + + if (DEBUG) Log.d(TAG, + "UnlockScreen() ctor: totalFailedAttempts=" + + totalFailedAttempts + ", mFailedPat...=" + + mFailedPatternAttemptsSinceLastTimeout + ); + + m_bVerifyied = false; + m_bAttemptLockout = false; + + m_bGfxEngineAttached = false; + m_bSendDelayedCancel = false; + m_bCancelHasBeenSent = false; + m_bStartAgain = false; + + mTactileFeedbackEnabled = mLockPatternUtils.isTactileFeedbackEnabled(); + if (mTactileFeedbackEnabled) { + if (DEBUG) Log.d(TAG, "Create a vibrator"); + vibe = new Vibrator(); + } + + mCreationOrientation = configuration.orientation; + + LayoutInflater inflater = LayoutInflater.from(context); + if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) { + if (DEBUG) Log.d(TAG, "UnlockScreen() : portrait"); + inflater.inflate(R.layout.keyguard_screen_finger_portrait, this, true); + } else { + if (DEBUG) Log.d(TAG, "UnlockScreen() : landscape"); + inflater.inflate(R.layout.keyguard_screen_finger_landscape, this, true); + } + + mCarrier = (TextView) findViewById(R.id.carrier); + mDate = (TextView) findViewById(R.id.date); + + mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year); + refreshTimeAndDateDisplay(); + + mStatus1 = (TextView) findViewById(R.id.status1); + mStatusSep = (TextView) findViewById(R.id.statusSep); + mStatus2 = (TextView) findViewById(R.id.status2); + + resetStatusInfo(); + + mUserPrompt = (TextView) findViewById(R.id.usageMessage); + // Temporary hints for the emulator. + mUserPrompt.setText(R.string.keyguard_finger_screen_off); + mErrorPrompt = (TextView) findViewById(R.id.errorMessage); + + mFooterNormal = (ViewGroup) findViewById(R.id.footerNormal); + mFooterForgotPattern = (ViewGroup) findViewById(R.id.footerForgotPattern); + + mUiThread = Thread.currentThread(); + GfxEngineRelayService.setLocalReceiver(this); + + // emergency call buttons + final OnClickListener emergencyClick = new OnClickListener() { + public void onClick(View v) { + // Cancel the Verify thread. + mUserPrompt.setText(""); + if (mExecutionThread != null && mExecutionThread.isAlive()) { + if (!m_bGfxEngineAttached) { + if (DEBUG) Log.d(TAG,"emergencyClick send cancel delayed"); + m_bSendDelayedCancel = true; + } else { + if (DEBUG) Log.d(TAG,"emergencyClick send cancel"); + if (!m_bCancelHasBeenSent) + { + GfxEngineRelayService.queueEvent("#cancel"); + m_bCancelHasBeenSent = true; + } + } + } + mCallback.takeEmergencyCallAction(); + } + }; + + mEmergencyAlone = (Button) findViewById(R.id.emergencyCallAlone); + mEmergencyAlone.setFocusable(false); // touch only! + mEmergencyAlone.setOnClickListener(emergencyClick); + mEmergencyTogether = (Button) findViewById(R.id.emergencyCallTogether); + mEmergencyTogether.setFocusable(false); + mEmergencyTogether.setOnClickListener(emergencyClick); + refreshEmergencyButtonText(); + + mForgotPatternButton = (Button) findViewById(R.id.forgotPattern); + mForgotPatternButton.setText(R.string.lockscreen_forgot_finger_button_text); + mForgotPatternButton.setOnClickListener(new OnClickListener() { + + public void onClick(View v) { + mCallback.forgotPattern(true); + } + }); + + if (mTactileFeedbackEnabled) { + // allow vibration pattern to be customized + if (DEBUG) Log.d(TAG, "Load vibration pattern"); + mVibePattern = loadVibratePattern(com.android.internal.R.array.config_virtualKeyVibePattern); + } + + // assume normal footer mode for now + updateFooter(FooterMode.Normal); + + updateMonitor.registerInfoCallback(this); + updateMonitor.registerSimStateCallback(this); + setFocusableInTouchMode(true); + + // Required to get Marquee to work. + mCarrier.setSelected(true); + mCarrier.setTextColor(0xffffffff); + + // until we get an update... + mCarrier.setText( + LockScreen.getCarrierString( + mUpdateMonitor.getTelephonyPlmn(), + mUpdateMonitor.getTelephonySpn())); + } + + private void refreshEmergencyButtonText() { + mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyAlone); + mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyTogether); + } + + public void setEnableFallback(boolean state) { + if (DEBUG) Log.d(TAG, "setEnableFallback(" + state + ")"); + mEnableFallback = state; + } + + private void resetStatusInfo() { + mInstructions = null; + mShowingBatteryInfo = mUpdateMonitor.shouldShowBatteryInfo(); + mPluggedIn = mUpdateMonitor.isDevicePluggedIn(); + mBatteryLevel = mUpdateMonitor.getBatteryLevel(); + mNextAlarm = mLockPatternUtils.getNextAlarm(); + updateStatusLines(); + } + + private void updateStatusLines() { + if (mInstructions != null) { + // instructions only + if (DEBUG) Log.d(TAG,"instructions only"); + mStatus1.setText(mInstructions); + if (TextUtils.isEmpty(mInstructions)) { + mStatus1.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + } else { + mStatus1.setCompoundDrawablesWithIntrinsicBounds( + R.drawable.ic_lock_idle_lock, 0, 0, 0); + } + + mStatus1.setVisibility(View.VISIBLE); + mStatusSep.setVisibility(View.GONE); + mStatus2.setVisibility(View.GONE); + } else if (mShowingBatteryInfo && mNextAlarm == null) { + // battery only + if (DEBUG) Log.d(TAG,"battery only"); + if (mPluggedIn) { + if (mBatteryLevel >= 100) { + mStatus1.setText(getContext().getString(R.string.lockscreen_charged)); + } else { + mStatus1.setText(getContext().getString(R.string.lockscreen_plugged_in, mBatteryLevel)); + } + } else { + mStatus1.setText(getContext().getString(R.string.lockscreen_low_battery, mBatteryLevel)); + } + mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging, 0, 0, 0); + + mStatus1.setVisibility(View.VISIBLE); + mStatusSep.setVisibility(View.GONE); + mStatus2.setVisibility(View.GONE); + + } else if (mNextAlarm != null && !mShowingBatteryInfo) { + // alarm only + if (DEBUG) Log.d(TAG,"alarm only"); + mStatus1.setText(mNextAlarm); + mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0, 0, 0); + + mStatus1.setVisibility(View.VISIBLE); + mStatusSep.setVisibility(View.GONE); + mStatus2.setVisibility(View.GONE); + } else if (mNextAlarm != null && mShowingBatteryInfo) { + // both battery and next alarm + if (DEBUG) Log.d(TAG,"both battery and next alarm"); + mStatus1.setText(mNextAlarm); + mStatusSep.setText("|"); + mStatus2.setText(getContext().getString( + R.string.lockscreen_battery_short, + Math.min(100, mBatteryLevel))); + mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0, 0, 0); + if (mPluggedIn) { + mStatus2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging, 0, 0, 0); + } else { + mStatus2.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + } + + mStatus1.setVisibility(View.VISIBLE); + mStatusSep.setVisibility(View.VISIBLE); + mStatus2.setVisibility(View.VISIBLE); + } else { + // nothing specific to show; show general instructions + if (DEBUG) Log.d(TAG,"nothing specific to show"); + // "keyguard_finger_please_swipe" string would be showed when the TSM is ready. + //mStatus1.setText(R.string.lockscreen_pattern_instructions); + mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0, 0, 0); + + mStatus1.setVisibility(View.VISIBLE); + mStatusSep.setVisibility(View.GONE); + mStatus2.setVisibility(View.GONE); + } + } + + + private void refreshTimeAndDateDisplay() { + mDate.setText(DateFormat.format(mDateFormatString, new Date())); + } + + private long[] loadVibratePattern(int id) { + int[] pattern = null; + try { + pattern = getResources().getIntArray(id); + } catch (Resources.NotFoundException e) { + Log.e(TAG, "Vibrate pattern missing, using default", e); + } + if (pattern == null) { + return DEFAULT_VIBE_PATTERN; + } + + long[] tmpPattern = new long[pattern.length]; + for (int i = 0; i < pattern.length; i++) { + tmpPattern[i] = pattern[i]; + } + return tmpPattern; + } + + @Override + public boolean dispatchTouchEvent(MotionEvent ev) { + // as long as the user is entering a pattern (i.e sending a touch + // event that was handled by this screen), keep poking the + // wake lock so that the screen will stay on. + final boolean result = super.dispatchTouchEvent(ev); + if (result && + ((SystemClock.elapsedRealtime() - mLastPokeTime) + > (UNLOCK_FINGER_WAKE_INTERVAL_MS - 100))) { + mLastPokeTime = SystemClock.elapsedRealtime(); + } + return result; + } + + + // ---------- InfoCallback + + /** {@inheritDoc} */ + public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel) { + mShowingBatteryInfo = showBatteryInfo; + mPluggedIn = pluggedIn; + mBatteryLevel = batteryLevel; + updateStatusLines(); + } + + /** {@inheritDoc} */ + public void onTimeChanged() { + refreshTimeAndDateDisplay(); + } + + /** {@inheritDoc} */ + public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) { + mCarrier.setText(LockScreen.getCarrierString(plmn, spn)); + } + + /** {@inheritDoc} */ + public void onRingerModeChanged(int state) { + // not currently used + } + + // ---------- SimStateCallback + + /** {@inheritDoc} */ + public void onSimStateChanged(IccCard.State simState) { + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (DEBUG_CONFIGURATION) { + Log.v(TAG, "***** FINGERPRINT ATTACHED TO WINDOW"); + Log.v(TAG, "Cur orient=" + mCreationOrientation + + ", new config=" + getResources().getConfiguration()); + } + if (getResources().getConfiguration().orientation != mCreationOrientation) { + mCallback.recreateMe(getResources().getConfiguration()); + } + } + + + /** {@inheritDoc} */ + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + if (DEBUG_CONFIGURATION) { + Log.v(TAG, "***** FINGERPRINT CONFIGURATION CHANGED"); + Log.v(TAG, "Cur orient=" + mCreationOrientation + + ", new config=" + getResources().getConfiguration()); + } + if (newConfig.orientation != mCreationOrientation) { + if (DEBUG) Log.d(TAG,"Orientation changed, recreateMe"); + mCallback.recreateMe(newConfig); + } + } + + /** {@inheritDoc} */ + public void onKeyboardChange(boolean isKeyboardOpen) {} + + /** {@inheritDoc} */ + public boolean needsInput() { + return false; + } + + /** {@inheritDoc} */ + public void onPause() { + if (DEBUG) Log.d(TAG,"onPause"); + + // Temporary hints for the emulator. + mUserPrompt.setText(R.string.keyguard_finger_screen_off); + mErrorPrompt.setText(""); + + if (mWakeLock.isHeld()) { + /* Must release since it is a screen lock. */ + mHandler.removeMessages(TIMEOUT); + mWakeLock.release(); + } + + if (mHandOffWakeLock.isHeld()) { + /* Must release since it is a screen lock. */ + mHandOffWakeLock.release(); + } + + m_bVerifyied = false; + m_bPaused = true; + m_bStartAgain = false; + if (mCountdownTimer != null) { + mCountdownTimer.cancel(); + mCountdownTimer = null; + } + if (mCountdownTimerToast != null) { + mCountdownTimerToast.cancel(); + mCountdownTimerToast = null; + } + if (mExecutionThread != null && mExecutionThread.isAlive()) { + if (!m_bGfxEngineAttached) { + if (DEBUG) Log.d(TAG,"onPause send cancel delayed"); + m_bSendDelayedCancel = true; + } else { + if (DEBUG) Log.d(TAG,"onPause send cancel"); + if (!m_bCancelHasBeenSent) + { + GfxEngineRelayService.queueEvent("#cancel"); + m_bCancelHasBeenSent = true; + } + } + } + } + + private void resumeViews() { + if ((mExecutionThread!=null)&&(mExecutionThread.isAlive())) { + if (DEBUG) Log.d(TAG,"resumeViews: Thread in execution"); + return; + } + + if (!mLockPatternUtils.savedFingerExists()) { + if (DEBUG) Log.d(TAG,"resumeViews: No saved finger"); + // By design, this situation should never happen. + // If finger lock is in use, we should only allow the finger settings menu + // to delete all enrolled fingers. Other applications, like TSMDemo, should + // not get access to the database. + // + // Simply disable the finger lock and exit. + mLockPatternUtils.setLockFingerEnabled(false); + return; + } + + // reset header + resetStatusInfo(); + if (DEBUG) Log.d(TAG,"resumeViews: m_bVerifyied=" + m_bVerifyied); + + // show "forgot pattern?" button if we have an alternate authentication method + mForgotPatternButton.setVisibility(View.INVISIBLE); + + // if the user is currently locked out, enforce it. + long deadline = mLockPatternUtils.getLockoutAttemptDeadline(); + if (deadline != 0) { + if (DEBUG) Log.d(TAG,"resumeViews: In lockout state"); + handleAttemptLockout(deadline); + } else { + // The onFinish() method of the CountDownTimer object would not be + // called when the screen is off. So we need to reset the m_bAttemptLockout + // if the lockout has finished. + m_bAttemptLockout = false; + } + + // the footer depends on how many total attempts the user has failed + if (mCallback.isVerifyUnlockOnly()) { + updateFooter(FooterMode.VerifyUnlocked); + } else if (mEnableFallback && + (mTotalFailedPatternAttempts >= mLockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { + updateFooter(FooterMode.ForgotLockPattern); + } else { + updateFooter(FooterMode.Normal); + } + + refreshEmergencyButtonText(); + } + + /** {@inheritDoc} */ + public void onResume() { + // Resume the finger unlock screen. + resumeViews(); + + // Launch a TSM Verify thread when the screen is turned on. + if (mPM.isScreenOn()) { + onScreenOn(); + } + } + + private void onScreenOn() { + if (DEBUG) Log.d(TAG,"onScreenOn()"); + + m_bPaused = false; + if (m_bSendDelayedCancel) { + /* If "cancel" has not been sent out, simply ignore it. */ + m_bSendDelayedCancel = false; + } + + /* Thread in execution, no need to create & start again. */ + if ((mExecutionThread!=null)&&(mExecutionThread.isAlive())) { + if (DEBUG) Log.d(TAG,"onScreenOn: Thread in execution"); + if (m_bCancelHasBeenSent) { + /* If "cancel" has been sent, set this flag to indicate the verify runner to start again. */ + m_bStartAgain = true; + } + return; + } + + // Temporary hints for the emulator. + mUserPrompt.setText(R.string.keyguard_finger_screen_on); + + if (mLockPatternUtils.isLockFingerEnabled()&&!m_bVerifyied) { + /** + * acquire the handoff lock that will keep the cpu running. this will + * be released once the fingerprint keyguard has set the verification up + * and poked the mWakelock of itself (not the one of the KeyguradViewMediator). + */ + mHandOffWakeLock.acquire(); + + // Create a thread for verification. + mExecutionThread = new Thread(mVerifyRunner); + + // Only start the verification when the screen is not in lockout state. + if (!m_bAttemptLockout) + { + mExecutionThread.start(); + } + else + { + // Release the wakelock early if the screen is in lockout state now. + pokeWakelock(1000); + } + } + } + + /** {@inheritDoc} */ + public void cleanUp() { + if (mExecutionThread != null && mExecutionThread.isAlive()) { + if (!m_bGfxEngineAttached) { + if (DEBUG) Log.d(TAG,"cleanUp send cancel delayed"); + m_bSendDelayedCancel = true; + } else { + if (DEBUG) Log.d(TAG,"cleanUp send cancel"); + if (!m_bCancelHasBeenSent) + { + GfxEngineRelayService.queueEvent("#cancel"); + m_bCancelHasBeenSent = true; + } + } + } + + // must make sure that the verify runner has terminated. + while (mExecutionThread != null && mExecutionThread.isAlive()) { + try { + // Set a flag to indicate the verify runner to terminate itself. + m_bPaused = true; + mUiThread.sleep(50); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + mUpdateMonitor.removeCallback(this); + } + + @Override + public void onWindowFocusChanged(boolean hasWindowFocus) { + super.onWindowFocusChanged(hasWindowFocus); + if (hasWindowFocus) { + // when timeout dialog closes we want to update our state + //onResume(); + if (DEBUG) Log.d(TAG,"onWindowFocusChanged"); + resumeViews(); + + // Start the verification if screen is on. + if (mPM.isScreenOn()) { + if ( (!m_bAttemptLockout) && (!m_bPaused) && + (mExecutionThread != null) && (!(mExecutionThread.isAlive())) ) + { + if (DEBUG) Log.d(TAG,"Screen is on, start LAP verification"); + /** + * acquire the handoff lock that will keep the cpu running. this will + * be released once the fingerprint keyguard has set the verification up + * and poked the mWakelock of itself (not the one of the KeyguradViewMediator). + */ + mHandOffWakeLock.acquire(); + + if (mExecutionThread.getState() == Thread.State.TERMINATED) + { + // If the thread state is TERMINATED, it cannot be start() again. + // Create a thread for verification. + mExecutionThread = new Thread(mVerifyRunner); + mExecutionThread.start(); + } + else + { + if (DEBUG) Log.d(TAG,"Verify thread exists, just start it"); + mExecutionThread.start(); + } + } + } + } + } + + public final void runOnUiThread(Runnable action) { + if (Thread.currentThread() != mUiThread) { + mHandler .post(action); + } else { + action.run(); + } + } + + private void pokeWakelock(int holdMs) { + synchronized (this) { + if (DEBUG) Log.d(TAG, "pokeWakelock(" + holdMs + ")"); + mWakeLock.acquire(); + mHandler.removeMessages(TIMEOUT); + mWakelockSequence++; + Message msg = mHandler.obtainMessage(TIMEOUT, mWakelockSequence, 0); + mHandler.sendMessageDelayed(msg, holdMs); + } + + if (mHandOffWakeLock.isHeld()) { + /** + * The fingerprint keyguard has been set up, and has poked the keyguard + * main wake lock. It's time to release the handoff wake lock. + */ + mHandOffWakeLock.release(); + } + } + + /** + * This handler will be associated with the policy thread, which will also + * be the UI thread of the keyguard. Since the apis of the policy, and therefore + * this class, can be called by other threads, any action that directly + * interacts with the keyguard ui should be posted to this handler, rather + * than called directly. + */ + private Handler mHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case TIMEOUT: + handleTimeout(msg.arg1); + return ; + } + } + }; + + /** + * Handles the message sent by {@link #pokeWakelock} + * @param seq used to determine if anything has changed since the message + * was sent. + * @see #TIMEOUT + */ + private void handleTimeout(int seq) { + synchronized (this) { + if (DEBUG) Log.d(TAG, "handleTimeout"); + if (seq == mWakelockSequence) { + mWakeLock.release(); + } + } + } + + /** + * Provides a Runnable class to handle the finger + * verification + */ + private class VerifyRunner implements Runnable { + public void run() { + int iResult = 0; + boolean bRetryAfterLockout = false; + + m_bVerifyied = false; + + // A trick to dismiss the timeout dialog. + mCallback.isVerifyUnlockOnly(); + + try { + while (true) { + if (m_bPaused) { + if (DEBUG) Log.d(TAG,"VerifyRunner: paused before the verify() call."); + /* Do not call the verify interface if the "cancel" comes before it starts. */ + if (AuthentecHelper.eAM_STATUS_OK == iResult) { + /* The result should never be eAM_STATUS_OK. */ + iResult = AuthentecHelper.eAM_STATUS_USER_CANCELED; + } + break; + } + + iResult = fingerhelper.verifyPolicy(m_Context); + + if (DEBUG) Log.d(TAG,"Verify result=" + iResult); + if (AuthentecHelper.eAM_STATUS_CREDENTIAL_LOCKED == iResult) { + Log.e(TAG, "Credential locked!"); + //runOnUiThread(new Runnable() { + //public void run() { + //toast(getContext().getString(R.string.keyguard_finger_failed_to_unlock)); + //} + //}); + } else if (AuthentecHelper.eAM_STATUS_USER_CANCELED == iResult) { + if (m_bStartAgain) { + Log.e(TAG, "Cancel OK, continue because of the successive launch."); + m_bStartAgain = false; + m_bPaused = false; + } else { + break; + } + } else { + // Terminate the current thread for all other cases. + break; + } + + if (m_bPaused) { + /* Break immediatly without the sleep. */ + if (DEBUG) Log.d(TAG,"VerifyRunner: paused after the verify() call."); + break; + } + + // Give other tasks a chance. + Thread.sleep(10); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + try { + switch (iResult) { + case AuthentecHelper.eAM_STATUS_NO_STORED_CREDENTIAL: + // Might happen if the user wipes their database + // and the fingerprint unlock method remains active. + // Let it continue with the OK case so screen unlocks + if (DEBUG) Log.d(TAG,"No stored credential"); + + case AuthentecHelper.eAM_STATUS_OK: + m_bVerifyied = true; + if (DEBUG) Log.d(TAG,"keyguardDone, m_bVerifyied=" + m_bVerifyied); + mCallback.keyguardDone(true); + mHandler.removeMessages(TIMEOUT); + mWakeLock.release(); + break; + + case AuthentecHelper.eAM_STATUS_USER_CANCELED: + // Power off. + Log.e(TAG, "Simulating device lock.\nYou may not cancel!"); + break; + + case AuthentecHelper.eAM_STATUS_CREDENTIAL_LOCKED: + // When m_bPaused becomes true. + bRetryAfterLockout = true; + break; + + case AuthentecHelper.eAM_STATUS_LIBRARY_NOT_AVAILABLE: + Log.e(TAG, "Library failed to load... cannot proceed!"); + bRetryAfterLockout = true; + break; + + case AuthentecHelper.eAM_STATUS_UI_TIMEOUT: + Log.e(TAG, "UI timeout!"); + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_ui_timeout)); + } + }); + bRetryAfterLockout = true; + break; + + case AuthentecHelper.eAM_STATUS_UNKNOWN_ERROR: + Log.e(TAG, "Unknown error!"); + bRetryAfterLockout = true; + break; + + default: + Log.e(TAG, "Other results: " + iResult); + bRetryAfterLockout = true; + } + } catch (Exception e){} + + if (!m_bPaused && bRetryAfterLockout) { + if (DEBUG) Log.d(TAG,"Error happens, retry after lock out"); + runOnUiThread(new Runnable() { + public void run() { + pokeWakelock(1000); + long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); + handleAttemptLockout(deadline); + } + }); + } + } + } + + private void handleAttemptLockout(long elapsedRealtimeDeadline) { + // Put the key guard into lockout state. + m_bAttemptLockout = true; + // Cancel the Verify thread. + if (mExecutionThread != null && mExecutionThread.isAlive()) { + if (!m_bGfxEngineAttached) { + if (DEBUG) Log.d(TAG,"Lockout send cancel delayed"); + m_bSendDelayedCancel = true; + } else { + if (DEBUG) Log.d(TAG,"Lockout send cancel"); + if (!m_bCancelHasBeenSent) + { + GfxEngineRelayService.queueEvent("#cancel"); + m_bCancelHasBeenSent = true; + } + } + } + + long elapsedRealtime = SystemClock.elapsedRealtime(); + mCountdownTimer = new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { + + @Override + public void onTick(long millisUntilFinished) { + int secondsRemaining = (int) (millisUntilFinished / 1000); + //mInstructions = getContext().getString( + // R.string.lockscreen_too_many_failed_attempts_countdown, + // secondsRemaining); + //updateStatusLines(); + mUserPrompt.setText(getContext().getString( + R.string.lockscreen_too_many_failed_attempts_countdown, + secondsRemaining)); + } + + @Override + public void onFinish() { + // Put the key guard out of lockout state. + if (DEBUG) Log.d(TAG,"handleAttemptLockout: onFinish"); + m_bAttemptLockout = false; + // "keyguard_finger_please_swipe" string would be showed when the TSM is ready. + // mInstructions = getContext().getString(R.string.lockscreen_pattern_instructions); + //updateStatusLines(); + resetStatusInfo(); + // TODO mUnlockIcon.setVisibility(View.VISIBLE); + mFailedPatternAttemptsSinceLastTimeout = 0; + if (mEnableFallback) { + updateFooter(FooterMode.ForgotLockPattern); + } else { + updateFooter(FooterMode.Normal); + } + + // Show the "Screen off" status + if (m_bPaused) { + mUserPrompt.setText(R.string.keyguard_finger_screen_off); + } else { + mUserPrompt.setText(""); + } + + // Start the verification if the finger key guard is holding the wakelock. + if ( (!m_bPaused) && (mExecutionThread != null) && (!(mExecutionThread.isAlive())) ) { + /** + * acquire the handoff lock that will keep the cpu running. this will + * be released once the fingerprint keyguard has set the verification up + * and poked the mWakelock of itself (not the one of the KeyguradViewMediator). + */ + mHandOffWakeLock.acquire(); + if (mExecutionThread.getState() == Thread.State.TERMINATED) { + // If the thread state is TERMINATED, it cannot be start() again. + // Create a thread for verification. + mExecutionThread = new Thread(mVerifyRunner); + mExecutionThread.start(); + } else { + if (DEBUG) Log.d(TAG,"Verify thread exists, just start it"); + mExecutionThread.start(); + } + } + } + }.start(); + } + + public void onPhoneStateChanged(String newState) { + refreshEmergencyButtonText(); + } + + /* handleShow() is called when the GfxEngine sends "show <target>" */ + private void handleShow(String target) + { + if (DEBUG) Log.w(TAG, "'show' target: " + target); + + // Has the object paused? + if (m_bPaused) + { + if (DEBUG) Log.d(TAG,"handleShow: paused"); + return; + } + + if (m_bAttemptLockout) + { + if (DEBUG) Log.d(TAG,"handleShow: Locked out"); + return; + } + + /* if the target is C1-C10 or D1-D10, ignore the command */ + if (target.matches("[CD][1-9]0?$")) return; + + /* if the target is please_swipe, show the UI command to the user: */ + if (target.equals("please_swipe")) { + /* update the UI */ + runOnUiThread(new Runnable() { + public void run() { + mUserPrompt.setText(R.string.keyguard_finger_please_swipe); + // How long we stay awake once the system is ready for a user to enter a pattern. + pokeWakelock(UNLOCK_FINGER_WAKE_INTERVAL_MS); + } + }); + return; + } + + if (target.equals("swipe_good")) { + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_match)); + } + }); + return; + } + /* we'll be asked to show swipe_bad if the finger does not verify. */ + /* this could be following a usage feedback message, in which case */ + /* we've already displayed the feedback, so we don't want to worry */ + /* about an additional message. */ + if (target.equals("swipe_bad")) { + // Update the total failed attempts. + mTotalFailedPatternAttempts++; + mFailedPatternAttemptsSinceLastTimeout++; + + if (!mbFeedbackDelivered) { + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_not_match)); + mCallback.reportFailedUnlockAttempt(); + if (mFailedPatternAttemptsSinceLastTimeout >= + LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) { + pokeWakelock(1000); + long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); + handleAttemptLockout(deadline); + } + } + }); + } else { + runOnUiThread(new Runnable() { + public void run() { + mCallback.reportFailedUnlockAttempt(); + if (mFailedPatternAttemptsSinceLastTimeout >= + LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) { + pokeWakelock(1000); + long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); + handleAttemptLockout(deadline); + } + } + }); + } + + mbFeedbackDelivered = false; + return; + } + + /* if the target is any of our feedback messages, provide a toast... */ + if (target.equals("swipe_too_fast")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_fast)); + } + }); + return; + } + if (target.equals("swipe_too_slow")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_slow)); + } + }); + return; + } + if (target.equals("swipe_too_short")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_short)); + } + }); + return; + } + if (target.equals("swipe_too_skewed")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_skewed)); + } + }); + return; + } + if (target.equals("swipe_too_far_left")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_far_left)); + } + }); + return; + } + if (target.equals("swipe_too_far_right")) { + mbFeedbackDelivered = true; + runOnUiThread(new Runnable() { + public void run() { + toast(getContext().getString(R.string.keyguard_finger_swipe_too_far_right)); + } + }); + return; + } + + /* if we get here, we did not recognize the target... */ + if (DEBUG) Log.w(TAG, "Unhandled 'show' target: " + target); + } + + /* handleHide() is called when the GfxEngine sends "hide <target>" */ + private void handleHide(String target) + { + // Has the object paused? + if (m_bPaused) + { + if (DEBUG) Log.d(TAG,"handleHide: paused"); + return; + } + + /* if the target is C1-C10 or D1-D10, ignore the command */ + if (target.matches("[CD][1-9]0?$")) return; + + /* if the target is please_swipe, remove the user prompt */ + if (target.equals("please_swipe")) + { + runOnUiThread(new Runnable() { + public void run() { + mUserPrompt.setText(""); + /** + * acquire the handoff lock that will keep the cpu running. this will + * be released once the fingerprint keyguard has set the next verification + * up and poked the mWakelock of itself (not the one of the KeyguradViewMediator). + */ + mHandOffWakeLock.acquire(); + + if (mTactileFeedbackEnabled) { + // Generate tactile feedback + if (DEBUG) Log.d(TAG,"Finger on vibration"); + vibe.vibrate(mVibePattern, -1); + } + } + }); + return; + } + + /* if the target is any of our feedback messages, nothing to hide... */ + + /* if we get here, we did not recognize the target... */ + if (DEBUG) Log.w(TAG, "Unhandled 'hide' target: " + target); + } + + /* receiveCommand() is called by a package-local component of the */ + /* relay server, any time a command is received from the GfxEngine. */ + public void receiveCommand(String command, String args) { + /* process the command: */ + + /* for "screen" without parameters, the GfxEngine is done with us... + * we expect to receive exactly two screen commands during our + * lifetime: + * command=="screen", args=="<something here>" + * and + * command=="screen", args=="" + * The first pattern will be the very first command we receive, and + * the second will be the very last command we receive. The argument + * in the first pattern will be indicative of the reason the system + * is presenting a UI; if our activity/service is intended to manage + * multiple screen types, we can use this to distinguish which one to + * present. + */ + if (command.equals("screen") && ((args == null) || (args.length() == 0))) { + // in this case we received "screen" without any arguments... if + // our activity had been launched by the GfxEngine, we would key on + // this to terminate. in this demo, our activity is around before + // the GfxEngine, and we trigger it rather than it triggering us, + // so we can safely ignore this command. + + // we just received "screen" with no arguments... the connection is breaking. + if (DEBUG) Log.w(TAG, "receiveCommand: the connection is breaking"); + m_bGfxEngineAttached = false; + m_bCancelHasBeenSent = false; + return; + } + else if (command.equals("screen")) { + // we don't need to do anything here unless we care about the name + // of the screen being instantiated (in which case we are interested + // in the value of args) + + // we're attached to the GfxEngine, manage delayed cancelation. + if (DEBUG) Log.w(TAG, "receiveCommand: attatched to the GfxEngine"); + m_bGfxEngineAttached = true; + if ((m_bSendDelayedCancel) && (!m_bCancelHasBeenSent)) { + if (DEBUG) Log.w(TAG, "receiveCommand: cancel delayed"); + if (mExecutionThread != null && mExecutionThread.isAlive()) { + if (DEBUG) Log.w(TAG, "receiveCommand: send delayed #cancel"); + GfxEngineRelayService.queueEvent("#cancel"); + m_bCancelHasBeenSent = true; + m_bSendDelayedCancel = false; + } + } + return; + } + + /* if the command is "show" or "hide", we're being asked to show or + * hide some named UI element. In some cases, the UI elements may not + * actually exist, in which case the command can probably be ignored. + * based on the name of the element to be shown / hidden, we might + * make different choices. An element may exist to tell the user to do + * something: the element 'please_swipe' is used to inform the user + * that the system is waiting for their finger to be swiped IF the + * element is being shown. However, if the element is being hidden, + * the system is acknowledging that the user has started their swipe. + * It is normal to start a timer when "show please_swipe" is seen, and + * if the timer expires before "hide please_swipe" occurs, it's normal + * to send back a '#timeout' event. + * Other elements exist for the purpose of providing the user with + * usage feedback; these elements will be shown but not hidden. It is + * this activity's responsibility to decide when/if they should be + * taken down from the display. Often these types of feedback will be + * presented through an Android 'toast'. Examples of these feedback + * messages include: swipe_good, swipe_too_fast, swipe_too_slow, + * sensor_dirty, swipe_too_short, swipe_too_skewed, + * swipe_too_far_right, swipe_too_far_left. + * Generally it is believed that these element names explain the reason + * they will be shown, but there are some caveats to be aware of. + * + * swipe_too_far_[right|left] may be inaccurate. That is, the + * left message may be shown when right is appropriate, and the reverse + * is true. The issue here is that the sensor can be mounted upside + * down, and the user could swipe in the opposite direction versus + * what the hardware design intends. As long as the swipe is in the + * center of the sensor, neither of those possibilities will have a + * negative effect on the operation, however they can cause the + * confusion. It is recommended that the same response be used for + * each of these conditions, and that the response merely tell the + * user two swipe in the center of the sensor. + * + * Some of these messages will accompany another message immediately + * following: swipe_bad. It is tempting to simply ignore the swipe_bad + * message if the more direct message is being presented, however the + * swipe_bad message will also be sent (without other feedback) in the + * case of a good swipe failing to correctly verify against the + * database; the swipe_bad element is the only no-match notification. + * + * Other elements that could be shown or hidden include C1 through C10 + * and D1 through D10. These elements are only useful in the event + * that our UI includes a set of fingers and wishes to highlight + * certain fingers for some reason. If the UI does not include such a + * requirement, these elements can be ignored. + * + */ + if (command.equals("show")) { + handleShow(args); + return; + } + + if (command.equals("hide")) { + handleHide(args); + return; + } + + if (command.equals("settext")) { + // This can generally be ignored. For UIs that get invoked on + // behalf of multiple different applications, we expect to receive + // a "settext appname <app name here>" command, in case we want to + // tell the user which application is needing their fingerprint in + // order to return a credential from the database. + return; + } + + if (DEBUG) Log.w(TAG, "Unhandled command: " + command); + } + + private void toast(final String s) + { + runOnUiThread(new Runnable() { + public void run() + { + mErrorPrompt.setText(s); + mCountdownTimerToast = new CountDownTimer(1000, 1000) { + @Override + public void onFinish() { + mErrorPrompt.setText(""); + } + + @Override + public void onTick(long millisUntilFinished) { + // TODO Auto-generated method stub + } + }.start(); + } + }); + } + + public void onMusicChanged() { + // refreshPlayingTitle(); + } +} diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java index 8196a62..af4e49e 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java @@ -374,7 +374,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, Settings.System.SCREEN_LOCK_SLIDE_DELAY_TOGGLE, 0) == 1; boolean securityLockScreenEnabled = mLockPatternUtils.isLockPasswordEnabled() - || mLockPatternUtils.isLockPatternEnabled(); + || mLockPatternUtils.isLockPatternEnabled() + || mLockPatternUtils.isLockFingerEnabled(); boolean slideLockTimeoutShouldBeConsidered = separateSlideLockTimeoutEnabled && securityLockScreenEnabled; diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index ca12c87..8e7a276 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -113,6 +113,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase { Pattern, /** + * Unlock by swiping a finger. + */ + Finger, + + /** * Unlock by entering a sim pin. */ SimPin, @@ -170,6 +175,12 @@ public class LockPatternKeyguardView extends KeyguardViewBase { */ private Configuration mConfiguration; + /** + * Used to dismiss the timeout dialog + */ + private AlertDialog mTimeoutDialog; + + private Runnable mRecreateRunnable = new Runnable() { public void run() { recreateScreens(); @@ -209,6 +220,17 @@ public class LockPatternKeyguardView extends KeyguardViewBase { mUpdateMonitor = updateMonitor; mLockPatternUtils = lockPatternUtils; mWindowController = controller; + mTimeoutDialog = null; + + // By design, this situation should never happen. + // If finger lock is in use, we should only allow the finger settings menu + // to delete all enrolled fingers. Other applications, like TSMDemo, should + // not get access to the database. + // + // Simply disable the finger key guard since it will fail to work in this case. + if (mLockPatternUtils.isLockFingerEnabled() && !mLockPatternUtils.savedFingerExists()) { + mLockPatternUtils.setLockFingerEnabled(false); + } int LockscreenDisableOnSecurityValue = Settings.System.getInt( mContext.getContentResolver(), Settings.System.LOCKSCREEN_DISABLE_ON_SECURITY, 3); @@ -284,6 +306,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase { } public boolean isVerifyUnlockOnly() { + // This is a good place to dismiss the timeout dialog if there is one. + if (mTimeoutDialog != null) { + if (mTimeoutDialog.isShowing()) { + mTimeoutDialog.dismiss(); + } + mTimeoutDialog = null; + } return mIsVerifyUnlockOnly; } @@ -330,11 +359,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase { " (enableFallback=" + mEnableFallback + ")"); final boolean usingLockPattern = mLockPatternUtils.getKeyguardStoredPasswordQuality() == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING; - if (usingLockPattern && mEnableFallback && failedAttempts == + final boolean usingLockFinger = mLockPatternUtils.getKeyguardStoredPasswordQuality() + == DevicePolicyManager.PASSWORD_QUALITY_FINGER; + if ((usingLockPattern || usingLockFinger) && mEnableFallback && failedAttempts == (LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { showAlmostAtAccountLoginDialog(); - } else if (usingLockPattern && mEnableFallback + } else if ((usingLockPattern || usingLockFinger) && mEnableFallback && failedAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET) { mLockPatternUtils.setPermanentlyLocked(true); updateScreen(mMode); @@ -457,6 +488,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { @Override public void onScreenTurnedOff() { + Log.d(TAG, "onScreenTurnedOff()"); mScreenOn = false; mForgotPattern = false; if (mMode == Mode.LockScreen) { @@ -468,6 +500,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { @Override public void onScreenTurnedOn() { + Log.d(TAG, "onScreenTurnedOn()"); mScreenOn = true; if (mMode == Mode.LockScreen) { ((KeyguardScreen) mLockScreen).onResume(); @@ -566,6 +599,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase { case Pattern: secure = mLockPatternUtils.isLockPatternEnabled(); break; + case Finger: + secure = mLockPatternUtils.isLockFingerEnabled(); + break; case SimPin: secure = mUpdateMonitor.getSimState() == IccCard.State.PIN_REQUIRED || mUpdateMonitor.getSimState() == IccCard.State.PUK_REQUIRED; @@ -674,6 +710,18 @@ public class LockPatternKeyguardView extends KeyguardViewBase { "createUnlockScreenFor(" + unlockMode + "): mEnableFallback=" + mEnableFallback); view.setEnableFallback(mEnableFallback); unlockView = view; + } else if (unlockMode == UnlockMode.Finger) { + FingerUnlockScreen view = new FingerUnlockScreen( + mContext, + mConfiguration, + mLockPatternUtils, + mUpdateMonitor, + mKeyguardScreenCallback, + mUpdateMonitor.getFailedAttempts()); + if (DEBUG) Log.d(TAG, + "createUnlockScreenFor(" + unlockMode + "): mEnableFallback=" + mEnableFallback); + view.setEnableFallback(mEnableFallback); + unlockView = view; } else if (unlockMode == UnlockMode.SimPin) { unlockView = new SimUnlockScreen( mContext, @@ -727,9 +775,12 @@ public class LockPatternKeyguardView extends KeyguardViewBase { if (stuckOnLockScreenBecauseSimMissing() || (simState == IccCard.State.PUK_REQUIRED)) { return Mode.LockScreen; } else { - // Disable LockScreen if security lockscreen is active and option in CMParts set - // Also don't show the slider lockscreen if pin is required - if (mLockscreenDisableOnSecurity && isSecure() || (simState == IccCard.State.PIN_REQUIRED)) { + // Show LockScreen first for any screen other than Pattern unlock and Finger unlock. + final boolean usingLockPattern = mLockPatternUtils.getKeyguardStoredPasswordQuality() + == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING; + final boolean usingLockFinger = mLockPatternUtils.getKeyguardStoredPasswordQuality() + == DevicePolicyManager.PASSWORD_QUALITY_FINGER; + if (mLockscreenDisableOnSecurity && isSecure() && (usingLockPattern || usingLockFinger) || (simState == IccCard.State.PIN_REQUIRED)) { return Mode.UnlockScreen; } else { return Mode.LockScreen; @@ -753,11 +804,14 @@ public class LockPatternKeyguardView extends KeyguardViewBase { case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC: currentMode = UnlockMode.Password; break; + case DevicePolicyManager.PASSWORD_QUALITY_FINGER: case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: case DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED: - // "forgot pattern" button is only available in the pattern mode... + // "forgot pattern" button is only available in the pattern mode and finger mode... if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) { currentMode = UnlockMode.Account; + } else if (mode == DevicePolicyManager.PASSWORD_QUALITY_FINGER) { + currentMode = UnlockMode.Finger; } else { currentMode = UnlockMode.Pattern; } @@ -771,10 +825,20 @@ public class LockPatternKeyguardView extends KeyguardViewBase { private void showTimeoutDialog() { int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000; - String message = mContext.getString( + String message; + + if (mUnlockScreenMode == UnlockMode.Finger) { + message = mContext.getString( + R.string.lockscreen_too_many_failed_fingers_dialog_message, + mUpdateMonitor.getFailedAttempts(), + timeoutInSeconds); + } else { + message = mContext.getString( R.string.lockscreen_too_many_failed_attempts_dialog_message, mUpdateMonitor.getFailedAttempts(), timeoutInSeconds); + } + final AlertDialog dialog = new AlertDialog.Builder(mContext) .setTitle(null) .setMessage(message) @@ -787,17 +851,30 @@ public class LockPatternKeyguardView extends KeyguardViewBase { WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); } + mTimeoutDialog = dialog; dialog.show(); } private void showAlmostAtAccountLoginDialog() { int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000; - String message = mContext.getString( + String message; + + if (mUnlockScreenMode == UnlockMode.Finger) { + message = mContext.getString( + R.string.lockscreen_failed_fingers_almost_glogin, + LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET + - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT, + LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT, + timeoutInSeconds); + } else { + message = mContext.getString( R.string.lockscreen_failed_attempts_almost_glogin, LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT, LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT, timeoutInSeconds); + } + final AlertDialog dialog = new AlertDialog.Builder(mContext) .setTitle(null) .setMessage(message) @@ -810,6 +887,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); } + mTimeoutDialog = dialog; dialog.show(); } diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java index 1538003..e113846 100644 --- a/services/java/com/android/server/DevicePolicyManagerService.java +++ b/services/java/com/android/server/DevicePolicyManagerService.java @@ -503,6 +503,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { switch (quality) { case DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED: case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: + case DevicePolicyManager.PASSWORD_QUALITY_FINGER: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC: @@ -749,16 +750,31 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { getActiveAdminForCallerLocked(null, DeviceAdminInfo.USES_POLICY_RESET_PASSWORD); quality = getPasswordQuality(null); - if (quality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) { - int realQuality = LockPatternUtils.computePasswordQuality(password); - if (realQuality < quality) { - Slog.w(TAG, "resetPassword: password quality 0x" - + Integer.toHexString(quality) - + " does not meet required quality 0x" - + Integer.toHexString(quality)); + + if ((flags == DevicePolicyManager.ENABLE_FINGER_LOCK) || + (flags == DevicePolicyManager.DISABLE_FINGER_LOCK)) { + // Log.d("DevicePolicyManagerService", "Enable/Disable finger lock"); + // do nothing. + } else { + if (quality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) { + int realQuality = LockPatternUtils.computePasswordQuality(password); + + if (realQuality < quality) { + Slog.w(TAG, "resetPassword: password quality 0x" + + Integer.toHexString(quality) + + " does not meet required quality 0x" + + Integer.toHexString(quality)); + return false; + } + quality = realQuality; + } + + int length = getPasswordMinimumLength(null); + if (password.length() < length) { + Slog.w(TAG, "resetPassword: password length " + password.length() + + " does not meet required length " + length); return false; } - quality = realQuality; } int length = getPasswordMinimumLength(null); if (password.length() < length) { @@ -773,19 +789,35 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Slog.w(TAG, "resetPassword: already set by another uid and not entered by user"); return false; } - + // Don't do this with the lock held, because it is going to call // back in to the service. long ident = Binder.clearCallingIdentity(); try { LockPatternUtils utils = new LockPatternUtils(mContext); - utils.saveLockPassword(password, quality); - synchronized (this) { - int newOwner = (flags&DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY) - != 0 ? callingUid : -1; - if (mPasswordOwner != newOwner) { - mPasswordOwner = newOwner; - saveSettingsLocked(); + + if ((flags == DevicePolicyManager.ENABLE_FINGER_LOCK) || + (flags == DevicePolicyManager.DISABLE_FINGER_LOCK)) { + if ((flags == DevicePolicyManager.ENABLE_FINGER_LOCK) && + utils.savedFingerExists() && + !utils.isLockFingerEnabled()) { + utils.setLockFingerEnabled(true); + } else if ((flags == DevicePolicyManager.DISABLE_FINGER_LOCK) && + utils.isLockFingerEnabled() && + !utils.savedFingerExists()) { + utils.setLockFingerEnabled(false); + } + + return true; + } else { + utils.saveLockPassword(password, quality); + synchronized (this) { + int newOwner = (flags&DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY) + != 0 ? callingUid : -1; + if (mPasswordOwner != newOwner) { + mPasswordOwner = newOwner; + saveSettingsLocked(); + } } } } finally { diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java index 4290b89..b846b6f 100644 --- a/services/java/com/android/server/ScreenRotationAnimation.java +++ b/services/java/com/android/server/ScreenRotationAnimation.java @@ -59,7 +59,8 @@ class ScreenRotationAnimation { final Matrix mSnapshotFinalMatrix = new Matrix(); final float[] mTmpFloats = new float[9]; - public ScreenRotationAnimation(Context context, Display display, SurfaceSession session) { + public ScreenRotationAnimation(Context context, Display display, SurfaceSession session, + boolean inTransaction) { mContext = context; mDisplay = display; @@ -84,46 +85,59 @@ class ScreenRotationAnimation { mOriginalWidth = mDisplayMetrics.widthPixels; mOriginalHeight = mDisplayMetrics.heightPixels; - Surface.openTransaction(); - if (mSurface != null) { - mSurface.destroy(); - mSurface = null; + if (!inTransaction) { + if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + ">>> OPEN TRANSACTION ScreenRotationAnimation"); + Surface.openTransaction(); } - try { - mSurface = new Surface(session, 0, "FreezeSurface", - -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); - } catch (Surface.OutOfResourcesException e) { - Slog.w(TAG, "Unable to allocate freeze surface", e); - } - mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); - setRotation(display.getRotation()); - Rect dirty = new Rect(0, 0, mWidth, mHeight); - Canvas c = null; try { - c = mSurface.lockCanvas(dirty); - } catch (IllegalArgumentException e) { - Slog.w(TAG, "Unable to lock surface", e); - return; - } catch (Surface.OutOfResourcesException e) { - Slog.w(TAG, "Unable to lock surface", e); - return; - } - if (c == null) { - Slog.w(TAG, "Null surface"); - return; - } + try { + mSurface = new Surface(session, 0, "FreezeSurface", + -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); + mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); + } catch (Surface.OutOfResourcesException e) { + Slog.w(TAG, "Unable to allocate freeze surface", e); + } - if (screenshot != null) { - c.drawBitmap(screenshot, 0, 0, new Paint(0)); - } else { - c.drawColor(Color.GREEN); - } + setRotation(display.getRotation()); - mSurface.unlockCanvasAndPost(c); - Surface.closeTransaction(); + if (mSurface != null) { + Rect dirty = new Rect(0, 0, mWidth, mHeight); + Canvas c = null; + try { + c = mSurface.lockCanvas(dirty); + } catch (IllegalArgumentException e) { + Slog.w(TAG, "Unable to lock surface", e); + return; + } catch (Surface.OutOfResourcesException e) { + Slog.w(TAG, "Unable to lock surface", e); + return; + } + if (c == null) { + Slog.w(TAG, "Null surface"); + return; + } + + if (screenshot != null) { + c.drawBitmap(screenshot, 0, 0, new Paint(0)); + } else { + c.drawColor(Color.GREEN); + } - screenshot.recycle(); + mSurface.unlockCanvasAndPost(c); + } + } finally { + if (!inTransaction) { + Surface.closeTransaction(); + if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + "<<< CLOSE TRANSACTION ScreenRotationAnimation"); + } + + if (screenshot != null) { + screenshot.recycle(); + } + } } static int deltaRotation(int oldRotation, int newRotation) { diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 45dc022..e136b72 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -2021,7 +2021,7 @@ public class WindowManagerService extends IWindowManager.Stub TAG, "New client " + client.asBinder() + ": window=" + win); - if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked()) { + if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked(false)) { reportNewConfig = true; } } @@ -2112,7 +2112,7 @@ public class WindowManagerService extends IWindowManager.Stub // So just update orientation if needed. if (wasVisible && computeForcedAppOrientationLocked() != mForcedAppOrientation - && updateOrientationFromAppTokensLocked()) { + && updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL); @@ -2218,15 +2218,17 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { WindowState w = windowForClientLocked(session, client, false); if ((w != null) && (w.mSurface != null)) { - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION"); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + ">>> OPEN TRANSACTION setTransparentRegion"); Surface.openTransaction(); try { if (SHOW_TRANSACTIONS) logSurface(w, "transparentRegionHint=" + region, null); w.mSurface.setTransparentRegionHint(region); } finally { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + "<<< CLOSE TRANSACTION setTransparentRegion"); } } } @@ -2561,7 +2563,7 @@ public class WindowManagerService extends IWindowManager.Stub if (assignLayers) { assignLayersLocked(); } - configChanged = updateOrientationFromAppTokensLocked(); + configChanged = updateOrientationFromAppTokensLocked(false); performLayoutAndPlaceSurfacesLocked(); if (displayed && win.mIsWallpaper) { updateWallpaperOffsetLocked(win, mDisplay.getWidth(), @@ -3130,7 +3132,7 @@ public class WindowManagerService extends IWindowManager.Stub long ident = Binder.clearCallingIdentity(); synchronized(mWindowMap) { - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(false)) { if (freezeThisOneIfNeeded != null) { AppWindowToken wtoken = findAppWindowToken( freezeThisOneIfNeeded); @@ -3152,7 +3154,7 @@ public class WindowManagerService extends IWindowManager.Stub if (currentConfig.diff(mTempConfiguration) != 0) { mWaitingForConfig = true; mLayoutNeeded = true; - startFreezingDisplayLocked(); + startFreezingDisplayLocked(false); config = new Configuration(mTempConfiguration); } } @@ -3177,7 +3179,7 @@ public class WindowManagerService extends IWindowManager.Stub * @see android.view.IWindowManager#updateOrientationFromAppTokens( * android.os.IBinder) */ - boolean updateOrientationFromAppTokensLocked() { + boolean updateOrientationFromAppTokensLocked(boolean inTransaction) { if (mDisplayFrozen) { // If the display is frozen, some activities may be in the middle // of restarting, and thus have removed their old window. If the @@ -3198,7 +3200,8 @@ public class WindowManagerService extends IWindowManager.Stub //action like disabling/enabling sensors etc., mPolicy.setCurrentOrientationLw(req); if (setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION, - mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE)) { + mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE, + inTransaction)) { changed = true; } } @@ -3734,6 +3737,7 @@ public class WindowManagerService extends IWindowManager.Stub if (w.mAppFreezing) { w.mAppFreezing = false; if (w.mSurface != null && !w.mOrientationChanging) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "set mOrientationChanging of " + w); w.mOrientationChanging = true; } unfrozeWindows = true; @@ -3771,7 +3775,7 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.freezingScreen = true; mAppsFreezingScreen++; if (mAppsFreezingScreen == 1) { - startFreezingDisplayLocked(); + startFreezingDisplayLocked(false); mH.removeMessages(H.APP_FREEZE_TIMEOUT); mH.sendMessageDelayed(mH.obtainMessage(H.APP_FREEZE_TIMEOUT), 5000); @@ -4539,7 +4543,7 @@ public class WindowManagerService extends IWindowManager.Stub long origId = Binder.clearCallingIdentity(); boolean changed; synchronized(mWindowMap) { - changed = setRotationUncheckedLocked(rotation, animFlags); + changed = setRotationUncheckedLocked(rotation, animFlags, false); } if (changed || alwaysSendConfiguration) { @@ -4557,7 +4561,7 @@ public class WindowManagerService extends IWindowManager.Stub * Returns null if the rotation has been changed. In this case YOU * MUST CALL setNewConfiguration() TO UNFREEZE THE SCREEN. */ - public boolean setRotationUncheckedLocked(int rotation, int animFlags) { + public boolean setRotationUncheckedLocked(int rotation, int animFlags, boolean inTransaction) { boolean changed; if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) { rotation = mRequestedRotation; @@ -4584,17 +4588,28 @@ public class WindowManagerService extends IWindowManager.Stub 2000); mWaitingForConfig = true; mLayoutNeeded = true; - startFreezingDisplayLocked(); + startFreezingDisplayLocked(inTransaction); Slog.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mInputManager.setDisplayOrientation(0, rotation); if (mDisplayEnabled) { if (CUSTOM_SCREEN_ROTATION && mPolicy.isScreenOn()) { Surface.freezeDisplay(0); - Surface.openTransaction(); - if (mScreenRotationAnimation != null) { - mScreenRotationAnimation.setRotation(rotation); + if (!inTransaction) { + if (SHOW_TRANSACTIONS) Slog.i(TAG, + ">>> OPEN TRANSACTION setRotationUnchecked"); + Surface.openTransaction(); + } + try { + if (mScreenRotationAnimation != null) { + mScreenRotationAnimation.setRotation(rotation); + } + } finally { + if (!inTransaction) { + Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + "<<< CLOSE TRANSACTION setRotationUnchecked"); + } } - Surface.closeTransaction(); Surface.setOrientation(0, rotation, animFlags); Surface.unfreezeDisplay(0); } else { @@ -4604,6 +4619,7 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=mWindows.size()-1; i>=0; i--) { WindowState w = mWindows.get(i); if (w.mSurface != null) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Set mOrientationChanging of " + w); w.mOrientationChanging = true; } } @@ -5049,7 +5065,13 @@ public class WindowManagerService extends IWindowManager.Stub public Configuration computeNewConfiguration() { synchronized (mWindowMap) { - return computeNewConfigurationLocked(); + Configuration config = computeNewConfigurationLocked(); + if (config == null && mWaitingForConfig) { + // Nothing changed but we are waiting for something... stop that! + mWaitingForConfig = false; + performLayoutAndPlaceSurfacesLocked(); + } + return config; } } @@ -6359,6 +6381,8 @@ public class WindowManagerService extends IWindowManager.Stub if (mSurface == null) { mReportDestroySurface = false; mSurfacePendingDestroy = false; + if (DEBUG_ORIENTATION) Slog.i(WindowManagerService.TAG, + "createSurface " + this + ": DRAW NOW PENDING"); mDrawPending = true; mCommitDrawPending = false; mReadyToShow = false; @@ -6366,6 +6390,8 @@ public class WindowManagerService extends IWindowManager.Stub mAppToken.allDrawn = false; } + makeWindowFreezingScreenIfNeededLocked(this); + int flags = 0; if (mAttrs.memoryType == MEMORY_TYPE_PUSH_BUFFERS) { flags |= Surface.PUSH_BUFFERS; @@ -6428,9 +6454,8 @@ public class WindowManagerService extends IWindowManager.Stub + ", set left=" + mFrame.left + " top=" + mFrame.top + ", animLayer=" + mAnimLayer); if (SHOW_TRANSACTIONS) { - Slog.i(TAG, ">>> OPEN TRANSACTION"); - if (SHOW_TRANSACTIONS) logSurface(this, - "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" + + Slog.i(TAG, ">>> OPEN TRANSACTION createSurfaceLocked"); + logSurface(this, "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" + mFrame.width() + "x" + mFrame.height() + "), layer=" + mAnimLayer + " HIDE", null); } @@ -6455,8 +6480,8 @@ public class WindowManagerService extends IWindowManager.Stub } mLastHidden = true; } finally { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION createSurfaceLocked"); } if (localLOGV) Slog.v( TAG, "Created surface " + this); @@ -6525,7 +6550,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean finishDrawingLocked() { if (mDrawPending) { if (SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v( - TAG, "finishDrawingLocked: " + mSurface); + TAG, "finishDrawingLocked: " + this + " in " + mSurface); mCommitDrawPending = true; mDrawPending = false; return true; @@ -8563,6 +8588,25 @@ public class WindowManagerService extends IWindowManager.Stub return mPolicy.finishLayoutLw(); } + void makeWindowFreezingScreenIfNeededLocked(WindowState w) { + // If the screen is currently frozen, then keep + // it frozen until this window draws at its new + // orientation. + if (mDisplayFrozen) { + if (DEBUG_ORIENTATION) Slog.v(TAG, + "Resizing while display frozen: " + w); + w.mOrientationChanging = true; + if (!mWindowsFreezingScreen) { + mWindowsFreezingScreen = true; + // XXX should probably keep timeout from + // when we first froze the display. + mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); + mH.sendMessageDelayed(mH.obtainMessage( + H.WINDOW_FREEZE_TIMEOUT), 2000); + } + } + } + private final void performLayoutAndPlaceSurfacesLockedInner( boolean recoveringMemory) { final long currentTime = SystemClock.uptimeMillis(); @@ -8599,7 +8643,7 @@ public class WindowManagerService extends IWindowManager.Stub createWatermark = true; } - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION"); + if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces"); Surface.openTransaction(); @@ -8634,7 +8678,7 @@ public class WindowManagerService extends IWindowManager.Stub } if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG) != 0) { if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout"); - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(true)) { mLayoutNeeded = true; mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } @@ -8839,6 +8883,10 @@ public class WindowManagerService extends IWindowManager.Stub + " drawn=" + wtoken.numDrawnWindows); wtoken.showAllWindowsLocked(); unsetAppFreezingScreenLocked(wtoken, false, true); + if (DEBUG_ORIENTATION) Slog.i(TAG, + "Setting orientationChangeComplete=true because wtoken " + + wtoken + " numInteresting=" + numInteresting + + " numDrawn=" + wtoken.numDrawnWindows); orientationChangeComplete = true; } } else if (!wtoken.allDrawn) { @@ -9064,7 +9112,8 @@ public class WindowManagerService extends IWindowManager.Stub // This has changed the visibility of windows, so perform // a new layout to get them all up-to-date. - changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT; + changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT + | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG; mLayoutNeeded = true; if (!moveInputMethodWindowsIfNeededLocked(true)) { assignLayersLocked(); @@ -9282,7 +9331,7 @@ public class WindowManagerService extends IWindowManager.Stub // as running out of memory), don't take down the // entire system. Slog.e(TAG, "Failure updating surface of " + w - + "size=(" + width + "x" + height + + " size=(" + width + "x" + height + "), pos=(" + w.mShownFrame.left + "," + w.mShownFrame.top + ")", e); if (!recoveringMemory) { @@ -9315,22 +9364,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mLastFrame.set(w.mFrame); w.mLastContentInsets.set(w.mContentInsets); w.mLastVisibleInsets.set(w.mVisibleInsets); - // If the screen is currently frozen, then keep - // it frozen until this window draws at its new - // orientation. - if (mDisplayFrozen) { - if (DEBUG_ORIENTATION) Slog.v(TAG, - "Resizing while display frozen: " + w); - w.mOrientationChanging = true; - if (!mWindowsFreezingScreen) { - mWindowsFreezingScreen = true; - // XXX should probably keep timeout from - // when we first froze the display. - mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage( - H.WINDOW_FREEZE_TIMEOUT), 2000); - } - } + makeWindowFreezingScreenIfNeededLocked(w); // If the orientation is changing, then we need to // hold off on unfreezing the display until this // window has been redrawn; to do that, we need @@ -9646,8 +9680,6 @@ public class WindowManagerService extends IWindowManager.Stub mPointerSurface.hide(); } } - - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); } catch (RuntimeException e) { Slog.e(TAG, "Unhandled exception in Window Manager", e); } @@ -9656,6 +9688,8 @@ public class WindowManagerService extends IWindowManager.Stub Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces"); + if (mWatermark != null) { mWatermark.drawIfNeeded(); } @@ -9692,6 +9726,8 @@ public class WindowManagerService extends IWindowManager.Stub + Integer.toHexString(diff)); } win.mConfiguration = mCurConfiguration; + if (DEBUG_ORIENTATION && win.mDrawPending) Slog.i( + TAG, "Resizing " + win + " WITH DRAW PENDING"); win.mClient.resized(win.mFrame.width(), win.mFrame.height(), win.mLastContentInsets, win.mLastVisibleInsets, win.mDrawPending, @@ -9864,7 +9900,7 @@ public class WindowManagerService extends IWindowManager.Stub } return true; } catch (RuntimeException e) { - Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win); + Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win, e); } reclaimSomeSurfaceMemoryLocked(win, "show"); @@ -9899,6 +9935,7 @@ public class WindowManagerService extends IWindowManager.Stub + " token=" + win.mToken + " pid=" + ws.mSession.mPid + " uid=" + ws.mSession.mUid); + if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null); ws.mSurface.destroy(); ws.mSurfaceShown = false; ws.mSurface = null; @@ -9906,10 +9943,11 @@ public class WindowManagerService extends IWindowManager.Stub i--; N--; leakedSurface = true; - } else if (win.mAppToken != null && win.mAppToken.clientHidden) { + } else if (ws.mAppToken != null && ws.mAppToken.clientHidden) { Slog.w(TAG, "LEAKED SURFACE (app token hidden): " + ws + " surface=" + ws.mSurface + " token=" + win.mAppToken); + if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null); ws.mSurface.destroy(); ws.mSurfaceShown = false; ws.mSurface = null; @@ -9947,6 +9985,7 @@ public class WindowManagerService extends IWindowManager.Stub // surface and ask the app to request another one. Slog.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry."); if (surface != null) { + if (SHOW_TRANSACTIONS) logSurface(win, "RECOVER DESTROY", null); surface.destroy(); win.mSurfaceShown = false; win.mSurface = null; @@ -10074,7 +10113,7 @@ public class WindowManagerService extends IWindowManager.Stub return result; } - private void startFreezingDisplayLocked() { + private void startFreezingDisplayLocked(boolean inTransaction) { if (mDisplayFrozen) { return; } @@ -10125,7 +10164,7 @@ public class WindowManagerService extends IWindowManager.Stub if (CUSTOM_SCREEN_ROTATION && mPolicy.isScreenOn()) { if (mScreenRotationAnimation == null) { mScreenRotationAnimation = new ScreenRotationAnimation(mContext, - mDisplay, mFxSession); + mDisplay, mFxSession, inTransaction); } } else { Surface.freezeDisplay(0); @@ -10150,15 +10189,15 @@ public class WindowManagerService extends IWindowManager.Stub } if (mScreenRotationAnimation != null) { + if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation"); if (mScreenRotationAnimation.dismiss(MAX_ANIMATION_DURATION, mTransitionAnimationScale)) { requestAnimationLocked(0); } else { mScreenRotationAnimation = null; } - } else { - Surface.unfreezeDisplay(0); } + Surface.unfreezeDisplay(0); mInputMonitor.thawInputDispatchingLw(); @@ -10166,7 +10205,7 @@ public class WindowManagerService extends IWindowManager.Stub // to avoid inconsistent states. However, something interesting // could have actually changed during that time so re-evaluate it // now to catch that. - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index a165ebb..17f9214 100755 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -2596,6 +2596,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (localLOGV) Slog.v( TAG, "Removing this entry! frozen=" + r.haveState + " finishing=" + r.finishing); + r.makeFinishing(); mMainStack.mHistory.remove(i); r.inHistory = false; @@ -6450,7 +6451,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (r.state == ActivityState.RESUMED || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) { - if (!r.isHomeActivity) { + if (!r.isHomeActivity || mHomeProcess != r.app) { Slog.w(TAG, " Force finishing activity " + r.intent.getComponent().flattenToShortString()); r.stack.finishActivityLocked(r, index, diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java index 4d773e4..f0818d6 100644 --- a/services/java/com/android/server/am/ActivityRecord.java +++ b/services/java/com/android/server/am/ActivityRecord.java @@ -303,6 +303,15 @@ class ActivityRecord extends IApplicationToken.Stub { } } + void makeFinishing() { + if (!finishing) { + finishing = true; + if (task != null) { + task.numActivities--; + } + } + } + UriPermissionOwner getUriPermissionsLocked() { if (uriPermissions == null) { uriPermissions = new UriPermissionOwner(service, this); diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 95ef2ed..d1958f3 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -2891,7 +2891,7 @@ public class ActivityStack { return false; } - r.finishing = true; + r.makeFinishing(); EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY, System.identityHashCode(r), r.task.taskId, r.shortComponentName, reason); @@ -3100,6 +3100,7 @@ public class ActivityStack { private final void removeActivityFromHistoryLocked(ActivityRecord r) { if (r.state != ActivityState.DESTROYED) { + r.makeFinishing(); mHistory.remove(r); r.inHistory = false; r.resultTo = null; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index abe3f06..a52e1aa 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -839,10 +839,12 @@ public class TelephonyManager { /** FastDormancy get/setter */ private static boolean sDormancyRejected = false; + /** @hide */ public static boolean isDormancyRejected() { return getDefault().sDormancyRejected; } + /** @hide */ public static boolean setDormancyRejected(boolean rejected) { getDefault().sDormancyRejected = rejected; return true; diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java index b40e7a3..3929864 100644 --- a/telephony/java/com/android/internal/telephony/CallManager.java +++ b/telephony/java/com/android/internal/telephony/CallManager.java @@ -78,6 +78,7 @@ public final class CallManager { private static final int EVENT_SUPP_SERVICE_FAILED = 117; private static final int EVENT_SERVICE_STATE_CHANGED = 118; private static final int EVENT_POST_DIAL_CHARACTER = 119; + private static final int EVENT_SUPP_SERVICE_NOTIFY = 120; // Singleton instance private static final CallManager INSTANCE = new CallManager(); @@ -159,6 +160,9 @@ public final class CallManager { protected final RegistrantList mSuppServiceFailedRegistrants = new RegistrantList(); + protected final RegistrantList mSuppServiceNotificationRegistrants + = new RegistrantList(); + protected final RegistrantList mServiceStateChangedRegistrants = new RegistrantList(); @@ -428,6 +432,9 @@ public final class CallManager { phone.registerForMmiComplete(mHandler, EVENT_MMI_COMPLETE, null); phone.registerForSuppServiceFailed(mHandler, EVENT_SUPP_SERVICE_FAILED, null); phone.registerForServiceStateChanged(mHandler, EVENT_SERVICE_STATE_CHANGED, null); + if (phone.getPhoneType() == Phone.PHONE_TYPE_GSM) { + phone.registerForSuppServiceNotification(mHandler, EVENT_SUPP_SERVICE_NOTIFY, null); + } // for events supported only by GSM and CDMA phone if (phone.getPhoneType() == Phone.PHONE_TYPE_GSM || @@ -460,6 +467,7 @@ public final class CallManager { phone.unregisterForMmiInitiate(mHandler); phone.unregisterForMmiComplete(mHandler); phone.unregisterForSuppServiceFailed(mHandler); + phone.unregisterForSuppServiceNotification(mHandler); phone.unregisterForServiceStateChanged(mHandler); // for events supported only by GSM and CDMA phone @@ -1268,6 +1276,27 @@ public final class CallManager { } /** + * Register for supplementary service notifications. + * Message.obj will contain an AsyncResult. + * + * @param h Handler that receives the notification message. + * @param what User-defined message code. + * @param obj User object. + */ + public void registerForSuppServiceNotification(Handler h, int what, Object obj){ + mSuppServiceNotificationRegistrants.addUnique(h, what, obj); + } + + /** + * Unregister for supplementary service notifications. + * + * @param h Handler to be removed from the registrant list. + */ + public void unregisterForSuppServiceNotification(Handler h){ + mSuppServiceNotificationRegistrants.remove(h); + } + + /** * Register for notifications when a sInCall VoicePrivacy is enabled * * @param h Handler that receives the notification message. @@ -1776,6 +1805,10 @@ public final class CallManager { if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SUPP_SERVICE_FAILED)"); mSuppServiceFailedRegistrants.notifyRegistrants((AsyncResult) msg.obj); break; + case EVENT_SUPP_SERVICE_NOTIFY: + if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SUPP_SERVICE_NOTIFICATION)"); + mSuppServiceNotificationRegistrants.notifyRegistrants((AsyncResult) msg.obj); + break; case EVENT_SERVICE_STATE_CHANGED: if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SERVICE_STATE_CHANGED)"); mServiceStateChangedRegistrants.notifyRegistrants((AsyncResult) msg.obj); diff --git a/telephony/java/com/android/internal/telephony/LGEStarRIL.java b/telephony/java/com/android/internal/telephony/LGEStarRIL.java index 40dd31c..4b84f57 100644 --- a/telephony/java/com/android/internal/telephony/LGEStarRIL.java +++ b/telephony/java/com/android/internal/telephony/LGEStarRIL.java @@ -1009,14 +1009,12 @@ public class LGEStarRIL extends RIL implements CommandsInterface { /* Infineon modems need some additional hax... */ if (isIfx) { - /* Store DST before cropping */ - parcelextra = parceldata.substring(parceldata.lastIndexOf(",")+1); - if (parcelextra != null) dst = Integer.parseInt(parcelextra); - parceldata = parceldata.substring(0,(parceldata.lastIndexOf(","))); + String [] parcelitem = parceldata.split(","); + parceldata = parcelitem[0] + "," + parcelitem[1]; // assuming there is always one comma at least + parcelextra = (parcelitem.length > 2 ? parcelitem[2] : "0"); + dst = Integer.parseInt(parcelextra); } - int offset = num*15*60*1000; // DST corrected - /* WTH... Date may come with 4 digits in the year, reduce to 2 */ try { dateFormatter = new SimpleDateFormat("yy/MM/dd,HH:mm:ss"); @@ -1025,6 +1023,7 @@ public class LGEStarRIL extends RIL implements CommandsInterface { /* Ifx delivers localtime, convert to UTC */ if (usesLocalTime) { /* Directly calculate UTC time using DST Offset */ + int offset = num*15*60*1000; // DST corrected long when = dateParser.parse(parceldata).getTime() - offset; Date d = new Date(when); response = dateFormatter.format(d); diff --git a/telephony/java/com/android/internal/telephony/SamsungRIL.java b/telephony/java/com/android/internal/telephony/SamsungRIL.java index 1df713a..9374374 100644 --- a/telephony/java/com/android/internal/telephony/SamsungRIL.java +++ b/telephony/java/com/android/internal/telephony/SamsungRIL.java @@ -32,6 +32,8 @@ import com.android.internal.telephony.RILConstants; import com.android.internal.telephony.SmsResponse; import com.android.internal.telephony.cdma.CdmaCallWaitingNotification; import com.android.internal.telephony.cdma.CdmaInformationRecords; +import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaSignalInfoRec; +import com.android.internal.telephony.cdma.SignalToneUtil; import android.util.Log; @@ -57,6 +59,7 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) { static final int RIL_UNSOL_HSDPA_STATE_CHANGED = 11016; static final int RIL_UNSOL_SAMSUNG_UNKNOWN_MAGIC_REQUEST = 11012; static final int RIL_REQUEST_DIAL_EMERGENCY = 10016; + static final int RIL_UNSOL_GPS_NOTI = 11009; @Override public void @@ -151,7 +154,7 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) { case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE: ret = responseVoid(p); break; case RIL_REQUEST_CONFERENCE: ret = responseVoid(p); break; case RIL_REQUEST_UDUB: ret = responseVoid(p); break; - case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret = responseInts(p); break; + case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret = responseLastCallFailCause(p); break; case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break; case RIL_REQUEST_REGISTRATION_STATE: ret = responseStrings(p); break; case RIL_REQUEST_GPRS_REGISTRATION_STATE: ret = responseStrings(p); break; @@ -379,6 +382,7 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) { case RIL_UNSOL_SAMSUNG_UNKNOWN_MAGIC_REQUEST: ret = responseVoid(p); break; case RIL_UNSOL_STK_SEND_SMS_RESULT: ret = responseVoid(p); break; case RIL_UNSOL_DEVICE_READY_NOTI: ret = responseVoid(p); break; + case RIL_UNSOL_GPS_NOTI: ret = responseVoid(p); break; // Ignored in TW RIL. case RIL_UNSOL_SAMSUNG_UNKNOWN_MAGIC_REQUEST_2: ret = responseVoid(p); break; default: @@ -797,6 +801,22 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) { return response; } + + protected Object + responseLastCallFailCause(Parcel p) { + int response[] = (int[])responseInts(p); + + if (mIsSamsungCdma && response.length > 0 && + response[0] == com.android.internal.telephony.cdma.CallFailCause.ERROR_UNSPECIFIED) { + + // Far-end hangup returns ERROR_UNSPECIFIED, which shows "Call Lost" dialog. + Log.d(LOG_TAG, "Overriding ERROR_UNSPECIFIED fail cause with NORMAL_CLEARING."); + response[0] = com.android.internal.telephony.cdma.CallFailCause.NORMAL_CLEARING; + } + + return response; + } + @Override protected Object responseSignalStrength(Parcel p) { @@ -842,6 +862,62 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) { return response; } + + // Workaround for Samsung CDMA "ring of death" bug: + // + // Symptom: As soon as the phone receives notice of an incoming call, an + // audible "old fashioned ring" is emitted through the earpiece and + // persists through the duration of the call, or until reboot if the call + // isn't answered. + // + // Background: The CDMA telephony stack implements a number of "signal info + // tones" that are locally generated by ToneGenerator and mixed into the + // voice call path in response to radio RIL_UNSOL_CDMA_INFO_REC requests. + // One of these tones, IS95_CONST_IR_SIG_IS54B_L, is requested by the + // radio just prior to notice of an incoming call when the voice call + // path is muted. CallNotifier is responsible for stopping all signal + // tones (by "playing" the TONE_CDMA_SIGNAL_OFF tone) upon receipt of a + // "new ringing connection", prior to unmuting the voice call path. + // + // Problem: CallNotifier's incoming call path is designed to minimize + // latency to notify users of incoming calls ASAP. Thus, + // SignalInfoTonePlayer requests are handled asynchronously by spawning a + // one-shot thread for each. Unfortunately the ToneGenerator API does + // not provide a mechanism to specify an ordering on requests, and thus, + // unexpected thread interleaving may result in ToneGenerator processing + // them in the opposite order that CallNotifier intended. In this case, + // playing the "signal off" tone first, followed by playing the "old + // fashioned ring" indefinitely. + // + // Solution: An API change to ToneGenerator is required to enable + // SignalInfoTonePlayer to impose an ordering on requests (i.e., drop any + // request that's older than the most recent observed). Such a change, + // or another appropriate fix should be implemented in AOSP first. + // + // Workaround: Intercept RIL_UNSOL_CDMA_INFO_REC requests from the radio, + // check for a signal info record matching IS95_CONST_IR_SIG_IS54B_L, and + // drop it so it's never seen by CallNotifier. If other signal tones are + // observed to cause this problem, they should be dropped here as well. + @Override + protected void + notifyRegistrantsCdmaInfoRec(CdmaInformationRecords infoRec) { + final int response = RIL_UNSOL_CDMA_INFO_REC; + + if (/* mIsSamsungCdma && */ infoRec.record instanceof CdmaSignalInfoRec) { + CdmaSignalInfoRec sir = (CdmaSignalInfoRec)infoRec.record; + if (sir != null && sir.isPresent && + sir.signalType == SignalToneUtil.IS95_CONST_IR_SIGNAL_IS54B && + sir.alertPitch == SignalToneUtil.IS95_CONST_IR_ALERT_MED && + sir.signal == SignalToneUtil.IS95_CONST_IR_SIG_IS54B_L) { + + Log.d(LOG_TAG, "Dropping \"" + responseToString(response) + " " + + retToString(response, sir) + "\" to prevent \"ring of death\" bug."); + return; + } + } + + super.notifyRegistrantsCdmaInfoRec(infoRec); + } protected class SamsungDriverCall extends DriverCall { @Override diff --git a/voip/java/android/net/sip/SipProfile.java b/voip/java/android/net/sip/SipProfile.java index e0748eb..0e425e4 100644 --- a/voip/java/android/net/sip/SipProfile.java +++ b/voip/java/android/net/sip/SipProfile.java @@ -262,6 +262,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable { * * @param interval in seconds * @return this builder object + * @hide */ public Builder setKeepAliveInterval(int interval) { mProfile.mKeepAliveInterval = interval; @@ -504,6 +505,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable { * Gets the value of 'Keep-alive interval'. * * @return the Keep-alive interval in seconds. + * @hide */ public int getKeepAliveInterval() { return mKeepAliveInterval; diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 22ff8dd..94b0cc6 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -52,6 +52,7 @@ public class WifiConfiguration implements Parcelable { public static final String modeAdhoc = "1"; /** * Channel Frequency Values, to be used for setting up Adhoc Networks + * @hide */ public static class ChannelFrequency { private ChannelFrequency() { } @@ -300,12 +301,14 @@ public class WifiConfiguration implements Parcelable { /** * This is a adhoc network + * @hide */ public boolean adhocSSID; /** * If the signal is Adhoc, then frequency must be set * otherwise, we don't care what the frequency is + * @hide */ public int frequency; |