mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-09-27 16:46:35 +02:00
Huge Update
- Update Location APIs, fixes #37 - Update version number, fixes #38 - Enable long press input on WebView during login, fixes #34 - Extended log output and auto-repair for GCM connection, related to #29 and #31 - New icons - Small quirks in Auth handling (required for Login to some applications)
This commit is contained in:
parent
b0701625ad
commit
40ca65bbf4
@ -11,7 +11,7 @@ script:
|
||||
android:
|
||||
components:
|
||||
- extra-android-m2repository
|
||||
- build-tools-22.0.1
|
||||
- android-22
|
||||
- build-tools-23.0.1
|
||||
- android-23
|
||||
|
||||
|
||||
|
2
extern/GmsApi
vendored
2
extern/GmsApi
vendored
@ -1 +1 @@
|
||||
Subproject commit 28ff7f36f2b75a29cead8efc25fc0418065db601
|
||||
Subproject commit cb0458f17e55e713b10fe5611890887d0c8b910e
|
2
extern/UnifiedNlp
vendored
2
extern/UnifiedNlp
vendored
@ -1 +1 @@
|
||||
Subproject commit 643bd7dd22681dc5b1f1e0e3074033cb1b84ec75
|
||||
Subproject commit 5f22b0a56f4676cd44a0e69ed5a1913d4d84ab41
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,8 +33,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.android.support:support-v4:23.0.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.1'
|
||||
compile 'de.hdodenhof:circleimageview:1.2.1'
|
||||
compile 'com.squareup.wire:wire-runtime:1.6.1'
|
||||
compile project(':play-services-api')
|
||||
@ -53,8 +53,8 @@ dependencies {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "22.0.1"
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.1"
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
|
275
play-services-core/ic_microg_settings.svg
Normal file
275
play-services-core/ic_microg_settings.svg
Normal file
@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="256"
|
||||
height="256"
|
||||
viewBox="0 0 256 256"
|
||||
id="svg3059"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="ic_microg_settings.svg"
|
||||
inkscape:export-filename="/home/marvin/Development/IDEA/microg_gradle_build_root/play-services-core/src/main/res/mipmap-mdpi/ic_microg_settings.png"
|
||||
inkscape:export-xdpi="16.879999"
|
||||
inkscape:export-ydpi="16.879999">
|
||||
<metadata
|
||||
id="metadata3069">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3067">
|
||||
<linearGradient
|
||||
id="linearGradient3847">
|
||||
<stop
|
||||
style="stop-color:#6a8592;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3853" />
|
||||
<stop
|
||||
id="stop3851"
|
||||
offset="1"
|
||||
style="stop-color:#627f8d;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3847"
|
||||
id="linearGradient3845"
|
||||
x1="11.978406"
|
||||
y1="2.0046263"
|
||||
x2="11.978406"
|
||||
y2="21.906435"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="scale(10.666667,10.666667)" />
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter4067"
|
||||
x="-0.5"
|
||||
y="-0.5"
|
||||
width="2"
|
||||
height="2">
|
||||
<feFlood
|
||||
flood-opacity="1"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood4069" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite4071" />
|
||||
<feGaussianBlur
|
||||
in="composite"
|
||||
stdDeviation="6"
|
||||
result="blur"
|
||||
id="feGaussianBlur4073" />
|
||||
<feComponentTransfer
|
||||
id="feComponentTransfer13">
|
||||
<feFuncA
|
||||
type="linear"
|
||||
slope="0.2"
|
||||
id="feFuncA15" />
|
||||
</feComponentTransfer>
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="6"
|
||||
result="offset"
|
||||
id="feOffset4075"
|
||||
stdDeviation="8" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite4077" />
|
||||
</filter>
|
||||
<filter
|
||||
inkscape:label="Edge Tint/Shade"
|
||||
inkscape:menu="Shadows and Glows"
|
||||
inkscape:menu-tooltip="Adds a colorizable drop shadow inside"
|
||||
color-interpolation-filters="sRGB"
|
||||
id="filter4119">
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="5"
|
||||
result="result11"
|
||||
id="feOffset4123"
|
||||
in="SourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite4151"
|
||||
operator="in"
|
||||
in="SourceGraphic"
|
||||
result="result6"
|
||||
in2="result11" />
|
||||
<feFlood
|
||||
id="feFlood4153"
|
||||
flood-color="rgb(255,255,255)"
|
||||
flood-opacity="0.20000000000000001"
|
||||
result="result10" />
|
||||
<feBlend
|
||||
id="feBlend4157"
|
||||
mode="normal"
|
||||
in="result6"
|
||||
result="result13"
|
||||
in2="result10" />
|
||||
<feComposite
|
||||
id="feComposite4159"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="result2" />
|
||||
<feBlend
|
||||
result="result12"
|
||||
in2="SourceGraphic"
|
||||
mode="normal"
|
||||
id="feBlend4161"
|
||||
blend="normal" />
|
||||
<feOffset
|
||||
id="feOffset4149"
|
||||
result="result11"
|
||||
dy="-5"
|
||||
dx="0"
|
||||
in="SourceGraphic" />
|
||||
<feComposite
|
||||
result="result6"
|
||||
in="result12"
|
||||
operator="in"
|
||||
in2="result11"
|
||||
id="feComposite4125" />
|
||||
<feFlood
|
||||
result="result10"
|
||||
in="result6"
|
||||
flood-opacity="0.20000000000000001"
|
||||
flood-color="rgb(0,0,0)"
|
||||
id="feFlood4127" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="result10"
|
||||
id="feBlend4129"
|
||||
in="result6" />
|
||||
<feComposite
|
||||
result="result2"
|
||||
operator="in"
|
||||
in2="result12"
|
||||
id="feComposite4131" />
|
||||
<feBlend
|
||||
blend="normal"
|
||||
id="feBlend4133"
|
||||
in="result2"
|
||||
mode="normal"
|
||||
in2="result12"
|
||||
result="result12" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
id="namedview3065"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2"
|
||||
inkscape:cx="143.89356"
|
||||
inkscape:cy="79.9122"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg3059" />
|
||||
<path
|
||||
sodipodi:nodetypes="csccccccccssccccccccsccccccccsscccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient3845);fill-opacity:1;filter:url(#filter4067)"
|
||||
id="path3085"
|
||||
d="M 207.25333,138.45333 C 207.68,135.04 208,131.62667 208,128 c 0,-3.62667 -0.32,-7.04 -0.74667,-10.45333 L 229.76,99.946667 c 2.02667,-1.6 2.56,-4.48 1.28,-6.826667 L 209.70667,56.213333 c -1.28,-2.346666 -4.16,-3.2 -6.50667,-2.346666 L 176.64,64.533333 C 171.09333,60.266667 165.12,56.746667 158.61333,54.08 L 154.56,25.813333 c -0.32,-2.56 -2.56,-4.48 -5.22667,-4.48 l -42.66666,0 c -2.66667,0 -4.90667,1.92 -5.22667,4.48 L 97.386667,54.08 C 90.88,56.746667 84.906667,60.373333 79.36,64.533333 L 52.8,53.866667 c -2.453333,-0.96 -5.226667,0 -6.506667,2.346666 L 24.96,93.12 c -1.386667,2.346667 -0.746667,5.226667 1.28,6.826667 L 48.746667,117.54667 C 48.32,120.96 48,124.48 48,128 c 0,3.52 0.32,7.04 0.746667,10.45333 l -22.506667,17.6 c -2.026667,1.6 -2.56,4.48 -1.28,6.82667 l 21.333333,36.90667 c 1.28,2.34666 4.16,3.2 6.506667,2.34666 l 26.56,-10.66666 c 5.546667,4.26666 11.52,7.78666 18.026667,10.45333 L 101.44,230.18667 c 0.32,2.56 2.56,4.48 5.22667,4.48 l 42.66666,0 c 2.66667,0 4.90667,-1.92 5.22667,-4.48 L 158.61333,201.92 c 6.50667,-2.66667 12.48,-6.29333 18.02667,-10.45333 l 26.56,10.66666 c 2.45333,0.96 5.22667,0 6.50667,-2.34666 L 231.04,162.88 c 1.28,-2.34667 0.74667,-5.22667 -1.28,-6.82667 z" />
|
||||
<path
|
||||
d="M 0,0 H 256 V 256 H 0 z"
|
||||
id="path3061"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none" />
|
||||
<path
|
||||
d="M 207.25333,138.45333 C 207.68,135.04 208,131.62667 208,128 c 0,-3.62667 -0.32,-7.04 -0.74667,-10.45333 L 229.76,99.946667 c 2.02667,-1.6 2.56,-4.48 1.28,-6.826667 L 209.70667,56.213333 c -1.28,-2.346666 -4.16,-3.2 -6.50667,-2.346666 L 176.64,64.533333 C 171.09333,60.266667 165.12,56.746667 158.61333,54.08 L 154.56,25.813333 c -0.32,-2.56 -2.56,-4.48 -5.22667,-4.48 l -42.66666,0 c -2.66667,0 -4.90667,1.92 -5.22667,4.48 L 97.386667,54.08 C 90.88,56.746667 84.906667,60.373333 79.36,64.533333 L 52.8,53.866667 c -2.453333,-0.96 -5.226667,0 -6.506667,2.346666 L 24.96,93.12 c -1.386667,2.346667 -0.746667,5.226667 1.28,6.826667 L 48.746667,117.54667 C 48.32,120.96 48,124.48 48,128 c 0,3.52 0.32,7.04 0.746667,10.45333 l -22.506667,17.6 c -2.026667,1.6 -2.56,4.48 -1.28,6.82667 l 21.333333,36.90667 c 1.28,2.34666 4.16,3.2 6.506667,2.34666 l 26.56,-10.66666 c 5.546667,4.26666 11.52,7.78666 18.026667,10.45333 L 101.44,230.18667 c 0.32,2.56 2.56,4.48 5.22667,4.48 l 42.66666,0 c 2.66667,0 4.90667,-1.92 5.22667,-4.48 L 158.61333,201.92 c 6.50667,-2.66667 12.48,-6.29333 18.02667,-10.45333 l 26.56,10.66666 c 2.45333,0.96 5.22667,0 6.50667,-2.34666 L 231.04,162.88 c 1.28,-2.34667 0.74667,-5.22667 -1.28,-6.82667 z"
|
||||
id="path3063"
|
||||
style="fill:url(#linearGradient3845);fill-opacity:1;filter:url(#filter4119)"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csccccccccssccccccccsccccccccsscccccccc" />
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:0.0627451"
|
||||
d="m 168.08594,86.261719 -61.18164,3.882811 -21.070314,38.94043 0.929686,38.94043 69.212888,52.29102 2.63672,-18.39649 c 6.50667,-2.66667 12.48067,-6.29312 18.02734,-10.45312 l 26.5586,10.66601 c 2.45333,0.96 5.22781,9.6e-4 6.50781,-2.3457 l 21.33203,-36.90625 c 1.28,-2.34667 0.74738,-5.22813 -1.27929,-6.82813 L 207.25391,138.45312 C 207.68058,135.03979 208,131.62667 208,128 c 0,-3.62667 -0.31942,-7.0398 -0.74609,-10.45312 l 1.66601,-1.30274 z"
|
||||
id="rect4273"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccccccsccc" />
|
||||
<g
|
||||
transform="matrix(0.82891149,0,0,0.82891149,-202.06341,-173.42617)"
|
||||
id="g6310"
|
||||
inkscape:export-xdpi="102"
|
||||
inkscape:export-ydpi="102"
|
||||
style="filter:url(#filter4067)">
|
||||
<path
|
||||
d="m 437.1019,402.53183 a 55,55 0 0 1 -66.39087,8.74053"
|
||||
sodipodi:open="true"
|
||||
sodipodi:end="2.0943951"
|
||||
sodipodi:start="0.78539816"
|
||||
sodipodi:ry="55"
|
||||
sodipodi:rx="55"
|
||||
sodipodi:cy="363.64096"
|
||||
sodipodi:cx="398.21103"
|
||||
sodipodi:type="arc"
|
||||
id="path6302"
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#92a6b1;stroke-width:30;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<path
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#a3ffe6;stroke-width:30;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path6304"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="398.21103"
|
||||
sodipodi:cy="363.64096"
|
||||
sodipodi:rx="55"
|
||||
sodipodi:ry="55"
|
||||
sodipodi:start="2.0943951"
|
||||
sodipodi:end="3.403392"
|
||||
sodipodi:open="true"
|
||||
d="M 370.71103,411.27236 A 55,55 0 0 1 345.08511,349.40592" />
|
||||
<path
|
||||
d="m 345.08511,349.40592 a 55,55 0 0 1 25.62592,-33.39636"
|
||||
sodipodi:open="true"
|
||||
sodipodi:end="4.1887902"
|
||||
sodipodi:start="3.403392"
|
||||
sodipodi:ry="55"
|
||||
sodipodi:rx="55"
|
||||
sodipodi:cy="363.64096"
|
||||
sodipodi:cx="398.21103"
|
||||
sodipodi:type="arc"
|
||||
id="path6306"
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:30;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<path
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#d0dadc;stroke-width:30;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path6308"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="398.21103"
|
||||
sodipodi:cy="363.64096"
|
||||
sodipodi:rx="55"
|
||||
sodipodi:ry="55"
|
||||
sodipodi:start="4.1887902"
|
||||
sodipodi:end="5.4977871"
|
||||
sodipodi:open="true"
|
||||
d="m 370.71103,316.00956 a 55,55 0 0 1 66.39087,8.74053" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 11 KiB |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright 2013-2015 µg Project Team
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright 2013-2015 microG Project Team
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
@ -12,73 +13,79 @@
|
||||
~ 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.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
-->
|
||||
<manifest
|
||||
package="com.google.android.gms"
|
||||
android:versionCode="7887001"
|
||||
android:versionName="7.8.87 (µg v0.01)">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionCode="8115238"
|
||||
android:versionName="8.1.15 (microG v0.01)">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="14"
|
||||
android:targetSdkVersion="22" />
|
||||
android:targetSdkVersion="23"/>
|
||||
|
||||
<permission
|
||||
android:name="com.google.android.c2dm.permission.RECEIVE"
|
||||
android:label="@string/perm_c2dm_receive_label"
|
||||
android:permissionGroup="android.permission-group.NETWORK"
|
||||
android:protectionLevel="dangerous" />
|
||||
android:protectionLevel="dangerous"/>
|
||||
<permission
|
||||
android:name="com.google.android.c2dm.permission.SEND"
|
||||
android:label="@string/perm_c2dm_send_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
android:protectionLevel="dangerous"/>
|
||||
|
||||
<permission-tree
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"
|
||||
android:icon="@drawable/proprietary_auth_ic_scope_icon_default" />
|
||||
android:icon="@drawable/proprietary_auth_ic_scope_icon_default"/>
|
||||
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.local"
|
||||
android:description="@string/permission_service_local_description"
|
||||
android:label="@string/permission_service_local_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
android:protectionLevel="dangerous"/>
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.mail"
|
||||
android:description="@string/permission_service_mail_description"
|
||||
android:label="@string/permission_service_mail_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
android:protectionLevel="dangerous"/>
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.writely"
|
||||
android:description="@string/permission_service_writely_description"
|
||||
android:label="@string/permission_service_writely_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
|
||||
android:protectionLevel="dangerous"/>
|
||||
<permission
|
||||
android:name="org.microg.gms.STATUS_BROADCAST"
|
||||
android:label="@string/perm_status_broadcast_label"
|
||||
android:protectionLevel="normal" />
|
||||
android:protectionLevel="normal"/>
|
||||
|
||||
<uses-permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.SEND" />
|
||||
<uses-permission android:name="org.microg.gms.STATUS_BROADCAST" />
|
||||
<uses-permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.SEND"/>
|
||||
<uses-permission android:name="org.microg.gms.STATUS_BROADCAST"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
android:icon="@drawable/ic_microg_app"
|
||||
android:icon="@mipmap/ic_core_service_app"
|
||||
android:label="@string/gms_app_name">
|
||||
<meta-data
|
||||
android:name="fake-signature"
|
||||
android:value="@string/fake_signature" />
|
||||
android:value="@string/fake_signature"/>
|
||||
|
||||
<!-- Location -->
|
||||
|
||||
@ -86,16 +93,15 @@
|
||||
android:name="org.microg.gms.location.GoogleLocationManagerService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.location.internal.GoogleLocationManagerService.START" />
|
||||
<action android:name="com.google.android.location.internal.GoogleLocationManagerService.START"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name="org.microg.gms.location.ReportingAndroidService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.location.reporting.service.START" />
|
||||
<action android:name="com.google.android.gms.location.reporting.service.START" />
|
||||
<action android:name="com.google.android.location.reporting.service.START"/>
|
||||
<action android:name="com.google.android.gms.location.reporting.service.START"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
@ -104,44 +110,42 @@
|
||||
<provider
|
||||
android:name="org.microg.gms.gservices.GServicesProvider"
|
||||
android:authorities="com.google.android.gsf.gservices"
|
||||
android:exported="true" />
|
||||
|
||||
android:exported="true"/>
|
||||
<provider
|
||||
android:name="org.microg.gms.settings.GoogleSettingsProvider"
|
||||
android:authorities="com.google.settings"
|
||||
android:exported="true" />
|
||||
|
||||
android:exported="true"/>
|
||||
<provider
|
||||
android:name="org.microg.gms.feeds.SubscribedFeedsProvider"
|
||||
android:authorities="subscribedfeeds"
|
||||
android:exported="true"
|
||||
android:multiprocess="false"
|
||||
android:readPermission="android.permission.SUBSCRIBED_FEEDS_READ"
|
||||
android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE" />
|
||||
android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE"/>
|
||||
|
||||
<!-- Device Checkin -->
|
||||
|
||||
<service android:name="org.microg.gms.checkin.CheckinService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.checkin.BIND_TO_SERVICE" />
|
||||
<action android:name="com.google.android.gms.checkin.BIND_TO_SERVICE"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name="org.microg.gms.checkin.TriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.server.checkin.CHECKIN" />
|
||||
<action android:name="android.server.checkin.CHECKIN"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
|
||||
|
||||
<category android:name="android.server.checkin.CHECKIN" />
|
||||
<category android:name="android.server.checkin.CHECKIN"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SECRET_CODE" />
|
||||
<action android:name="android.provider.Telephony.SECRET_CODE"/>
|
||||
|
||||
<data
|
||||
android:host="2432546"
|
||||
android:scheme="android_secret_code" />
|
||||
android:scheme="android_secret_code"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
@ -151,49 +155,56 @@
|
||||
android:exported="true"
|
||||
android:permission="com.google.android.c2dm.permission.RECEIVE">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.REGISTER" />
|
||||
<action android:name="com.google.android.c2dm.intent.REGISTER"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.UNREGISTER" />
|
||||
<action android:name="com.google.android.c2dm.intent.UNREGISTER"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name="org.microg.gms.gcm.McsService"
|
||||
android:exported="true" />
|
||||
android:exported="true"/>
|
||||
|
||||
<receiver android:name="org.microg.gms.gcm.TriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="org.microg.gms.gcm.RECONNECT" />
|
||||
<action android:name="org.microg.gms.gcm.RECONNECT"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SECRET_CODE" />
|
||||
<action android:name="android.provider.Telephony.SECRET_CODE"/>
|
||||
|
||||
<data
|
||||
android:host="42678278"
|
||||
android:scheme="android_secret_code" />
|
||||
android:scheme="android_secret_code"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- Map -->
|
||||
<provider
|
||||
android:name="org.microg.gms.maps.data.SharedTileProvider"
|
||||
android:authorities="org.microg.gms.map.tile"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
</provider>
|
||||
|
||||
<!-- DroidGuard -->
|
||||
|
||||
<service
|
||||
android:name="org.microg.gms.droidguard.DroidGuardService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.droidguard.service.START" />
|
||||
<action android:name="com.google.android.gms.droidguard.service.START"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
@ -203,9 +214,9 @@
|
||||
android:name="org.microg.gms.car.CarService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.car.service.START" />
|
||||
<action android:name="com.google.android.gms.car.service.START"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
@ -215,9 +226,9 @@
|
||||
android:name="org.microg.gms.people.PeopleService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.people.service.START" />
|
||||
<action android:name="com.google.android.gms.people.service.START"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
@ -227,7 +238,7 @@
|
||||
android:name="org.microg.gms.wearable.WearableService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.BIND" />
|
||||
<action android:name="com.google.android.gms.wearable.BIND"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
@ -237,18 +248,18 @@
|
||||
android:name="org.microg.gms.auth.loginservice.GoogleLoginService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
<action android:name="android.accounts.AccountAuthenticator"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gsf.action.GET_GLS" />
|
||||
<action android:name="com.google.android.gsf.action.GET_GLS"/>
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.accounts.AccountAuthenticator"
|
||||
android:resource="@xml/authenticator" />
|
||||
android:resource="@xml/authenticator"/>
|
||||
<meta-data
|
||||
android:name="android.accounts.AccountAuthenticator.customTokens"
|
||||
android:value="1" />
|
||||
android:value="1"/>
|
||||
</service>
|
||||
|
||||
<activity
|
||||
@ -256,37 +267,35 @@
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.common.account.CHOOSE_ACCOUNT" />
|
||||
<action android:name="com.google.android.gms.common.account.CHOOSE_ACCOUNT"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="org.microg.gms.auth.login.LoginActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:exported="true"
|
||||
android:theme="@style/LoginBlueTheme">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.auth.login.LOGIN" />
|
||||
<action android:name="com.google.android.gms.auth.login.LOGIN"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="org.microg.gms.auth.AskPermissionActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.AppCompat.Light.Dialog" />
|
||||
android:theme="@style/Theme.AppCompat.Light.Dialog"/>
|
||||
|
||||
<service
|
||||
android:name=".auth.GetToken"
|
||||
android:exported="true" />
|
||||
android:exported="true"/>
|
||||
|
||||
<activity
|
||||
android:name=".auth.TokenActivity"
|
||||
android:exported="true" />
|
||||
android:exported="true"/>
|
||||
|
||||
<!-- Other -->
|
||||
|
||||
@ -294,51 +303,59 @@
|
||||
android:name="org.microg.gms.mdm.NetworkQualityService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.mdm.services.START" />
|
||||
<action android:name="com.google.android.gms.mdm.services.START"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name="org.microg.gms.icing.LightweightIndexService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE" />
|
||||
<action android:name="com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name="org.microg.gms.icing.IndexService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.icing.INDEX_SERVICE" />
|
||||
<action android:name="com.google.android.gms.icing.INDEX_SERVICE"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".analytics.service.AnalyticsService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.analytics.service.START" />
|
||||
<action android:name="com.google.android.gms.analytics.service.START"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name="org.microg.gms.playlog.PlayLogService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.playlog.service.START" />
|
||||
<action android:name="com.google.android.gms.playlog.service.START"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".gcm.http.GoogleHttpService"
|
||||
android:exported="true" />
|
||||
android:exported="true"/>
|
||||
|
||||
<activity
|
||||
android:name="org.microg.gms.ui.SettingsActivity"
|
||||
android:icon="@drawable/ic_microg_app"
|
||||
android:icon="@mipmap/ic_microg_settings"
|
||||
android:label="@string/gms_settings_name"
|
||||
android:theme="@style/SettingsTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.location.settings.LOCATION_HISTORY"/>
|
||||
<action android:name="com.google.android.location.settings.LOCATION_REPORTING_SETTINGS"/>
|
||||
<action android:name="com.google.android.gms.location.settings.LOCATION_REPORTING_SETTINGS"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@ -346,62 +363,58 @@
|
||||
android:name="org.microg.gms.ads.GService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.ads.gservice.START" />
|
||||
<action android:name="com.google.android.gms.ads.gservice.START"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
<service
|
||||
android:name="org.microg.gms.feedback.FeedbackService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.feedback.internal.IFeedbackService" />
|
||||
<action android:name="com.google.android.gms.feedback.internal.IFeedbackService"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name="org.microg.gms.DummyService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.games.service.START" />
|
||||
<action android:name="com.google.android.gms.plus.service.START" />
|
||||
<action android:name="com.google.android.gms.plus.service.internal.START" />
|
||||
<action android:name="com.google.android.gms.panorama.service.START" />
|
||||
<action android:name="com.google.android.gms.wallet.service.BIND" />
|
||||
<action android:name="com.google.android.gms.appstate.service.START" />
|
||||
<action android:name="com.google.android.gms.ads.service.START" />
|
||||
<action android:name="com.google.android.gms.accounts.ACCOUNT_SERVICE" />
|
||||
<action android:name="com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE" />
|
||||
<action android:name="com.google.android.gms.drive.ApiService.START" />
|
||||
<action android:name="com.google.android.gms.identity.service.BIND" />
|
||||
<action android:name="com.google.android.gms.wearable.BIND" />
|
||||
<action android:name="com.google.android.gms.auth.service.START" />
|
||||
<action android:name="com.google.android.gms.fitness.GoogleFitnessService.START" />
|
||||
<action android:name="com.google.android.gms.reminders.service.START" />
|
||||
<action android:name="com.google.android.gms.deviceconnection.service.START" />
|
||||
<action android:name="com.google.android.gms.droidguard.service.START" />
|
||||
<action android:name="com.google.android.gms.lockbox.service.START" />
|
||||
<action android:name="com.google.android.gms.cast_mirroring.service.START" />
|
||||
<action android:name="com.google.android.gms.photos.autobackup.service.START" />
|
||||
<action android:name="com.google.android.gms.udc.service.START" />
|
||||
<action android:name="com.google.android.gms.mdm.services.DeviceManagerApiService.START" />
|
||||
<action android:name="com.google.android.gms.pseudonymous.service.START" />
|
||||
<action android:name="com.google.android.gms.common.service.START" />
|
||||
<action android:name="com.google.android.gms.clearcut.service.START" />
|
||||
<action android:name="com.google.android.gms.usagereporting.service.START" />
|
||||
<action android:name="com.google.android.gms.kids.service.START" />
|
||||
<action android:name="com.google.android.gms.common.download.START" />
|
||||
<action android:name="com.google.android.gms.signin.service.START" />
|
||||
<action android:name="com.google.android.gms.safetynet.service.START" />
|
||||
<action android:name="com.google.android.contextmanager.service.ContextManagerService.START" />
|
||||
<action android:name="com.google.android.gms.audiomodem.service.AudioModemService.START" />
|
||||
<action android:name="com.google.android.gms.nearby.sharing.service.NearbySharingService.START" />
|
||||
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
|
||||
<action android:name="com.google.android.gms.phenotype.service.START" />
|
||||
<action android:name="com.google.android.gms.auth.api.credentials.service.START" />
|
||||
<action android:name="com.google.android.gms.games.service.START"/>
|
||||
<action android:name="com.google.android.gms.plus.service.START"/>
|
||||
<action android:name="com.google.android.gms.plus.service.internal.START"/>
|
||||
<action android:name="com.google.android.gms.panorama.service.START"/>
|
||||
<action android:name="com.google.android.gms.wallet.service.BIND"/>
|
||||
<action android:name="com.google.android.gms.appstate.service.START"/>
|
||||
<action android:name="com.google.android.gms.ads.service.START"/>
|
||||
<action android:name="com.google.android.gms.accounts.ACCOUNT_SERVICE"/>
|
||||
<action android:name="com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"/>
|
||||
<action android:name="com.google.android.gms.drive.ApiService.START"/>
|
||||
<action android:name="com.google.android.gms.identity.service.BIND"/>
|
||||
<action android:name="com.google.android.gms.wearable.BIND"/>
|
||||
<action android:name="com.google.android.gms.auth.service.START"/>
|
||||
<action android:name="com.google.android.gms.fitness.GoogleFitnessService.START"/>
|
||||
<action android:name="com.google.android.gms.reminders.service.START"/>
|
||||
<action android:name="com.google.android.gms.deviceconnection.service.START"/>
|
||||
<action android:name="com.google.android.gms.droidguard.service.START"/>
|
||||
<action android:name="com.google.android.gms.lockbox.service.START"/>
|
||||
<action android:name="com.google.android.gms.cast_mirroring.service.START"/>
|
||||
<action android:name="com.google.android.gms.photos.autobackup.service.START"/>
|
||||
<action android:name="com.google.android.gms.udc.service.START"/>
|
||||
<action android:name="com.google.android.gms.mdm.services.DeviceManagerApiService.START"/>
|
||||
<action android:name="com.google.android.gms.pseudonymous.service.START"/>
|
||||
<action android:name="com.google.android.gms.common.service.START"/>
|
||||
<action android:name="com.google.android.gms.clearcut.service.START"/>
|
||||
<action android:name="com.google.android.gms.usagereporting.service.START"/>
|
||||
<action android:name="com.google.android.gms.kids.service.START"/>
|
||||
<action android:name="com.google.android.gms.common.download.START"/>
|
||||
<action android:name="com.google.android.gms.signin.service.START"/>
|
||||
<action android:name="com.google.android.gms.safetynet.service.START"/>
|
||||
<action android:name="com.google.android.contextmanager.service.ContextManagerService.START"/>
|
||||
<action android:name="com.google.android.gms.audiomodem.service.AudioModemService.START"/>
|
||||
<action android:name="com.google.android.gms.nearby.sharing.service.NearbySharingService.START"/>
|
||||
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"/>
|
||||
<action android:name="com.google.android.gms.phenotype.service.START"/>
|
||||
<action android:name="com.google.android.gms.auth.api.credentials.service.START"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -35,6 +35,7 @@ public abstract class BaseService extends Service {
|
||||
broker = new AbstractGmsServiceBroker(supportedServiceId, supportedServiceIds) {
|
||||
@Override
|
||||
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request) throws RemoteException {
|
||||
request.extras.keySet(); // call to unparcel()
|
||||
Log.d(TAG, "bound by: " + request);
|
||||
BaseService.this.handleServiceRequest(callback, request);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -70,6 +70,13 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
|
||||
boolean notify = extras.getBoolean(KEY_HANDLE_NOTIFICATION, false);
|
||||
|
||||
Log.d(TAG, "getToken: account:" + accountName + " scope:" + scope + " extras:" + extras + ", notify: " + notify);
|
||||
|
||||
/*
|
||||
* TODO: This scope seems to be invalid (according to https://developers.google.com/oauthplayground/),
|
||||
* but is used in some applications anyway. Removing it is unlikely a good solution, but works for now.
|
||||
*/
|
||||
scope = scope.replace("https://www.googleapis.com/auth/identity.plus.page.impersonation ", "");
|
||||
|
||||
AuthManager authManager = new AuthManager(context, accountName, packageName, scope);
|
||||
try {
|
||||
AuthResponse res = authManager.requestAuth(false);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -27,6 +27,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
@ -134,12 +135,6 @@ public class LoginActivity extends AssistantActivity {
|
||||
webView.setLayoutParams(new RelativeLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
webView.setBackgroundColor(Color.TRANSPARENT);
|
||||
webView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
prepareWebViewSettings(webView.getSettings());
|
||||
return webView;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -88,7 +88,7 @@ public class McsService extends IntentService implements Handler.Callback {
|
||||
private PowerManager powerManager;
|
||||
private static PowerManager.WakeLock wakeLock;
|
||||
|
||||
private static int delay = 0;
|
||||
private static long currentDelay = 0;
|
||||
|
||||
private Intent connectIntent;
|
||||
|
||||
@ -131,6 +131,17 @@ public class McsService extends IntentService implements Handler.Callback {
|
||||
return inputStream != null && inputStream.isAlive() && outputStream != null && outputStream.isAlive();
|
||||
}
|
||||
|
||||
public synchronized static long getCurrentDelay() {
|
||||
long delay = currentDelay == 0 ? 5000 : currentDelay;
|
||||
if (currentDelay < 60000) currentDelay += 5000;
|
||||
if (currentDelay >= 60000 && currentDelay < 60000) currentDelay += 60000;
|
||||
return delay;
|
||||
}
|
||||
|
||||
public synchronized static void resetCurrentDelay() {
|
||||
currentDelay = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
synchronized (McsService.class) {
|
||||
@ -151,7 +162,6 @@ public class McsService extends IntentService implements Handler.Callback {
|
||||
}
|
||||
|
||||
private synchronized void connect() {
|
||||
if (delay < 60000) delay += 5000;
|
||||
try {
|
||||
Log.d(TAG, "Starting MCS connection...");
|
||||
Socket socket = new Socket(SERVICE_HOST, SERVICE_PORT);
|
||||
@ -336,7 +346,7 @@ public class McsService extends IntentService implements Handler.Callback {
|
||||
} else {
|
||||
Log.w(TAG, "Unknown message: " + message);
|
||||
}
|
||||
delay = 0;
|
||||
resetCurrentDelay();
|
||||
} catch (Exception e) {
|
||||
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_TEARDOWN, e));
|
||||
}
|
||||
@ -352,10 +362,11 @@ public class McsService extends IntentService implements Handler.Callback {
|
||||
sslSocket.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (delay == 0) {
|
||||
if (currentDelay == 0) {
|
||||
sendBroadcast(new Intent("org.microg.gms.gcm.RECONNECT"), "org.microg.gms.STATUS_BROADCAST");
|
||||
} else {
|
||||
alarmManager.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + delay, PendingIntent.getBroadcast(this, 1, new Intent(this, TriggerReceiver.class), 0));
|
||||
alarmManager.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + getCurrentDelay(),
|
||||
PendingIntent.getBroadcast(this, 1, new Intent("org.microg.gms.gcm.RECONNECT", null, this, TriggerReceiver.class), 0));
|
||||
}
|
||||
alarmManager.cancel(heartbeatIntent);
|
||||
if (wakeLock != null) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -16,10 +16,13 @@
|
||||
|
||||
package org.microg.gms.gcm;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.SystemClock;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.content.WakefulBroadcastReceiver;
|
||||
import android.util.Log;
|
||||
@ -31,22 +34,38 @@ public class TriggerReceiver extends WakefulBroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
boolean force = "android.provider.Telephony.SECRET_CODE".equals(intent.getAction());
|
||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean(PREF_ENABLE_GCM, false) || force) {
|
||||
if (!McsService.isConnected() || force) {
|
||||
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
|
||||
McsService.resetCurrentDelay();
|
||||
}
|
||||
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
||||
if (networkInfo != null && networkInfo.isConnected() || force) {
|
||||
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
||||
if (networkInfo != null && networkInfo.isConnected() || force) {
|
||||
if (!McsService.isConnected() || force) {
|
||||
startWakefulService(context, new Intent(McsService.ACTION_CONNECT, null, context, McsService.class));
|
||||
} else {
|
||||
Log.d(TAG, "Ignoring " + intent + ": network is offline");
|
||||
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
|
||||
Log.d(TAG, "Ignoring " + intent + ": service is running. schedule reconnect instead.");
|
||||
scheduleReconnect(context, alarmManager);
|
||||
} else {
|
||||
Log.d(TAG, "Ignoring " + intent + ": service is running. heartbeat instead.");
|
||||
startWakefulService(context, new Intent(McsService.ACTION_HEARTBEAT, null, context, McsService.class));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "Ignoring " + intent + ": service is running");
|
||||
Log.d(TAG, "Ignoring " + intent + ": network is offline, scheduling new attempt.");
|
||||
scheduleReconnect(context, alarmManager);
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "Ignoring " + intent + ": gcm is disabled");
|
||||
}
|
||||
}
|
||||
|
||||
private void scheduleReconnect(Context context, AlarmManager alarmManager) {
|
||||
alarmManager.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + McsService.getCurrentDelay(),
|
||||
PendingIntent.getBroadcast(context, 1, new Intent("org.microg.gms.gcm.RECONNECT", null, context, TriggerReceiver.class), 0));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -16,24 +16,30 @@
|
||||
|
||||
package org.microg.gms.location;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
|
||||
import com.google.android.gms.location.ILocationListener;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.internal.LocationRequestUpdateData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||
import static android.location.LocationManager.GPS_PROVIDER;
|
||||
import static android.location.LocationManager.NETWORK_PROVIDER;
|
||||
import static com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY;
|
||||
import static com.google.android.gms.location.LocationRequest.PRIORITY_NO_POWER;
|
||||
|
||||
public class GoogleLocationManager implements LocationChangeListener {
|
||||
private static final String MOCK_PROVIDER = "mock";
|
||||
private static final long SWITCH_ON_FRESHNESS_CLIFF_MS = 30000; // 30 seconds
|
||||
private static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION";
|
||||
|
||||
private Context context;
|
||||
private LocationManager locationManager;
|
||||
@ -69,8 +75,7 @@ public class GoogleLocationManager implements LocationChangeListener {
|
||||
return network;
|
||||
} else if (networkPermission) {
|
||||
Location network = networkProvider.getLastLocation();
|
||||
if (network != null && network.getExtras() != null &&
|
||||
network.getExtras().getParcelable("no_gps_location") instanceof Location) {
|
||||
if (network != null && network.getExtras() != null && network.getExtras().getParcelable("no_gps_location") instanceof Location) {
|
||||
network = network.getExtras().getParcelable("no_gps_location");
|
||||
}
|
||||
return network;
|
||||
@ -79,42 +84,35 @@ public class GoogleLocationManager implements LocationChangeListener {
|
||||
}
|
||||
|
||||
private boolean hasCoarseLocationPermission() {
|
||||
return context.checkCallingPermission(Manifest.permission.ACCESS_COARSE_LOCATION) ==
|
||||
PackageManager.PERMISSION_GRANTED || hasFineLocationPermission();
|
||||
return context.checkCallingPermission(ACCESS_COARSE_LOCATION) == PERMISSION_GRANTED || hasFineLocationPermission();
|
||||
}
|
||||
|
||||
private boolean hasFineLocationPermission() {
|
||||
return context.checkCallingPermission(Manifest.permission.ACCESS_FINE_LOCATION) ==
|
||||
PackageManager.PERMISSION_GRANTED;
|
||||
return context.checkCallingPermission(ACCESS_FINE_LOCATION) == PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
private boolean hasMockLocationPermission() {
|
||||
return context.checkCallingPermission(Manifest.permission.ACCESS_MOCK_LOCATION) ==
|
||||
PackageManager.PERMISSION_GRANTED;
|
||||
return context.checkCallingPermission(ACCESS_MOCK_LOCATION) == PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
private void requestLocationUpdates(LocationRequestHelper request) {
|
||||
currentRequests.add(request);
|
||||
if (request.hasFinePermission &&
|
||||
request.locationRequest.getPriority() == LocationRequest.PRIORITY_HIGH_ACCURACY)
|
||||
if (request.hasFinePermission && request.locationRequest.getPriority() == PRIORITY_HIGH_ACCURACY)
|
||||
gpsProvider.addRequest(request);
|
||||
if (request.hasCoarsePermission &&
|
||||
request.locationRequest.getPriority() != LocationRequest.PRIORITY_NO_POWER)
|
||||
if (request.hasCoarsePermission && request.locationRequest.getPriority() != PRIORITY_NO_POWER)
|
||||
networkProvider.addRequest(request);
|
||||
}
|
||||
|
||||
public void requestLocationUpdates(LocationRequest request, ILocationListener listener,
|
||||
String packageName) {
|
||||
requestLocationUpdates(
|
||||
new LocationRequestHelper(context, request, hasFineLocationPermission(),
|
||||
hasCoarseLocationPermission(), packageName, listener));
|
||||
String packageName) {
|
||||
requestLocationUpdates(new LocationRequestHelper(context, request, hasFineLocationPermission(),
|
||||
hasCoarseLocationPermission(), packageName, listener));
|
||||
}
|
||||
|
||||
public void requestLocationUpdates(LocationRequest request, PendingIntent intent,
|
||||
String packageName) {
|
||||
requestLocationUpdates(
|
||||
new LocationRequestHelper(context, request, hasFineLocationPermission(),
|
||||
hasCoarseLocationPermission(), packageName, intent));
|
||||
String packageName) {
|
||||
requestLocationUpdates(new LocationRequestHelper(context, request, hasFineLocationPermission(),
|
||||
hasCoarseLocationPermission(), packageName, intent));
|
||||
}
|
||||
|
||||
private void removeLocationUpdates(LocationRequestHelper request) {
|
||||
@ -141,6 +139,21 @@ public class GoogleLocationManager implements LocationChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateLocationRequest(LocationRequestUpdateData data) {
|
||||
if (data.opCode == LocationRequestUpdateData.REQUEST_UPDATES) {
|
||||
requestLocationUpdates(new LocationRequestHelper(context, hasFineLocationPermission(), hasCoarseLocationPermission(), null, data));
|
||||
} else if (data.opCode == LocationRequestUpdateData.REMOVE_UPDATES) {
|
||||
for (int i = 0; i < currentRequests.size(); i++) {
|
||||
if (currentRequests.get(i).respondsTo(data.listener)
|
||||
|| currentRequests.get(i).respondsTo(data.pendingIntent)
|
||||
|| currentRequests.get(i).respondsTo(data.callback)) {
|
||||
removeLocationUpdates(currentRequests.get(i));
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setMockMode(boolean mockMode) {
|
||||
if (!hasMockLocationPermission())
|
||||
return;
|
||||
@ -157,8 +170,7 @@ public class GoogleLocationManager implements LocationChangeListener {
|
||||
public void onLocationChanged() {
|
||||
for (int i = 0; i < currentRequests.size(); i++) {
|
||||
LocationRequestHelper request = currentRequests.get(i);
|
||||
if (!request
|
||||
.report(getLocation(request.hasFinePermission, request.hasCoarsePermission))) {
|
||||
if (!request.report(getLocation(request.hasFinePermission, request.hasCoarsePermission))) {
|
||||
removeLocationUpdates(request);
|
||||
i--;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,8 +25,6 @@ import org.microg.gms.BaseService;
|
||||
import org.microg.gms.common.Services;
|
||||
|
||||
public class GoogleLocationManagerService extends BaseService {
|
||||
private static final String TAG = "GmsLocManagerSvc";
|
||||
|
||||
private GoogleLocationManagerServiceImpl impl = new GoogleLocationManagerServiceImpl(this);
|
||||
|
||||
public GoogleLocationManagerService() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -20,22 +20,37 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.location.ActivityRecognitionResult;
|
||||
import com.google.android.gms.location.Geofence;
|
||||
import com.google.android.gms.location.GeofencingRequest;
|
||||
import com.google.android.gms.location.GestureRequest;
|
||||
import com.google.android.gms.location.ILocationListener;
|
||||
import com.google.android.gms.location.LocationAvailability;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.LocationStatus;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.internal.IGeofencerCallbacks;
|
||||
import com.google.android.gms.location.internal.IGoogleLocationManagerService;
|
||||
import com.google.android.gms.location.ILocationListener;
|
||||
import com.google.android.gms.location.internal.ISettingsCallback;
|
||||
import com.google.android.gms.location.internal.LocationRequestInternal;
|
||||
import com.google.android.gms.location.places.*;
|
||||
import com.google.android.gms.location.internal.LocationRequestUpdateData;
|
||||
import com.google.android.gms.location.places.AutocompleteFilter;
|
||||
import com.google.android.gms.location.places.NearbyAlertRequest;
|
||||
import com.google.android.gms.location.places.PlaceFilter;
|
||||
import com.google.android.gms.location.places.PlaceReport;
|
||||
import com.google.android.gms.location.places.PlaceRequest;
|
||||
import com.google.android.gms.location.places.UserAddedPlace;
|
||||
import com.google.android.gms.location.places.UserDataType;
|
||||
import com.google.android.gms.location.places.internal.IPlacesCallbacks;
|
||||
import com.google.android.gms.location.places.internal.PlacesParams;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerService.Stub {
|
||||
@ -56,30 +71,30 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void addGeofencesList(List<Geofence> geofences, PendingIntent pendingIntent,
|
||||
IGeofencerCallbacks callbacks, String packageName) throws RemoteException {
|
||||
IGeofencerCallbacks callbacks, String packageName) throws RemoteException {
|
||||
Log.d(TAG, "addGeofencesList: " + geofences);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeGeofencesByIntent(PendingIntent pendingIntent, IGeofencerCallbacks callbacks,
|
||||
String packageName) throws RemoteException {
|
||||
String packageName) throws RemoteException {
|
||||
Log.d(TAG, "removeGeofencesByIntent: " + pendingIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeGeofencesById(String[] geofenceRequestIds, IGeofencerCallbacks callbacks,
|
||||
String packageName) throws RemoteException {
|
||||
Log.d(TAG, "removeGeofencesById: " + geofenceRequestIds);
|
||||
String packageName) throws RemoteException {
|
||||
Log.d(TAG, "removeGeofencesById: " + Arrays.toString(geofenceRequestIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iglms4(IGeofencerCallbacks callbacks, String packageName) throws RemoteException {
|
||||
Log.d(TAG, "iglms4: " + packageName);
|
||||
public void removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) throws RemoteException {
|
||||
Log.d(TAG, "removeAllGeofences");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue,
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
Log.d(TAG, "requestActivityUpdates: " + callbackIntent);
|
||||
}
|
||||
|
||||
@ -88,6 +103,36 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
Log.d(TAG, "removeActivityUpdates: " + callbackIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityRecognitionResult getLastActivity(String packageName) throws RemoteException {
|
||||
Log.d(TAG, "getLastActivity");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Status iglms65(PendingIntent pendingIntent) throws RemoteException {
|
||||
Log.d(TAG, "iglms65");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Status iglms66(PendingIntent pendingIntent) throws RemoteException {
|
||||
Log.d(TAG, "iglms66");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Status requestGestureUpdates(GestureRequest request, PendingIntent pendingIntent) throws RemoteException {
|
||||
Log.d(TAG, "requestGestureUpdates");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Status iglms61(PendingIntent pendingIntent) throws RemoteException {
|
||||
Log.d(TAG, "iglms61");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLastLocation() throws RemoteException {
|
||||
Log.d(TAG, "getLastLocation");
|
||||
@ -96,14 +141,14 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void requestLocationUpdatesWithListener(LocationRequest request,
|
||||
final ILocationListener listener) throws RemoteException {
|
||||
final ILocationListener listener) throws RemoteException {
|
||||
Log.d(TAG, "requestLocationUpdatesWithListener: " + request);
|
||||
getLocationManager().requestLocationUpdates(request, listener, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestLocationUpdatesWithIntent(LocationRequest request,
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
Log.d(TAG, "requestLocationUpdatesWithIntent: " + request);
|
||||
getLocationManager().requestLocationUpdates(request, callbackIntent, null);
|
||||
}
|
||||
@ -122,6 +167,12 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
getLocationManager().removeLocationUpdates(callbackIntent, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLocationRequest(LocationRequestUpdateData locationRequestUpdateData) throws RemoteException {
|
||||
Log.d(TAG, "updateLocationRequest: " + locationRequestUpdateData);
|
||||
getLocationManager().updateLocationRequest(locationRequestUpdateData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMockMode(boolean mockMode) throws RemoteException {
|
||||
Log.d(TAG, "setMockMode: " + mockMode);
|
||||
@ -136,7 +187,7 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void iglms14(LatLngBounds var1, int var2, PlaceFilter var3, PlacesParams var4,
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
Log.d(TAG, "iglms14: " + var1);
|
||||
}
|
||||
|
||||
@ -171,7 +222,7 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void requestLocationUpdatesWithPackage(LocationRequest request, ILocationListener listener,
|
||||
String packageName) throws RemoteException {
|
||||
String packageName) throws RemoteException {
|
||||
Log.d(TAG, "requestLocationUpdatesWithPackage: " + request);
|
||||
getLocationManager().requestLocationUpdates(request, listener, packageName);
|
||||
}
|
||||
@ -193,7 +244,7 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocationStatus iglms34(String var1) throws RemoteException {
|
||||
public LocationAvailability iglms34(String var1) throws RemoteException {
|
||||
Log.d(TAG, "iglms34: " + var1);
|
||||
return null;
|
||||
}
|
||||
@ -212,7 +263,7 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void iglms47(LatLngBounds var1, int var2, String var3, PlaceFilter var4,
|
||||
PlacesParams var5, IPlacesCallbacks var6) throws RemoteException {
|
||||
PlacesParams var5, IPlacesCallbacks var6) throws RemoteException {
|
||||
Log.d(TAG, "iglms47: " + var1);
|
||||
}
|
||||
|
||||
@ -229,7 +280,7 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void iglms50(UserDataType var1, LatLngBounds var2, List var3, PlacesParams var4,
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
Log.d(TAG, "iglms50: " + var1);
|
||||
}
|
||||
|
||||
@ -239,15 +290,20 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iglms63(LocationSettingsRequest settingsRequest, ISettingsCallback callback, String packageName) throws RemoteException {
|
||||
Log.d(TAG, "iglms63");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestLocationUpdatesInternalWithListener(LocationRequestInternal request,
|
||||
ILocationListener listener) throws RemoteException {
|
||||
ILocationListener listener) throws RemoteException {
|
||||
Log.d(TAG, "requestLocationUpdatesInternalWithListener: " + request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestLocationUpdatesInternalWithIntent(LocationRequestInternal request,
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
PendingIntent callbackIntent) throws RemoteException {
|
||||
Log.d(TAG, "requestLocationUpdatesInternalWithIntent: " + request);
|
||||
}
|
||||
|
||||
@ -259,19 +315,26 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ
|
||||
|
||||
@Override
|
||||
public void iglms55(String var1, LatLngBounds var2, AutocompleteFilter var3, PlacesParams var4,
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
Log.d(TAG, "iglms54: " + var1);
|
||||
IPlacesCallbacks var5) throws RemoteException {
|
||||
Log.d(TAG, "iglms55: " + var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGeofences(GeofencingRequest geofencingRequest, PendingIntent pendingIntent,
|
||||
IGeofencerCallbacks callbacks) throws RemoteException {
|
||||
IGeofencerCallbacks callbacks) throws RemoteException {
|
||||
Log.d(TAG, "addGeofences: " + geofencingRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iglms58(List var1, PlacesParams var2, IPlacesCallbacks var3)
|
||||
throws RemoteException {
|
||||
Log.d(TAG, "iglms54: " + var1);
|
||||
Log.d(TAG, "iglms58: " + var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
||||
if (super.onTransact(code, data, reply, flags)) return true;
|
||||
Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -22,8 +22,15 @@ import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.location.ILocationCallback;
|
||||
import com.google.android.gms.location.ILocationListener;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.LocationResult;
|
||||
import com.google.android.gms.location.internal.LocationRequestUpdateData;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class LocationRequestHelper {
|
||||
public static final String TAG = "GmsLocRequestHelper";
|
||||
@ -34,32 +41,40 @@ public class LocationRequestHelper {
|
||||
public final String packageName;
|
||||
private ILocationListener listener;
|
||||
private PendingIntent pendingIntent;
|
||||
private ILocationCallback callback;
|
||||
|
||||
private Location lastReport;
|
||||
private int numReports = 0;
|
||||
|
||||
public LocationRequestHelper(Context context, LocationRequest locationRequest,
|
||||
boolean hasFinePermission, boolean hasCoarsePermission, String packageName,
|
||||
ILocationListener listener) {
|
||||
private LocationRequestHelper(Context context, LocationRequest locationRequest, boolean hasFinePermission,
|
||||
boolean hasCoarsePermission, String packageName) {
|
||||
this.context = context;
|
||||
this.locationRequest = locationRequest;
|
||||
this.hasFinePermission = hasFinePermission;
|
||||
this.hasCoarsePermission = hasCoarsePermission;
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
public LocationRequestHelper(Context context, LocationRequest locationRequest, boolean hasFinePermission,
|
||||
boolean hasCoarsePermission, String packageName, ILocationListener listener) {
|
||||
this(context, locationRequest, hasFinePermission, hasCoarsePermission, packageName);
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public LocationRequestHelper(Context context, LocationRequest locationRequest,
|
||||
boolean hasFinePermission, boolean hasCoarsePermission, String packageName,
|
||||
PendingIntent pendingIntent) {
|
||||
this.context = context;
|
||||
this.locationRequest = locationRequest;
|
||||
this.hasFinePermission = hasFinePermission;
|
||||
this.hasCoarsePermission = hasCoarsePermission;
|
||||
this.packageName = packageName;
|
||||
public LocationRequestHelper(Context context, LocationRequest locationRequest, boolean hasFinePermission,
|
||||
boolean hasCoarsePermission, String packageName, PendingIntent pendingIntent) {
|
||||
this(context, locationRequest, hasFinePermission, hasCoarsePermission, packageName);
|
||||
this.pendingIntent = pendingIntent;
|
||||
}
|
||||
|
||||
public LocationRequestHelper(Context context, boolean hasFinePermission, boolean hasCoarsePermission,
|
||||
String packageName, LocationRequestUpdateData data) {
|
||||
this(context, data.request.request, hasFinePermission, hasCoarsePermission, packageName);
|
||||
this.listener = data.listener;
|
||||
this.pendingIntent = data.pendingIntent;
|
||||
this.callback = data.callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether to continue sending reports to this {@link LocationRequestHelper}
|
||||
*/
|
||||
@ -87,6 +102,12 @@ public class LocationRequestHelper {
|
||||
} catch (PendingIntent.CanceledException e) {
|
||||
return false;
|
||||
}
|
||||
} else if (callback != null) {
|
||||
try {
|
||||
callback.onLocationResult(LocationResult.create(Arrays.asList(location)));
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
lastReport = location;
|
||||
numReports++;
|
||||
@ -109,7 +130,42 @@ public class LocationRequestHelper {
|
||||
this.listener.asBinder().equals(listener.asBinder());
|
||||
}
|
||||
|
||||
public boolean respondsTo(ILocationCallback callback) {
|
||||
return this.callback != null && callback != null &&
|
||||
this.callback.asBinder().equals(callback.asBinder());
|
||||
}
|
||||
|
||||
public boolean respondsTo(PendingIntent pendingIntent) {
|
||||
return this.pendingIntent != null && this.pendingIntent.equals(pendingIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
LocationRequestHelper that = (LocationRequestHelper) o;
|
||||
|
||||
if (hasFinePermission != that.hasFinePermission) return false;
|
||||
if (hasCoarsePermission != that.hasCoarsePermission) return false;
|
||||
if (!locationRequest.equals(that.locationRequest)) return false;
|
||||
if (packageName != null ? !packageName.equals(that.packageName) : that.packageName != null) return false;
|
||||
if (listener != null ? !listener.equals(that.listener) : that.listener != null) return false;
|
||||
if (pendingIntent != null ? !pendingIntent.equals(that.pendingIntent) : that.pendingIntent != null)
|
||||
return false;
|
||||
return !(callback != null ? !callback.equals(that.callback) : that.callback != null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = locationRequest.hashCode();
|
||||
result = 31 * result + (hasFinePermission ? 1 : 0);
|
||||
result = 31 * result + (hasCoarsePermission ? 1 : 0);
|
||||
result = 31 * result + (packageName != null ? packageName.hashCode() : 0);
|
||||
result = 31 * result + (listener != null ? listener.hashCode() : 0);
|
||||
result = 31 * result + (pendingIntent != null ? pendingIntent.hashCode() : 0);
|
||||
result = 31 * result + (callback != null ? callback.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,13 +17,37 @@
|
||||
package org.microg.gms.location;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import com.google.android.gms.location.places.PlaceReport;
|
||||
import com.google.android.gms.location.reporting.ReportingState;
|
||||
import com.google.android.gms.location.reporting.UploadRequest;
|
||||
import com.google.android.gms.location.reporting.UploadRequestResult;
|
||||
import com.google.android.gms.location.reporting.internal.IReportingService;
|
||||
|
||||
public class ReportingServiceImpl extends IReportingService.Stub {
|
||||
public ReportingState unknown3(Account account) {
|
||||
|
||||
@Override
|
||||
public ReportingState getReportingState(Account account) throws RemoteException {
|
||||
return new ReportingState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tryOptIn(Account account) throws RemoteException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadRequestResult requestUpload(UploadRequest request) throws RemoteException {
|
||||
return new UploadRequestResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cancelUploadRequest(long l) throws RemoteException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reportDeviceAtPlace(Account account, PlaceReport report) throws RemoteException {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 µg Project Team
|
||||
* Copyright 2013-2015 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.4 KiB |
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright 2013-2015 µg Project Team
|
||||
~ Copyright 2013-2015 microG Project Team
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright 2013-2015 µg Project Team
|
||||
~ Copyright 2013-2015 microG Project Team
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright 2013-2015 µg Project Team
|
||||
~ Copyright 2013-2015 microG Project Team
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user