Issue #4978: Reuse widget package name of Fennec.
parent
5ac79f59a3
commit
e789d8ebe3
|
@ -176,7 +176,7 @@
|
||||||
|
|
||||||
<service android:name=".downloads.DownloadService" />
|
<service android:name=".downloads.DownloadService" />
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".widget.SearchWidgetProvider">
|
android:name="org.mozilla.gecko.search.SearchWidgetProvider">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
package org.mozilla.fenix.widget
|
package org.mozilla.gecko.search
|
||||||
|
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.appwidget.AppWidgetManager
|
import android.appwidget.AppWidgetManager
|
||||||
|
@ -23,10 +23,15 @@ import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.home.intent.StartSearchIntentProcessor
|
import org.mozilla.fenix.home.intent.StartSearchIntentProcessor
|
||||||
|
import org.mozilla.fenix.widget.VoiceSearchActivity
|
||||||
import org.mozilla.fenix.widget.VoiceSearchActivity.Companion.SPEECH_PROCESSING
|
import org.mozilla.fenix.widget.VoiceSearchActivity.Companion.SPEECH_PROCESSING
|
||||||
|
|
||||||
@Suppress("TooManyFunctions")
|
@Suppress("TooManyFunctions")
|
||||||
class SearchWidgetProvider : AppWidgetProvider() {
|
class SearchWidgetProvider : AppWidgetProvider() {
|
||||||
|
// Implementation note:
|
||||||
|
// This class name (SearchWidgetProvider) and package name (org.mozilla.gecko.search) should
|
||||||
|
// not be changed because otherwise this widget will disappear from the home screen of the user.
|
||||||
|
// The existing name replicates the name and package we used in Fennec.
|
||||||
|
|
||||||
override fun onEnabled(context: Context) {
|
override fun onEnabled(context: Context) {
|
||||||
context.settings().addSearchWidgetInstalled(1)
|
context.settings().addSearchWidgetInstalled(1)
|
||||||
|
@ -117,7 +122,8 @@ class SearchWidgetProvider : AppWidgetProvider() {
|
||||||
val intentSpeech = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
val intentSpeech = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
|
|
||||||
return intentSpeech.resolveActivity(context.packageManager)?.let {
|
return intentSpeech.resolveActivity(context.packageManager)?.let {
|
||||||
PendingIntent.getActivity(context, REQUEST_CODE_VOICE, voiceIntent, 0)
|
PendingIntent.getActivity(context,
|
||||||
|
REQUEST_CODE_VOICE, voiceIntent, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue