Merge "Make default windows features configurable." into lmp-mr1-dev
This commit is contained in:
@ -34459,6 +34459,7 @@ package android.view {
|
|||||||
method public final android.content.Context getContext();
|
method public final android.content.Context getContext();
|
||||||
method public abstract android.view.View getCurrentFocus();
|
method public abstract android.view.View getCurrentFocus();
|
||||||
method public abstract android.view.View getDecorView();
|
method public abstract android.view.View getDecorView();
|
||||||
|
method public static int getDefaultFeatures(android.content.Context);
|
||||||
method public android.transition.Transition getEnterTransition();
|
method public android.transition.Transition getEnterTransition();
|
||||||
method public android.transition.Transition getExitTransition();
|
method public android.transition.Transition getExitTransition();
|
||||||
method protected final int getFeatures();
|
method protected final int getFeatures();
|
||||||
@ -34560,7 +34561,7 @@ package android.view {
|
|||||||
method public abstract void takeKeyEvents(boolean);
|
method public abstract void takeKeyEvents(boolean);
|
||||||
method public abstract void takeSurface(android.view.SurfaceHolder.Callback2);
|
method public abstract void takeSurface(android.view.SurfaceHolder.Callback2);
|
||||||
method public abstract void togglePanel(int, android.view.KeyEvent);
|
method public abstract void togglePanel(int, android.view.KeyEvent);
|
||||||
field protected static final int DEFAULT_FEATURES = 65; // 0x41
|
field protected static final deprecated int DEFAULT_FEATURES = 65; // 0x41
|
||||||
field public static final int FEATURE_ACTION_BAR = 8; // 0x8
|
field public static final int FEATURE_ACTION_BAR = 8; // 0x8
|
||||||
field public static final int FEATURE_ACTION_BAR_OVERLAY = 9; // 0x9
|
field public static final int FEATURE_ACTION_BAR_OVERLAY = 9; // 0x9
|
||||||
field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
|
field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
|
||||||
|
@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
|||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@ -155,6 +156,7 @@ public abstract class Window {
|
|||||||
"android:navigation:background";
|
"android:navigation:background";
|
||||||
|
|
||||||
/** The default features enabled */
|
/** The default features enabled */
|
||||||
|
@Deprecated
|
||||||
@SuppressWarnings({"PointlessBitwiseExpression"})
|
@SuppressWarnings({"PointlessBitwiseExpression"})
|
||||||
protected static final int DEFAULT_FEATURES = (1 << FEATURE_OPTIONS_PANEL) |
|
protected static final int DEFAULT_FEATURES = (1 << FEATURE_OPTIONS_PANEL) |
|
||||||
(1 << FEATURE_CONTEXT_MENU);
|
(1 << FEATURE_CONTEXT_MENU);
|
||||||
@ -183,8 +185,8 @@ public abstract class Window {
|
|||||||
private boolean mSetCloseOnTouchOutside = false;
|
private boolean mSetCloseOnTouchOutside = false;
|
||||||
private int mForcedWindowFlags = 0;
|
private int mForcedWindowFlags = 0;
|
||||||
|
|
||||||
private int mFeatures = DEFAULT_FEATURES;
|
private int mFeatures;
|
||||||
private int mLocalFeatures = DEFAULT_FEATURES;
|
private int mLocalFeatures;
|
||||||
|
|
||||||
private boolean mHaveWindowFormat = false;
|
private boolean mHaveWindowFormat = false;
|
||||||
private boolean mHaveDimAmount = false;
|
private boolean mHaveDimAmount = false;
|
||||||
@ -442,6 +444,7 @@ public abstract class Window {
|
|||||||
|
|
||||||
public Window(Context context) {
|
public Window(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
mFeatures = mLocalFeatures = getDefaultFeatures(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1269,6 +1272,25 @@ public abstract class Window {
|
|||||||
return mFeatures;
|
return mFeatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the feature bits set by default on a window.
|
||||||
|
* @param context The context used to access resources
|
||||||
|
*/
|
||||||
|
public static int getDefaultFeatures(Context context) {
|
||||||
|
int features = 0;
|
||||||
|
|
||||||
|
final Resources res = context.getResources();
|
||||||
|
if (res.getBoolean(com.android.internal.R.bool.config_defaultWindowFeatureOptionsPanel)) {
|
||||||
|
features |= 1 << FEATURE_OPTIONS_PANEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.getBoolean(com.android.internal.R.bool.config_defaultWindowFeatureContextMenu)) {
|
||||||
|
features |= 1 << FEATURE_CONTEXT_MENU;
|
||||||
|
}
|
||||||
|
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query for the availability of a certain feature.
|
* Query for the availability of a certain feature.
|
||||||
*
|
*
|
||||||
|
@ -40,4 +40,7 @@
|
|||||||
Reduced intentionally for watches to retain minimal memory footprint -->
|
Reduced intentionally for watches to retain minimal memory footprint -->
|
||||||
<integer name="config_notificationServiceArchiveSize">1</integer>
|
<integer name="config_notificationServiceArchiveSize">1</integer>
|
||||||
|
|
||||||
|
<!-- Flags enabling default window features. See Window.java -->
|
||||||
|
<bool name="config_defaultWindowFeatureOptionsPanel">false</bool>
|
||||||
|
<bool name="config_defaultWindowFeatureContextMenu">false</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1927,6 +1927,10 @@
|
|||||||
<!-- Show the next-alarm as a zen exit condition if it occurs in the next n hours. -->
|
<!-- Show the next-alarm as a zen exit condition if it occurs in the next n hours. -->
|
||||||
<integer name="config_next_alarm_condition_lookahead_threshold_hrs">12</integer>
|
<integer name="config_next_alarm_condition_lookahead_threshold_hrs">12</integer>
|
||||||
|
|
||||||
|
<!-- Flags enabling default window features. See Window.java -->
|
||||||
|
<bool name="config_defaultWindowFeatureOptionsPanel">true</bool>
|
||||||
|
<bool name="config_defaultWindowFeatureContextMenu">true</bool>
|
||||||
|
|
||||||
<!-- This config is used to check if the carrier requires converting destination
|
<!-- This config is used to check if the carrier requires converting destination
|
||||||
number before sending out a SMS.
|
number before sending out a SMS.
|
||||||
Formats for this configuration as below:
|
Formats for this configuration as below:
|
||||||
|
@ -2120,6 +2120,9 @@
|
|||||||
<java-symbol type="bool" name="config_switch_phone_on_voice_reg_state_change" />
|
<java-symbol type="bool" name="config_switch_phone_on_voice_reg_state_change" />
|
||||||
<java-symbol type="string" name="whichHomeApplicationNamed" />
|
<java-symbol type="string" name="whichHomeApplicationNamed" />
|
||||||
<java-symbol type="bool" name="config_sms_force_7bit_encoding" />
|
<java-symbol type="bool" name="config_sms_force_7bit_encoding" />
|
||||||
|
<java-symbol type="bool" name="config_defaultWindowFeatureOptionsPanel" />
|
||||||
|
<java-symbol type="bool" name="config_defaultWindowFeatureContextMenu" />
|
||||||
|
|
||||||
<java-symbol type="layout" name="simple_account_item" />
|
<java-symbol type="layout" name="simple_account_item" />
|
||||||
<java-symbol type="id" name="scrollIndicatorUp" />
|
<java-symbol type="id" name="scrollIndicatorUp" />
|
||||||
<java-symbol type="id" name="scrollIndicatorDown" />
|
<java-symbol type="id" name="scrollIndicatorDown" />
|
||||||
|
Reference in New Issue
Block a user