Merge "Define a constant Sliceable#NO_RES for no resource cases" into sc-v2-dev
This commit is contained in:
@@ -95,6 +95,6 @@ public class BiometricSettingsAppPreferenceController extends TogglePreferenceCo
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
|
@@ -77,6 +77,6 @@ public class BiometricSettingsKeyguardPreferenceController extends TogglePrefere
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
|
@@ -55,6 +55,6 @@ public abstract class FaceSettingsPreferenceController extends TogglePreferenceC
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ public class LocationTimeZoneDetectionPreferenceController
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -55,7 +55,7 @@ public class EmergencyGestureSoundPreferenceController extends TogglePreferenceC
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -120,7 +120,7 @@ public class FlashlightSlice implements CustomSliceable {
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// no landing page in Settings
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
|
||||
private static String getCameraId(Context context) throws CameraAccessException {
|
||||
|
@@ -68,7 +68,7 @@ public abstract class TelephonyTogglePreferenceController extends TogglePreferen
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -91,7 +91,7 @@ public class BubbleNotificationPreferenceController extends
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
// not needed since it's not sliceable
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -25,6 +25,7 @@ import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.slice.Slice;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -135,10 +136,16 @@ public interface Sliceable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a resource ID that indicates which menu entry should be highlighted in multi-pane
|
||||
* mode.
|
||||
* Used to mark a {@link Sliceable} that has no highlight menu string resource.
|
||||
*/
|
||||
default int getSliceHighlightMenuRes() {
|
||||
return 0;
|
||||
int NO_RES = 0;
|
||||
|
||||
/**
|
||||
* @return a string resource declared in res/values/menu_keys.xml that indicates which menu
|
||||
* entry should be highlighted in two-pane mode, or {@link #NO_RES} representing highlighting is
|
||||
* not applicable.
|
||||
*/
|
||||
@StringRes default int getSliceHighlightMenuRes() {
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
|
@@ -305,7 +305,7 @@ public class ProviderModelSliceHelperTest {
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -146,7 +146,7 @@ public class SpecialCaseSliceManagerTest {
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return 0;
|
||||
return NO_RES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user