Skip to content

Commit

Permalink
Reverted brave-core PR #5096
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed Jun 22, 2020
1 parent c86cc35 commit 4c7d3a3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 61 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;
// }
// }
8 changes: 4 additions & 4 deletions patches/chrome-android-java-AndroidManifest.xml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c
<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 @@ -40,9 +40,9 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c
<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
Expand Up @@ -6,8 +6,8 @@ index 0916e619f58d9146367a62c101ef9fdec0f5c0ad..75a77fca11887887e205c19ababab33b
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;
}
Expand Down

0 comments on commit 4c7d3a3

Please sign in to comment.