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 Jun 14, 2020
1 parent d5771d9 commit daae99d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 70 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;
// }
// }
20 changes: 10 additions & 10 deletions patches/chrome-android-java-AndroidManifest.xml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c
+-->
<uses-permission-sdk-23 android:name="android.permission.REORDER_TASKS"/>
<uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>

@@ -43,23 +45,33 @@ by a child template that "extends" this file.
{% if target_sdk_version|int > 27 or target_sdk_version == "Q" %}
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Expand All @@ -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,20 +40,20 @@ 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+. -->
@@ -100,7 +112,9 @@ by a child template that "extends" this file.
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>

+<!--
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
+-->

{% block extra_uses_permissions %}
{% endblock %}
@@ -126,6 +140,7 @@ by a child template that "extends" this file.
Expand All @@ -70,13 +70,13 @@ index 6f50b67787561c523330b2eaa6522c517cb13eee..b5248da5b084206b6f15687abf89316c
<meta-data android:name="com.google.ar.core" android:value="optional" />
+ <meta-data android:name="com.google.ar.core.min_apk_version" android:value="190603076"/><activity android:name="com.google.ar.core.InstallActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:excludeFromRecents="true" android:exported="false" android:launchMode="singleTop" android:theme="@android:style/Theme.Material.Light.Dialog.Alert" />
{% endif %}

<!-- Cast support -->
@@ -1295,6 +1311,7 @@ android:value="true" />
</activity>
{% endif %}

+ {% include "//brave/android/java/AndroidManifest.xml" %}
{% block extra_application_definitions %}

<!-- Media route controllers to use for remote playback (cast).
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ diff --git a/components/sync/android/java/src/org/chromium/components/sync/Andro
index 0916e619f58d9146367a62c101ef9fdec0f5c0ad..75a77fca11887887e205c19ababab33b326a09d9 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 daae99d

Please sign in to comment.