Fix Reporting service

This commit is contained in:
mar-v-in 2015-03-02 03:12:37 +01:00
parent 63f99df4a6
commit c1d882abaa
4 changed files with 47 additions and 3 deletions

2
GmsApi

@ -1 +1 @@
Subproject commit 6020cd818a17d1d38a85157b0d44e3505fe791ee
Subproject commit c29a2cbc8937b6e41d125aab34328c988d99e345

View File

@ -18,15 +18,30 @@ package org.microg.gms.location;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import com.google.android.gms.common.internal.IGmsCallbacks;
import org.microg.gms.AbstractGmsServiceBroker;
public class ReportingAndroidService extends Service {
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
public IBinder onBind(Intent intent) {
Log.d(TAG, "onBind: " + intent);
return null;
return broker.asBinder();
}
}

View 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();
}
}

View File

@ -99,7 +99,7 @@ public class ProfileManager {
byte[] bytes = Utils.readStreamToEnd(conn.getInputStream());
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
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;
} catch (Exception e) {
Log.w(TAG, e);