Also fix how icon is loaded. IconResId is specific to the package of the indexed result. If result comes from external app, icon needs to be decoded against the external app's package context. Bug: 33432310 Test: RunSettingsRoboTests Change-Id: Ia0c53e63be757405dfaeceb2d865e7d8de87c5ee
52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
/*
|
|
* Copyright (C) 2016 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.search2;
|
|
|
|
import android.annotation.IntDef;
|
|
import android.os.Parcelable;
|
|
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
/**
|
|
* A interface for search results types. Examples include Inline results, third party apps
|
|
* or any future possibilities.
|
|
*/
|
|
public abstract class ResultPayload implements Parcelable {
|
|
|
|
@IntDef({PayloadType.INLINE_SLIDER, PayloadType.INLINE_SWITCH, PayloadType.INTENT})
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
public @interface PayloadType {
|
|
/**
|
|
* Resulting page will be started using an intent
|
|
*/
|
|
int INTENT = 0;
|
|
|
|
/**
|
|
* Result is a inline widget, using a slider widget as UI.
|
|
*/
|
|
int INLINE_SLIDER = 1;
|
|
|
|
/**
|
|
* Result is a inline widget, using a toggle widget as UI.
|
|
*/
|
|
int INLINE_SWITCH = 2;
|
|
}
|
|
|
|
@ResultPayload.PayloadType public abstract int getType();
|
|
}
|