mirror of
https://github.com/YTVanced/VancedMicroG
synced 2025-01-06 23:41:01 +00:00
Beginning PeopleService
This commit is contained in:
parent
c1d882abaa
commit
31d7aa58aa
4 changed files with 53 additions and 2 deletions
|
@ -44,6 +44,7 @@
|
|||
<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" />
|
||||
|
||||
|
|
2
GmsApi
2
GmsApi
|
@ -1 +1 @@
|
|||
Subproject commit c29a2cbc8937b6e41d125aab34328c988d99e345
|
||||
Subproject commit adb160c25bf23be73738a732c94b903db41a338d
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.microg.gms.icing;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.appdatasearch.UsageInfo;
|
||||
|
@ -30,4 +32,11 @@ public class LightweightAppDataSearchImpl extends ILightweightAppDataSearch.Stub
|
|||
public void view(ILightweightAppDataSearchCallbacks callbacks, String packageName, UsageInfo[] usageInfos) {
|
||||
Log.d(TAG, "view: " + Arrays.toString(usageInfos));
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,12 +16,53 @@
|
|||
|
||||
package org.microg.gms.people;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.common.data.DataHolder;
|
||||
import com.google.android.gms.people.internal.IPeopleCallbacks;
|
||||
import com.google.android.gms.people.internal.IPeopleService;
|
||||
import com.google.android.gms.people.model.AccountMetadata;
|
||||
|
||||
public class PeopleServiceImpl extends IPeopleService.Stub {
|
||||
private static final String TAG = "GmsPeopleSvcImpl";
|
||||
private Context context;
|
||||
|
||||
public PeopleServiceImpl(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadOwners(final IPeopleCallbacks callbacks, boolean var2, boolean var3, final String accountName, String var5, int sortOrder) {
|
||||
Log.d(TAG, "loadOwners: " + var2 + ", " + var3 + ", " + accountName + ", " + var5 + ", " + sortOrder);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AccountManager accountManager = AccountManager.get(context);
|
||||
Bundle result = new Bundle();
|
||||
for (Account account : accountManager.getAccountsByType("com.google")) {
|
||||
if (accountName == null || account.name.equals(accountName)) {
|
||||
result.putParcelable(account.name, new AccountMetadata());
|
||||
}
|
||||
}
|
||||
try {
|
||||
callbacks.onDataHolders(0, result, new DataHolder[0]);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue