Merge "Fix a typo in AndroidManifest.xml" into pi-dev
This commit is contained in:
@@ -50,7 +50,7 @@ public interface DeviceIndexFeatureProvider {
|
||||
if (!isIndexingEnabled()) return;
|
||||
|
||||
if (!force && Objects.equals(
|
||||
Settings.Secure.getString(context.getContentResolver(), INDEX_VERSION), VERSION)) {
|
||||
Settings.Secure.getString(context.getContentResolver(), INDEX_VERSION), VERSION)) {
|
||||
// No need to update.
|
||||
return;
|
||||
}
|
||||
@@ -70,11 +70,10 @@ public interface DeviceIndexFeatureProvider {
|
||||
Settings.Secure.putString(context.getContentResolver(), INDEX_VERSION, VERSION);
|
||||
}
|
||||
|
||||
static String createDeepLink(String s) {
|
||||
static Uri createDeepLink(String s) {
|
||||
return new Uri.Builder().scheme(SETTINGS)
|
||||
.authority(SettingsSliceProvider.SLICE_AUTHORITY)
|
||||
.appendQueryParameter(INTENT, s)
|
||||
.build()
|
||||
.toString();
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@ package com.android.settings.search;
|
||||
import static android.app.slice.Slice.HINT_LARGE;
|
||||
import static android.app.slice.Slice.HINT_TITLE;
|
||||
import static android.app.slice.SliceItem.FORMAT_TEXT;
|
||||
|
||||
import static com.android.settings.search.DeviceIndexFeatureProvider.createDeepLink;
|
||||
|
||||
import android.app.job.JobParameters;
|
||||
@@ -73,16 +72,20 @@ public class DeviceIndexUpdateJobService extends JobService {
|
||||
|
||||
@VisibleForTesting
|
||||
protected void updateIndex(JobParameters params) {
|
||||
if (DEBUG) Log.d(TAG, "Starting index");
|
||||
DeviceIndexFeatureProvider indexProvider = FeatureFactory.getFactory(
|
||||
this).getDeviceIndexFeatureProvider();
|
||||
SliceManager manager = getSliceManager();
|
||||
Uri baseUri = new Builder()
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Starting index");
|
||||
}
|
||||
final DeviceIndexFeatureProvider indexProvider = FeatureFactory.getFactory(this)
|
||||
.getDeviceIndexFeatureProvider();
|
||||
final SliceManager manager = getSliceManager();
|
||||
final Uri baseUri = new Builder()
|
||||
.scheme(ContentResolver.SCHEME_CONTENT)
|
||||
.authority(SettingsSliceProvider.SLICE_AUTHORITY)
|
||||
.build();
|
||||
Collection<Uri> slices = manager.getSliceDescendants(baseUri);
|
||||
if (DEBUG) Log.d(TAG, "Indexing " + slices.size() + " slices");
|
||||
final Collection<Uri> slices = manager.getSliceDescendants(baseUri);
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Indexing " + slices.size() + " slices");
|
||||
}
|
||||
|
||||
for (Uri slice : slices) {
|
||||
if (!mRunningJob) {
|
||||
@@ -93,16 +96,20 @@ public class DeviceIndexUpdateJobService extends JobService {
|
||||
SliceMetadata metaData = getMetadata(loadedSlice);
|
||||
CharSequence title = findTitle(loadedSlice, metaData);
|
||||
if (title != null) {
|
||||
if (DEBUG) Log.d(TAG, "Indexing: " + slice + " " + title + " " + loadedSlice);
|
||||
indexProvider.index(this, title, slice, Uri.parse(createDeepLink(
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Indexing: " + slice + " " + title + " " + loadedSlice);
|
||||
}
|
||||
indexProvider.index(this, title, slice, createDeepLink(
|
||||
new Intent(SliceDeepLinkSpringBoard.ACTION_VIEW_SLICE)
|
||||
.setPackage(getPackageName())
|
||||
.putExtra(SliceDeepLinkSpringBoard.EXTRA_SLICE, slice.toString())
|
||||
.toUri(Intent.URI_ANDROID_APP_SCHEME))),
|
||||
.toUri(Intent.URI_ANDROID_APP_SCHEME)),
|
||||
metaData.getSliceKeywords());
|
||||
}
|
||||
}
|
||||
if (DEBUG) Log.d(TAG, "Done indexing");
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Done indexing");
|
||||
}
|
||||
jobFinished(params, false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user