Skip to content

Commit

Permalink
Temporary revert brave-core PR #5096
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed May 25, 2020
1 parent d7cad82 commit 1670f18
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
// }
// }
10 changes: 5 additions & 5 deletions patches/chrome-android-java-AndroidManifest.xml.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index 8cd1fb84e55c6fb971db3441fa41bd7460ed738e..369cd188698f05263ce2cbe20971049a5812afcc 100644
index 8cd1fb84e55c6fb971db3441fa41bd7460ed738e..23f902993e2a3c8ff4476a3111cf908a3a08e3f1 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -34,7 +34,9 @@ by a child template that "extends" this file.
Expand All @@ -26,10 +26,10 @@ index 8cd1fb84e55c6fb971db3441fa41bd7460ed738e..369cd188698f05263ce2cbe20971049a
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+<!--
+<!-- -->
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_STATS"/>
+-->
+<!-- -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
+<!--
Expand All @@ -39,9 +39,9 @@ index 8cd1fb84e55c6fb971db3441fa41bd7460ed738e..369cd188698f05263ce2cbe20971049a
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+<!--
+<!-- -->
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
+-->
+<!-- -->
{% set enable_vr = enable_vr|default(0) %}
{% if enable_vr == "true" %}
<!-- Indicates use of Android's VR-mode, available only on Android N+. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
diff --git a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
index 84a8b66912a2f6847771486e62556b772c192fd2..b66f68589fb11cda455a86d8400feb3ac2a0f083 100644
index 84a8b66912a2f6847771486e62556b772c192fd2..e46ec14d76d990ebe85420cad4d44d55c78fa154 100644
--- a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
+++ b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
@@ -77,7 +77,7 @@ public class AndroidSyncSettings {
@@ -77,6 +77,7 @@ public class AndroidSyncSettings {
if (sInstance == null) {
SyncContentResolverDelegate contentResolver =
new SystemSyncContentResolverDelegate();
- sInstance = new AndroidSyncSettings(contentResolver);
+ sInstance = new BraveAndroidSyncSettings(contentResolver);
+ //sInstance = new BraveAndroidSyncSettings(contentResolver);
sInstance = new AndroidSyncSettings(contentResolver);
}
return sInstance;
}
@@ -103,7 +103,7 @@ public class AndroidSyncSettings {
@@ -103,7 +104,7 @@ public class AndroidSyncSettings {
* @param callback Callback that will be called after updating account is finished. Boolean
* passed to the callback indicates whether syncability was changed.
*/
Expand Down

0 comments on commit 1670f18

Please sign in to comment.