Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdc5fc0b authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Implement more People APIs and add some stubs

parent 3274300c
Loading
Loading
Loading
Loading
Compare c0c4a78e to c43facae
Original line number Diff line number Diff line
Subproject commit c0c4a78eab3064cdd7545cb7fcdddfe93ca1674d
Subproject commit c43facae3dba6fcf4139c6a36e3a6f364d6db057
+14 −2
Original line number Diff line number Diff line
@@ -148,6 +148,10 @@
            android:name="org.microg.gms.gcm.mcs.McsService"
            android:exported="true" />

        <service
            android:name="com.google.android.gms.gcm.http.GoogleHttpService"
            android:exported="true" />

        <!-- DroidGuard -->

        <service
@@ -228,10 +232,10 @@
            android:excludeFromRecents="true" />

        <service
            android:name=".auth.GetToken"
            android:name="com.google.android.gms.auth.GetToken"
            android:exported="true" />
        <activity
            android:name=".auth.TokenActivity"
            android:name="com.google.android.gms.auth.TokenActivity"
            android:exported="true" />

        <!-- Other -->
@@ -268,5 +272,13 @@
                <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" />
            </intent-filter>
        </service>
    </application>
</manifest>
+37 −0
Original line number Diff line number Diff line
/*
 * 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 com.google.android.gms.gcm.http;

import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;

import com.google.android.gms.http.IGoogleHttpService;

public class GoogleHttpService extends Service {
    @Override
    public IBinder onBind(Intent intent) {
        return new IGoogleHttpService.Stub() {
            @Override
            public Bundle checkUrl(String url) throws RemoteException {
                return null; // allow
            }
        }.asBinder();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class AskPermissionActivity extends AccountAuthenticatorActivity {
        }
        CharSequence appLabel = packageManager.getApplicationLabel(applicationInfo);
        Drawable appIcon = packageManager.getApplicationIcon(applicationInfo);
        Bitmap profileIcon = PeopleManager.getUserPicture(this, account, false);
        Bitmap profileIcon = PeopleManager.getOwnerAvatarBitmap(this, account.name, false);

        // receive profile icon
        if (profileIcon != null) {
@@ -114,7 +114,7 @@ public class AskPermissionActivity extends AccountAuthenticatorActivity {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    final Bitmap profileIcon = PeopleManager.getUserPicture(AskPermissionActivity.this, account, true);
                    final Bitmap profileIcon = PeopleManager.getOwnerAvatarBitmap(AskPermissionActivity.this, account.name, true);
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
+22 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {
    private static final int DB_VERSION = 1;
    private static final int DB_VERSION = 2;
    private static final String DB_NAME = "pluscontacts.db";
    private static final String CREATE_OWNERS = "CREATE TABLE owners (" +
            "_id INTEGER PRIMARY KEY AUTOINCREMENT," +
@@ -47,7 +47,21 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            "sync_circles_to_contacts INTEGER NOT NULL DEFAULT 0," + // 0
            "sync_evergreen_to_contacts INTEGER NOT NULL DEFAULT 0," + // 0
            "last_full_people_sync_time INTEGER NOT NULL DEFAULT 0);"; // timestamp
    private static final String CREATE_CIRCLES = "CREATE TABLE circles (" +
            "_id INTEGER PRIMARY KEY AUTOINCREMENT," +
            "owner_id INTEGER NOT NULL," +
            "circle_id TEXT NOT NULL," +
            "name TEXT,sort_key TEXT," +
            "type INTEGER NOT NULL," +
            "for_sharing INTEGER NOT NULL DEFAULT 0," +
            "people_count INTEGER NOT NULL DEFAULT -1," +
            "client_policies INTEGER NOT NULL DEFAULT 0," +
            "etag TEXT,last_modified INTEGER NOT NULL DEFAULT 0," +
            "sync_to_contacts INTEGER NOT NULL DEFAULT 0," +
            "UNIQUE (owner_id,circle_id)," +
            "FOREIGN KEY (owner_id) REFERENCES owners(_id) ON DELETE CASCADE);";
    public static final String OWNERS_TABLE = "owners";
    public static final String CIRCLES_TABLE = "circles";


    public DatabaseHelper(Context context) {
@@ -61,7 +75,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

        if (oldVersion < 2) db.execSQL(CREATE_CIRCLES);
    }

    @Override
@@ -80,4 +94,10 @@ public class DatabaseHelper extends SQLiteOpenHelper {
    public Cursor getOwner(String accountName) {
        return getReadableDatabase().query(OWNERS_TABLE, null, "account_name=?", new String[]{accountName}, null, null, null);
    }

    public Cursor getCircles(int ownerId, String circleId, int type) {
        return getReadableDatabase().query(CIRCLES_TABLE, null,
                "owner_id=?1 AND (circle_id = ?2 OR ?2 = '') AND (type = ?3 OR ?3 = -999 OR (?3 = -998 AND type = -1))",
                new String[]{Integer.toString(ownerId), circleId != null ? circleId : "", Integer.toString(type)}, null, null, null);
    }
}
Loading