Add FutureTask approach in DashboardFragment

- Use the multiple tasks to enhance the controllers loading.

Bug: 137558156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.dashboard
Change-Id: I629ff5dc81347cddf9762a87015b9b86b6a46e50
This commit is contained in:
Sunny Shao
2019-11-18 16:38:19 +08:00
parent 01cf29b958
commit 3351c78b74
6 changed files with 412 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.dashboard;
import com.android.settingslib.core.AbstractPreferenceController;
import java.util.concurrent.FutureTask;
/**
* {@link FutureTask} of the Controller.
*/
public class ControllerFutureTask extends FutureTask<Void> {
private final AbstractPreferenceController mController;
public ControllerFutureTask(ControllerTask task, Void result) {
super(task, result);
mController = task.getController();
}
AbstractPreferenceController getController() {
return mController;
}
}