Skip to content

Commit

Permalink
Bug 1553459 - Migrate to AndroidX r=geckoview-reviewers,agi
Browse files Browse the repository at this point in the history
  • Loading branch information
snorp committed Sep 18, 2020
1 parent bc885ee commit 1730589
Show file tree
Hide file tree
Showing 126 changed files with 301 additions and 339 deletions.
11 changes: 1 addition & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,9 @@ buildscript {
}

ext.kotlin_version = '1.3.41'
ext.support_library_version = '28.0.0'
ext.jacoco_version = '0.8.1'
ext.lifecycle_library_version = '1.1.1'

if (gradle.mozconfig.substs.MOZ_ANDROID_GOOGLE_PLAY_SERVICES) {
ext.google_play_services_version = '15.0.1'
ext.google_play_services_cast_version = '16.0.0'
ext.google_play_services_fido_version = '17.0.0'
}

dependencies {
classpath 'org.mozilla.apilint:apilint:0.3.0'
classpath 'org.mozilla.apilint:apilint:0.3.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
classpath 'org.apache.commons:commons-exec:1.3'
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx6656M
android.useAndroidX=true
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package org.webrtc;

import android.os.SystemClock;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.annotation.TargetApi;
import android.content.Context;
import android.hardware.camera2.CameraManager;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

@TargetApi(21)
public class Camera2Capturer extends CameraCapturer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import android.hardware.camera2.params.StreamConfigurationMap;
import android.os.Build;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.AndroidException;
import android.util.Range;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package org.webrtc;

import android.graphics.SurfaceTexture;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.Surface;
import java.util.ArrayList;
import javax.microedition.khronos.egl.EGL10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package org.webrtc;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.nio.ByteBuffer;
import org.webrtc.VideoFrame.I420Buffer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.util.concurrent.Callable;
import org.webrtc.EglBase.Context;
import org.webrtc.TextureBufferImpl.RefCountMonitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import android.graphics.Matrix;
import android.os.Handler;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

/**
* Android texture buffer that glues together the necessary information together with a generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.graphics.Matrix;
import android.graphics.Point;
import android.opengl.GLES20;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.nio.ByteBuffer;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.hardware.camera2.CaptureFailure;
import android.hardware.camera2.CaptureRequest;
import android.os.Handler;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Range;
import android.view.Surface;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.util.Arrays;

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.Surface;
import android.view.SurfaceHolder;
import javax.microedition.khronos.egl.EGL10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import android.opengl.EGLExt;
import android.opengl.EGLSurface;
import android.os.Build;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.Surface;
import org.webrtc.EglBase;

/**
* Holds EGL state and utility methods for handling an EGL14 EGLContext, an EGLDisplay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@

import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.nio.FloatBuffer;
import org.webrtc.GlShader;
import org.webrtc.GlUtil;
import org.webrtc.RendererCommon;

/**
* Helper class to implement an instance of RendererCommon.GlDrawer that can accept multiple input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package org.webrtc;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.nio.ByteBuffer;

public class NV21Buffer implements VideoFrame.Buffer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package org.webrtc;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.util.concurrent.atomic.AtomicInteger;

/**
Expand Down
18 changes: 0 additions & 18 deletions mobile/android/config/proguard/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
-keep public class * extends org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter
-keep class org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter

-keep public class * extends android.support.v4.app.Fragment

# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames class * {
native <methods>;
Expand All @@ -43,13 +41,6 @@
*** get*();
}

# Keep setters in support Fragment so that Robocop tests work,
# specifically testBrowserSearchVisibility.
-keepclassmembers public class * extends android.support.v4.app.Fragment {
void set*(***);
*** get*();
}

# Preserve enums. (For awful reasons, the runtime accesses them using introspection...)
-keepclassmembers enum * {
*;
Expand Down Expand Up @@ -108,11 +99,6 @@

-dontnote com.android.vending.licensing.ILicensingService

# The Android Compatibility library references some classes that may not be
# present in all versions of the API, but we know that's ok.

-dontwarn android.support.**

# Preserve all native method names and the names of their classes.

-keepclasseswithmembernames class * {
Expand Down Expand Up @@ -161,10 +147,6 @@

-include "play-services-keeps.cfg"

# Don't print spurious warnings from the support library.
# See: http://stackoverflow.com/questions/22441366/note-android-support-v4-text-icucompatics-cant-find-dynamically-referenced-cl
-dontnote android.support.**

# Don't warn when classes referenced by JaCoCo are missing when running the build from android-dependencies.
-dontwarn java.lang.instrument.**
-dontwarn java.lang.management.**
Expand Down
6 changes: 3 additions & 3 deletions mobile/android/examples/messaging_example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-annotations:$support_library_version"
implementation "com.android.support:appcompat-v7:$support_library_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "androidx.annotation:annotation:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
// Replace this with implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
implementation project(path: ':geckoview')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.mozilla.geckoview.example.messaging;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -15,4 +15,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-annotations:$support_library_version"
implementation "com.android.support:appcompat-v7:$support_library_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "androidx.annotation:annotation:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation project(path: ':geckoview')
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.mozilla.geckoview.example.messaging;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -15,4 +15,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions mobile/android/geckoview/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.AnyThread;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.ActionMode;
Expand All @@ -35,6 +31,10 @@ import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
import android.widget.FrameLayout;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import java.io.File;
import java.io.InputStream;
import java.lang.Boolean;
Expand Down
13 changes: 6 additions & 7 deletions mobile/android/geckoview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {

dependencies {
// For exoplayer.
implementation "androidx.annotation:annotation:1.1.0"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
compileOnly "org.checkerframework:checker-compat-qual:2.5.0"
compileOnly "org.checkerframework:checker-qual:2.5.0"
compileOnly "org.jetbrains.kotlin:kotlin-annotations-jvm:1.3.70"

implementation "com.android.support:support-v4:$support_library_version"
implementation "com.android.support:palette-v7:$support_library_version"
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.palette:palette:1.0.0"
implementation "org.yaml:snakeyaml:1.24:android"

implementation "android.arch.lifecycle:extensions:$lifecycle_library_version"
implementation "android.arch.lifecycle:common-java8:$lifecycle_library_version"
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0"

testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.12'
Expand All @@ -238,8 +238,6 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

androidTestImplementation "com.android.support:support-annotations:$support_library_version"

androidTestImplementation 'com.koushikdutta.async:androidasync:2.+'
}

Expand Down Expand Up @@ -556,6 +554,7 @@ apiLint {
allowedPackages = [
'java',
'android',
'androidx',
'org.json',
'org.mozilla.geckoview',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.IgnoreCrash
import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.WithDisplay
import org.mozilla.geckoview.test.util.Callbacks

import android.support.annotation.AnyThread
import androidx.annotation.AnyThread
import androidx.test.filters.MediumTest
import androidx.test.ext.junit.runners.AndroidJUnit4
import android.util.Pair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.IgnoreCrash
import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.WithDisplay
import org.mozilla.geckoview.test.util.Callbacks

import android.support.annotation.AnyThread
import androidx.annotation.AnyThread
import androidx.test.filters.MediumTest
import androidx.test.ext.junit.runners.AndroidJUnit4
import android.view.Surface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.mozilla.geckoview.test
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import android.support.v4.view.ViewCompat
import androidx.core.view.ViewCompat
import android.view.View

import org.hamcrest.MatcherAssert.assertThat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.util.Log;

import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.test.util.UiThreadUtils;
Expand Down
Loading

0 comments on commit 1730589

Please sign in to comment.