Commit e956a479 by Kim Jinsung

Task #49686 GooglePlayアプリ削除対応

parent fcb590d1
...@@ -26,11 +26,6 @@ ...@@ -26,11 +26,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- GCM -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- QRCode --> <!-- QRCode -->
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/> <uses-permission android:name="android.permission.FLASHLIGHT"/>
......
package jp.agentec.abook.abv.ui.common.util;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.content.Context;
public class SystemServiceUtil {
/**
* Deviceに関連付けられているアカウント(Gmailアドレス)を返す
* (最初のものをそれとみなす)
* ※マニフェストにPermissionが必要
*
* @return
*/
public static final String getPrimaryAccount(Activity activity) {
Account[] accounts = ((AccountManager) activity.getSystemService(Context.ACCOUNT_SERVICE)).getAccountsByType("com.google");
if(accounts.length > 0) {
return accounts[0].name;
}
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment