mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-08 16:56:48 +01:00
Fix Reporting service
This commit is contained in:
parent
63f99df4a6
commit
c1d882abaa
2
GmsApi
2
GmsApi
@ -1 +1 @@
|
|||||||
Subproject commit 6020cd818a17d1d38a85157b0d44e3505fe791ee
|
Subproject commit c29a2cbc8937b6e41d125aab34328c988d99e345
|
@ -18,15 +18,30 @@ package org.microg.gms.location;
|
|||||||
|
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.os.RemoteException;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.android.gms.common.internal.IGmsCallbacks;
|
||||||
|
|
||||||
|
import org.microg.gms.AbstractGmsServiceBroker;
|
||||||
|
|
||||||
public class ReportingAndroidService extends Service {
|
public class ReportingAndroidService extends Service {
|
||||||
private static final String TAG = "GmsLocReportingSvc";
|
private static final String TAG = "GmsLocReportingSvc";
|
||||||
|
|
||||||
|
private ReportingServiceImpl reportingService = new ReportingServiceImpl();
|
||||||
|
private AbstractGmsServiceBroker broker = new AbstractGmsServiceBroker() {
|
||||||
|
@Override
|
||||||
|
public void getReportingService(IGmsCallbacks callback, int versionCode, String packageName, Bundle params) throws RemoteException {
|
||||||
|
Log.d(TAG, "bound by: " + packageName);
|
||||||
|
callback.onPostInitComplete(0, reportingService, null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
Log.d(TAG, "onBind: " + intent);
|
Log.d(TAG, "onBind: " + intent);
|
||||||
return null;
|
return broker.asBinder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
src/org/microg/gms/location/ReportingServiceImpl.java
Normal file
29
src/org/microg/gms/location/ReportingServiceImpl.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013-2015 µg Project Team
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.microg.gms.location;
|
||||||
|
|
||||||
|
import android.accounts.Account;
|
||||||
|
|
||||||
|
import com.google.android.gms.location.reporting.ReportingState;
|
||||||
|
import com.google.android.gms.location.reporting.internal.IReportingService;
|
||||||
|
|
||||||
|
public class ReportingServiceImpl extends IReportingService.Stub {
|
||||||
|
public ReportingState unknown3(Account account) {
|
||||||
|
|
||||||
|
return new ReportingState();
|
||||||
|
}
|
||||||
|
}
|
@ -99,7 +99,7 @@ public class ProfileManager {
|
|||||||
byte[] bytes = Utils.readStreamToEnd(conn.getInputStream());
|
byte[] bytes = Utils.readStreamToEnd(conn.getInputStream());
|
||||||
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
||||||
if (bitmap != null)
|
if (bitmap != null)
|
||||||
preferences.edit().putString("profile_picture", Base64.encodeToString(bytes, Base64.DEFAULT)).commit();
|
preferences.edit().putString("profile_picture", Base64.encodeToString(bytes, Base64.DEFAULT)).apply();
|
||||||
return bitmap;
|
return bitmap;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user