summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-01-23 23:50:47 +0100
committerZhao Wei Liew <zhaoweiliew@gmail.com>2017-02-18 11:38:01 +0800
commit4ab4cb96b78d8d09a0b8302a0edb2af6a62fba0e (patch)
treef413c59f1e354645d569b1ec9ecc71e3ac5fb8fb
parent10f91eefaa3f5793fbe9a4100b87ed1f9500bc8f (diff)
downloadpackages_apps_SetupWizard-4ab4cb96b78d8d09a0b8302a0edb2af6a62fba0e.zip
packages_apps_SetupWizard-4ab4cb96b78d8d09a0b8302a0edb2af6a62fba0e.tar.gz
packages_apps_SetupWizard-4ab4cb96b78d8d09a0b8302a0edb2af6a62fba0e.tar.bz2
Remove Google Play Services dependency
PS2: inline hasGms usage, don't use addprefix for a single entry, remove unused imports Change-Id: I1eb1fb76e4b80e26992599e3511d265abbfa1cd7
-rw-r--r--Android.mk12
-rw-r--r--AndroidManifest.xml3
-rw-r--r--proguard.flags13
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java5
-rw-r--r--src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java7
5 files changed, 8 insertions, 32 deletions
diff --git a/Android.mk b/Android.mk
index 9458ef0..4bb758d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,19 +14,15 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-v4 \
android-support-v13 \
- play \
libphonenumber \
org.cyanogenmod.platform.sdk
-LOCAL_JAVA_LIBRARIES := telephony-common
+LOCAL_JAVA_LIBRARIES := \
+ org.cyanogenmod.platform.internal \
+ telephony-common
-# Include res dir from chips
-google_play_dir := ../../../external/google/google_play_services/libproject/google-play-services_lib/res
-res_dir := $(google_play_dir) res
-
-LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_AAPT_FLAGS := --auto-add-overlay
-LOCAL_AAPT_FLAGS += --extra-packages com.google.android.gms
include frameworks/opt/setupwizard/library/common.mk
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9bd0603..f45029e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -69,9 +69,6 @@
android:taskAffinity="com.android.wizard"
android:name=".SetupWizardApp">
- <meta-data android:name="com.google.android.gms.version"
- android:value="@integer/google_play_services_version" />
-
<activity android:name=".ui.SetupWizardActivity"
android:label="@string/product_name"
android:launchMode="singleInstance"
diff --git a/proguard.flags b/proguard.flags
index cae5d2c..5684616 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -2,18 +2,6 @@
protected Object[][] getContents();
}
-# Keep SafeParcelable value, needed for reflection. This is required to support backwards
-# compatibility of some classes.
--keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
- public static final *** NULL;
-}
-
-# Keep the names of classes/members we need for client functionality.
--keepnames @com.google.android.gms.common.annotation.KeepName class *
--keepclassmembernames class * {
- @com.google.android.gms.common.annotation.KeepName *;
-}
-
# Needed for Parcelable/SafeParcelable Creators to not get stripped
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
@@ -22,4 +10,3 @@
# Needed when building against the Marshmallow SDK
-dontwarn org.apache.http.**
-dontwarn android.support.**
--dontwarn com.google.android.gms.** \ No newline at end of file
diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
index 3226044..4674b1f 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
@@ -29,6 +29,8 @@ import com.android.internal.telephony.TelephonyIntents;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
+import org.cyanogenmod.internal.util.PackageManagerUtils;
+
import java.util.ArrayList;
public class CMSetupWizardData extends AbstractSetupData {
@@ -68,7 +70,8 @@ public class CMSetupWizardData extends AbstractSetupData {
pages.add(new MobileDataPage(mContext, this)
.setHidden(!isSimInserted() || mMobileDataEnabled));
}
- final boolean hasGMS = SetupWizardUtils.hasGMS(mContext);
+ final boolean hasGMS = PackageManagerUtils
+ .isAppInstalled(mContext, "com.google.android.gms");
if (hasGMS) {
pages.add(new GmsAccountPage(mContext, this));
}
diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
index 34961a9..a900e7d 100644
--- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
+++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
@@ -39,8 +39,6 @@ import android.util.Log;
/*import com.android.internal.os.IKillSwitchService;*/
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GooglePlayServicesUtil;
import cyanogenmod.providers.CMSettings;
import static android.content.res.ThemeConfig.SYSTEM_DEFAULT;
@@ -197,11 +195,6 @@ public class SetupWizardUtils {
return UserHandle.getCallingUserHandle().isOwner();
}
- public static boolean hasGMS(Context context) {
- return GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) !=
- ConnectionResult.SERVICE_MISSING;
- }
-
public static boolean accountExists(Context context, String accountType) {
return AccountManager.get(context).getAccountsByType(accountType).length > 0;
}