From daae99d672cddaa00f397372856ec0792a7bd9a9 Mon Sep 17 00:00:00 2001 From: AlexeyBarabash Date: Wed, 13 May 2020 17:15:47 +0300 Subject: [PATCH] Temporary revert brave-core PR #5096 --- .../BraveAndroidSyncSettingsClassAdapter.java | 46 ++++++------- .../sync/BraveAndroidSyncSettings.java | 64 +++++++++---------- ...ome-android-java-AndroidManifest.xml.patch | 20 +++--- ...onents-sync-AndroidSyncSettings.java.patch | 9 ++- 4 files changed, 69 insertions(+), 70 deletions(-) diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveAndroidSyncSettingsClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveAndroidSyncSettingsClassAdapter.java index 1c79c826632b..45f726a487e5 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveAndroidSyncSettingsClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveAndroidSyncSettingsClassAdapter.java @@ -15,28 +15,28 @@ public class BraveAndroidSyncSettingsClassAdapter extends BraveClassVisitor { public BraveAndroidSyncSettingsClassAdapter(ClassVisitor visitor) { super(visitor); - deleteMethod(sBraveAndroidSyncSettingsClassName, - "notifyObservers"); - makePublicMethod(sAndroidSyncSettingsClassName, - "notifyObservers"); - - makePublicMethod(sAndroidSyncSettingsClassName, - "updateCachedSettings"); - addMethodAnnotation(sBraveAndroidSyncSettingsClassName, - "updateCachedSettings", "Ljava/lang/Override;"); - - makePublicMethod(sAndroidSyncSettingsClassName, - "setChromeSyncEnabled"); - addMethodAnnotation(sBraveAndroidSyncSettingsClassName, - "setChromeSyncEnabled", "Ljava/lang/Override;"); - - deleteField(sBraveAndroidSyncSettingsClassName, "mIsSyncable"); - makeProtectedField(sAndroidSyncSettingsClassName, "mIsSyncable"); - - deleteField(sBraveAndroidSyncSettingsClassName, "mChromeSyncEnabled"); - makeProtectedField(sAndroidSyncSettingsClassName, "mChromeSyncEnabled"); - - deleteField(sBraveAndroidSyncSettingsClassName, "mMasterSyncEnabled"); - makeProtectedField(sAndroidSyncSettingsClassName, "mMasterSyncEnabled"); + // deleteMethod(sBraveAndroidSyncSettingsClassName, + // "notifyObservers"); + // makePublicMethod(sAndroidSyncSettingsClassName, + // "notifyObservers"); + // + // makePublicMethod(sAndroidSyncSettingsClassName, + // "updateCachedSettings"); + // addMethodAnnotation(sBraveAndroidSyncSettingsClassName, + // "updateCachedSettings", "Ljava/lang/Override;"); + // + // makePublicMethod(sAndroidSyncSettingsClassName, + // "setChromeSyncEnabled"); + // addMethodAnnotation(sBraveAndroidSyncSettingsClassName, + // "setChromeSyncEnabled", "Ljava/lang/Override;"); + // + // deleteField(sBraveAndroidSyncSettingsClassName, "mIsSyncable"); + // makeProtectedField(sAndroidSyncSettingsClassName, "mIsSyncable"); + // + // deleteField(sBraveAndroidSyncSettingsClassName, "mChromeSyncEnabled"); + // makeProtectedField(sAndroidSyncSettingsClassName, "mChromeSyncEnabled"); + // + // deleteField(sBraveAndroidSyncSettingsClassName, "mMasterSyncEnabled"); + // makeProtectedField(sAndroidSyncSettingsClassName, "mMasterSyncEnabled"); } } diff --git a/components/sync/android/java/src/org/chromium/components/sync/BraveAndroidSyncSettings.java b/components/sync/android/java/src/org/chromium/components/sync/BraveAndroidSyncSettings.java index fd84bd8296cb..c88dc911fbc7 100644 --- a/components/sync/android/java/src/org/chromium/components/sync/BraveAndroidSyncSettings.java +++ b/components/sync/android/java/src/org/chromium/components/sync/BraveAndroidSyncSettings.java @@ -6,35 +6,35 @@ package org.chromium.components.sync; // see org.brave.bytecode.BraveAndroidSyncSettingsAdapter -public class BraveAndroidSyncSettings extends AndroidSyncSettings { - private boolean mIsSyncable; - - private boolean mChromeSyncEnabled; - - private boolean mMasterSyncEnabled; - - public BraveAndroidSyncSettings(SyncContentResolverDelegate syncContentResolverDelegate) { - super(syncContentResolverDelegate, null); - } - - public void setChromeSyncEnabled(boolean value) { - mChromeSyncEnabled = false; - notifyObservers(); - } - - public boolean updateCachedSettings() { - boolean oldChromeSyncEnabled = mChromeSyncEnabled; - boolean oldMasterSyncEnabled = mMasterSyncEnabled; - - mIsSyncable = false; - mChromeSyncEnabled = false; - mMasterSyncEnabled = false; - - return oldChromeSyncEnabled != mChromeSyncEnabled - || oldMasterSyncEnabled != mMasterSyncEnabled; - } - - public void notifyObservers() { - assert false; - } -} +// public class BraveAndroidSyncSettings extends AndroidSyncSettings { +// private boolean mIsSyncable; +// +// private boolean mChromeSyncEnabled; +// +// private boolean mMasterSyncEnabled; +// +// public BraveAndroidSyncSettings(SyncContentResolverDelegate syncContentResolverDelegate) { +// super(syncContentResolverDelegate, null); +// } +// +// public void setChromeSyncEnabled(boolean value) { +// mChromeSyncEnabled = false; +// notifyObservers(); +// } +// +// public boolean updateCachedSettings() { +// boolean oldChromeSyncEnabled = mChromeSyncEnabled; +// boolean oldMasterSyncEnabled = mMasterSyncEnabled; +// +// mIsSyncable = false; +// mChromeSyncEnabled = false; +// mMasterSyncEnabled = false; +// +// return oldChromeSyncEnabled != mChromeSyncEnabled +// || oldMasterSyncEnabled != mMasterSyncEnabled; +// } +// +// public void notifyObservers() { +// assert false; +// } +// } diff --git a/patches/chrome-android-java-AndroidManifest.xml.patch b/patches/chrome-android-java-AndroidManifest.xml.patch index bd66212d5d03..d3f0c4b198d6 100644 --- a/patches/chrome-android-java-AndroidManifest.xml.patch +++ b/patches/chrome-android-java-AndroidManifest.xml.patch @@ -11,7 +11,7 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c +--> - + @@ -43,23 +45,33 @@ by a child template that "extends" this file. {% if target_sdk_version|int > 27 or target_sdk_version == "Q" %} @@ -26,10 +26,10 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c -+ -+--> ++ + -+--> ++ {% set enable_vr = enable_vr|default(0) %} {% if enable_vr == "true" %} @@ -100,7 +112,9 @@ by a child template that "extends" this file. - + + - + {% block extra_uses_permissions %} {% endblock %} @@ -126,6 +140,7 @@ by a child template that "extends" this file. @@ -70,13 +70,13 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c + {% endif %} - + @@ -1295,6 +1311,7 @@ android:value="true" /> {% endif %} - + + {% include "//brave/android/java/AndroidManifest.xml" %} {% block extra_application_definitions %} - +