This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #162 - Add build flag to exclude proprietary dependencies.
- Loading branch information
1 parent
f4480df
commit 8df86dd
Showing
18 changed files
with
173 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/free/java/org/mozilla/fenix/components/metrics/AdvertisingIDImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.components.metrics | ||
|
||
import android.content.Context | ||
|
||
interface AdvertisingIDImpl : AdvertisingID { | ||
override fun getAdvertisingID(context: Context): String? { | ||
return null | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/free/java/org/mozilla/fenix/components/metrics/LeanplumMetricsServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.components.metrics | ||
|
||
import android.app.Application | ||
import java.util.UUID | ||
|
||
class LeanplumMetricsServiceImpl( | ||
private val application: Application, | ||
private val deviceIdGenerator: () -> String = { UUID.randomUUID().toString() } | ||
) : MetricsService { | ||
override val type = MetricServiceType.Marketing | ||
override fun start() {} | ||
override fun stop() {} | ||
override fun track(event: Event) {} | ||
override fun shouldTrack(event: Event): Boolean {return false;} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/free/java/org/mozilla/fenix/push/PushServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.push | ||
|
||
import android.content.Context | ||
import mozilla.components.concept.push.PushService | ||
|
||
class PushServiceImpl : PushService { | ||
override fun deleteToken() {} | ||
override fun isServiceAvailable(context: Context): Boolean { return false } | ||
override fun start(context: Context) {} | ||
override fun stop() {} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/free/java/org/mozilla/fenix/settings/about/OssLicensesMenuImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.settings.about | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
|
||
class OssLicensesMenuImpl : OssLicensesMenu { | ||
override fun getIntent(context: Context?, title: String): Intent { | ||
throw NotImplementedError() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/src/main/java/org/mozilla/fenix/settings/about/OssLicensesMenu.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
package org.mozilla.fenix.settings.about | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
|
||
interface OssLicensesMenu { | ||
fun getIntent(context: Context?, title: String): Intent | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/nonFree/java/org/mozilla/fenix/components/metrics/AdvertisingIDImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.components.metrics | ||
|
||
import android.content.Context | ||
import com.google.android.gms.ads.identifier.AdvertisingIdClient | ||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException | ||
import com.google.android.gms.common.GooglePlayServicesRepairableException | ||
import mozilla.components.support.base.log.logger.Logger | ||
import java.io.IOException | ||
|
||
interface AdvertisingIDImpl : AdvertisingID { | ||
@Suppress("TooGenericExceptionCaught") | ||
override fun getAdvertisingID(context: Context): String? { | ||
return try { | ||
AdvertisingIdClient.getAdvertisingIdInfo(context).id | ||
} catch (e: GooglePlayServicesNotAvailableException) { | ||
Logger.debug("ActivationPing - Google Play not installed on the device") | ||
null | ||
} catch (e: GooglePlayServicesRepairableException) { | ||
Logger.debug("ActivationPing - recoverable error connecting to Google Play Services") | ||
null | ||
} catch (e: IllegalStateException) { | ||
// This is unlikely to happen, as this should be running off the main thread. | ||
Logger.debug("ActivationPing - AdvertisingIdClient must be called off the main thread") | ||
null | ||
} catch (e: IOException) { | ||
Logger.debug("ActivationPing - unable to connect to Google Play Services") | ||
null | ||
} catch (e: NullPointerException) { | ||
Logger.debug("ActivationPing - no Google Advertising ID available") | ||
null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/src/nonFree/java/org/mozilla/fenix/settings/about/OssLicensesMenuImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* 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/. */ | ||
|
||
package org.mozilla.fenix.settings.about | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity | ||
|
||
class OssLicensesMenuImpl : OssLicensesMenu { | ||
override fun getIntent(context: Context?, title: String): Intent { | ||
OssLicensesMenuActivity.setActivityTitle(title) | ||
return Intent(context, OssLicensesMenuActivity::class.java) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.