グローバル検索は、Android 4.4で期待どおりに機能していません
-
20-12-2019 - |
質問
SearchRecentSuggestionsProvider
を拡張する2つの検索提案プロバイダを持つアプリケーションを持っていて、次のIntent
フィルタとメタデータを使用してマニフェストファイルで正しく設定しました。
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable_tv" />
.
SearCableリソースにはandroid:includeInGlobalSearch="true"
が含まれているため、大丈夫です。
そして私は明らかにそこにもプロバイダーを持っています:
<provider
android:name="com.miz.contentprovider.TvShowContentProvider"
android:authorities="com.miz.contentprovider.TvShowContentProvider"
android:exported="true" />
.
これはすべてGoogle検索アプリケーションを使用してAndroid 4.3でうまく機能しましたが、私はすべての私のデバイスをAndroid 4.4に更新しました、そして私はもはや私のアプリケーション内でコンテンツを検索することはできません。同じことは、OSの更新の前に機能し、すなわちGoogle Play Musicを再生する前に機能します。
これも役立つ場合は、これも言及しているXDA開発者にスレッドを見つけました。 http: //forum.xda-developers.com/showthread.php?p=47472102
誰もが何が起こっているのか、それがどのように固定されるかどうかを知っていますか?
UPDATE:Android 4.4のデバイスでのみ発生することを確認できます。最新のGoogle検索の更新を使用してAndroid 4.3デバイスでテストし、予想どおりに機能します。 Googleのアップデートのバグです。
解決
私はAOSPでこのコミットを見つけました。
コミットメッセージは、パフォーマンス上の理由からこの機能が削除されたことを示しています(これは内部チケットIDを参照していますが、これは正式なバグトラッカーでこれに関する関連号を見つけていません)。。
他のヒント
Googleで連絡先をチェックし、アプリケーション索引付けがこれを置き換えています。ドキュメントはこれを非推奨として表示するように更新され、システムレベルの権限なしでキットKATで作業する方法はありません(上記のIDEVとして)。
Google Chromeは、最後の更新以降に検索可能なアプリとして表示されます(v31)
システムアプリケーション:
このようにしてみました
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.globalsearch" android:sharedUserId="android.uid.shared">
<uses-permission android:name="android.permission.GLOBAL_SEARCH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<application android:label="@string/global_search" android:process="android.process.acore">
<activity android:name=".GlobalSearch" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" android:stateNotNeeded="true" android:theme="@android:style/Theme.NoDisplay" android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
<intent-filter android:priority="500">
<action android:name="android.search.action.GLOBAL_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
</activity>
<activity android:name=".SearchSettings" android:label="@string/search_settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.search.action.SEARCH_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<provider android:name=".SuggestionProvider" android:authorities="com.android.globalsearch.SuggestionProvider" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<provider android:name=".StatsProvider" android:authorities="com.android.globalsearch.stats" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<meta-data android:name="android.app.default_searchable" android:value=".GlobalSearch" />
</application>
</manifest>
.