am d6a3e485: Merge "Unify normal and overlay action bar layouts." into jb-mr2-dev
* commit 'd6a3e485b58e23808b44b8f2374e67e891cfae05':
Unify normal and overlay action bar layouts.
diff --git a/Android.mk b/Android.mk
index 5dc3523..652f7a8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -180,6 +180,8 @@
core/java/com/android/internal/backup/IBackupTransport.aidl \
core/java/com/android/internal/policy/IFaceLockCallback.aidl \
core/java/com/android/internal/policy/IFaceLockInterface.aidl \
+ core/java/com/android/internal/policy/IKeyguardResult.aidl \
+ core/java/com/android/internal/policy/IKeyguardService.aidl \
core/java/com/android/internal/os/IDropBoxManagerService.aidl \
core/java/com/android/internal/os/IResultReceiver.aidl \
core/java/com/android/internal/statusbar/IStatusBar.aidl \
diff --git a/api/current.txt b/api/current.txt
index 2e9f757..6cd7c8d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -620,6 +620,7 @@
field public static final int keyboardLayout = 16843691; // 0x10103ab
field public static final int keyboardMode = 16843341; // 0x101024d
field public static final int keycode = 16842949; // 0x10100c5
+ field public static final int keyset = 16843727; // 0x10103cf
field public static final int killAfterRestore = 16843420; // 0x101029c
field public static final int label = 16842753; // 0x1010001
field public static final int labelFor = 16843718; // 0x10103c6
@@ -1174,7 +1175,7 @@
field public static final int windowMinWidthMinor = 16843607; // 0x1010357
field public static final int windowNoDisplay = 16843294; // 0x101021e
field public static final int windowNoTitle = 16842838; // 0x1010056
- field public static final int windowOverscan = 16843727; // 0x10103cf
+ field public static final int windowOverscan = 16843728; // 0x10103d0
field public static final int windowShowAnimation = 16842934; // 0x10100b6
field public static final int windowShowWallpaper = 16843410; // 0x1010292
field public static final int windowSoftInputMode = 16843307; // 0x101022b
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java
index a470e70..7794949 100644
--- a/core/java/android/appwidget/AppWidgetHost.java
+++ b/core/java/android/appwidget/AppWidgetHost.java
@@ -198,7 +198,6 @@
* @return a appWidgetId
*/
public int allocateAppWidgetId() {
-
try {
if (mPackageName == null) {
mPackageName = mContext.getPackageName();
diff --git a/core/java/android/content/pm/KeySet.java b/core/java/android/content/pm/KeySet.java
new file mode 100644
index 0000000..0ef09a4
--- /dev/null
+++ b/core/java/android/content/pm/KeySet.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012 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 android.content.pm;
+
+import android.os.Binder;
+
+/** @hide */
+public class KeySet {
+
+ private Binder token;
+
+ /** @hide */
+ public KeySet(Binder token) {
+ this.token = token;
+ }
+
+ Binder getToken() {
+ return token;
+ }
+}
\ No newline at end of file
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e1887bc..383e603 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -46,14 +46,20 @@
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertPath;
+import java.security.cert.X509Certificate;
import java.security.spec.EncodedKeySpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -689,6 +695,13 @@
mParseError = PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
return false;
}
+
+ // Add the signing KeySet to the system
+ pkg.mSigningKeys = new HashSet<PublicKey>();
+ for (int i=0; i < certs.length; i++) {
+ pkg.mSigningKeys.add(certs[i].getPublicKey());
+ }
+
} catch (CertificateEncodingException e) {
Slog.w(TAG, "Exception reading " + mArchiveSourcePath, e);
mParseError = PackageManager.INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING;
@@ -1002,6 +1015,10 @@
if (!parseApplication(pkg, res, parser, attrs, flags, outError)) {
return null;
}
+ } else if (tagName.equals("keys")) {
+ if (!parseKeys(pkg, res, parser, attrs, outError)) {
+ return null;
+ }
} else if (tagName.equals("permission-group")) {
if (parsePermissionGroup(pkg, flags, res, parser, attrs, outError) == null) {
return null;
@@ -1464,7 +1481,71 @@
}
return buildCompoundName(pkg, procSeq, "taskAffinity", outError);
}
-
+
+ private boolean parseKeys(Package owner, Resources res,
+ XmlPullParser parser, AttributeSet attrs, String[] outError)
+ throws XmlPullParserException, IOException {
+ // we've encountered the 'keys' tag
+ // all the keys and keysets that we want must be defined here
+ // so we're going to iterate over the parser and pull out the things we want
+ int outerDepth = parser.getDepth();
+
+ int type;
+ PublicKey currentKey = null;
+ Map<PublicKey, Set<String>> definedKeySets = new HashMap<PublicKey, Set<String>>();
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG) {
+ continue;
+ }
+ String tagname = parser.getName();
+ if (tagname.equals("publicKey")) {
+ final TypedArray sa = res.obtainAttributes(attrs,
+ com.android.internal.R.styleable.PublicKey);
+ final String encodedKey = sa.getNonResourceString(
+ com.android.internal.R.styleable.PublicKey_value);
+ currentKey = parsePublicKey(encodedKey);
+ definedKeySets.put(currentKey, new HashSet<String>());
+ sa.recycle();
+ } else if (tagname.equals("keyset")) {
+ final TypedArray sa = res.obtainAttributes(attrs,
+ com.android.internal.R.styleable.KeySet);
+ final String name = sa.getNonResourceString(
+ com.android.internal.R.styleable.KeySet_name);
+ definedKeySets.get(currentKey).add(name);
+ sa.recycle();
+ } else if (RIGID_PARSER) {
+ Slog.w(TAG, "Bad element under <keys>: " + parser.getName()
+ + " at " + mArchiveSourcePath + " "
+ + parser.getPositionDescription());
+ return false;
+ } else {
+ Slog.w(TAG, "Unknown element under <keys>: " + parser.getName()
+ + " at " + mArchiveSourcePath + " "
+ + parser.getPositionDescription());
+ XmlUtils.skipCurrentTag(parser);
+ continue;
+ }
+ }
+
+ owner.mKeySetMapping = new HashMap<String, Set<PublicKey>>();
+ for (Map.Entry<PublicKey, Set<String>> e : definedKeySets.entrySet()) {
+ PublicKey key = e.getKey();
+ Set<String> keySetNames = e.getValue();
+ for (String alias : keySetNames) {
+ if (owner.mKeySetMapping.containsKey(alias)) {
+ owner.mKeySetMapping.get(alias).add(key);
+ } else {
+ Set<PublicKey> keys = new HashSet<PublicKey>();
+ keys.add(key);
+ owner.mKeySetMapping.put(alias, keys);
+ }
+ }
+ }
+
+ return true;
+ }
+
private PermissionGroup parsePermissionGroup(Package owner, int flags, Resources res,
XmlPullParser parser, AttributeSet attrs, String[] outError)
throws XmlPullParserException, IOException {
@@ -2988,20 +3069,28 @@
Slog.i(TAG, "verifier " + packageName + " public key was null; skipping");
}
+ PublicKey publicKey = parsePublicKey(encodedPublicKey);
+ if (publicKey != null) {
+ return new VerifierInfo(packageName, publicKey);
+ }
+
+ return null;
+ }
+
+ public static final PublicKey parsePublicKey(String encodedPublicKey) {
EncodedKeySpec keySpec;
try {
final byte[] encoded = Base64.decode(encodedPublicKey, Base64.DEFAULT);
keySpec = new X509EncodedKeySpec(encoded);
} catch (IllegalArgumentException e) {
- Slog.i(TAG, "Could not parse verifier " + packageName + " public key; invalid Base64");
+ Slog.i(TAG, "Could not parse verifier public key; invalid Base64");
return null;
}
/* First try the key as an RSA key. */
try {
final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
- final PublicKey publicKey = keyFactory.generatePublic(keySpec);
- return new VerifierInfo(packageName, publicKey);
+ return keyFactory.generatePublic(keySpec);
} catch (NoSuchAlgorithmException e) {
Log.wtf(TAG, "Could not parse public key because RSA isn't included in build");
return null;
@@ -3012,8 +3101,7 @@
/* Now try it as a DSA key. */
try {
final KeyFactory keyFactory = KeyFactory.getInstance("DSA");
- final PublicKey publicKey = keyFactory.generatePublic(keySpec);
- return new VerifierInfo(packageName, publicKey);
+ return keyFactory.generatePublic(keySpec);
} catch (NoSuchAlgorithmException e) {
Log.wtf(TAG, "Could not parse public key because DSA isn't included in build");
return null;
@@ -3254,6 +3342,12 @@
*/
public ManifestDigest manifestDigest;
+ /**
+ * Data used to feed the KeySetManager
+ */
+ public Set<PublicKey> mSigningKeys;
+ public Map<String, Set<PublicKey>> mKeySetMapping;
+
public Package(String _name) {
packageName = _name;
applicationInfo.packageName = _name;
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index f0c6241..e4ecb5c 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -99,9 +99,6 @@
void startAppFreezingScreen(IBinder token, int configChanges);
void stopAppFreezingScreen(IBinder token, boolean force);
void removeAppToken(IBinder token);
- void moveAppToken(int index, IBinder token);
- void moveAppTokensToTop(in List<IBinder> tokens);
- void moveAppTokensToBottom(in List<IBinder> tokens);
// Re-evaluate the current orientation from the caller's state.
// If there is a change, the new Configuration is returned and the
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 5105fda..ff7eb26 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -186,7 +186,7 @@
/**
* Either {@link #LAYOUT_MODE_CLIP_BOUNDS} or {@link #LAYOUT_MODE_OPTICAL_BOUNDS}.
*/
- private int mLayoutMode = DEFAULT_LAYOUT_MODE;
+ private int mLayoutMode = LAYOUT_MODE_UNDEFINED;
/**
* NOTE: If you change the flags below make sure to reflect the changes
@@ -327,6 +327,14 @@
private static final int FLAG_PREVENT_DISPATCH_ATTACHED_TO_WINDOW = 0x400000;
/**
+ * When true, indicates that a layoutMode has been explicitly set, either with
+ * an explicit call to {@link #setLayoutMode(int)} in code or from an XML resource.
+ * This distinguishes the situation in which a layout mode was inherited from
+ * one of the ViewGroup's ancestors and cached locally.
+ */
+ private static final int FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET = 0x800000;
+
+ /**
* Indicates which types of drawing caches are to be kept in memory.
* This field should be made private, so it is hidden from the SDK.
* {@hide}
@@ -355,6 +363,8 @@
// Layout Modes
+ private static final int LAYOUT_MODE_UNDEFINED = -1;
+
/**
* This constant is a {@link #setLayoutMode(int) layoutMode}.
* Clip bounds are the raw values of {@link #getLeft() left}, {@link #getTop() top},
@@ -371,7 +381,7 @@
public static final int LAYOUT_MODE_OPTICAL_BOUNDS = 1;
/** @hide */
- public static int DEFAULT_LAYOUT_MODE = LAYOUT_MODE_CLIP_BOUNDS;
+ public static int LAYOUT_MODE_DEFAULT = LAYOUT_MODE_CLIP_BOUNDS;
/**
* We clip to padding when FLAG_CLIP_TO_PADDING and FLAG_PADDING_NOT_NULL
@@ -507,7 +517,7 @@
}
break;
case R.styleable.ViewGroup_layoutMode:
- setLayoutMode(a.getInt(attr, DEFAULT_LAYOUT_MODE));
+ setLayoutMode(a.getInt(attr, LAYOUT_MODE_UNDEFINED));
break;
}
}
@@ -3374,6 +3384,25 @@
}
}
+ private void clearCachedLayoutMode() {
+ if (mLayoutMode != LAYOUT_MODE_UNDEFINED &&
+ (mGroupFlags & FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET) == 0) {
+ mLayoutMode = LAYOUT_MODE_UNDEFINED;
+ }
+ }
+
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ clearCachedLayoutMode();
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ clearCachedLayoutMode();
+ }
+
/**
* Adds a view during layout. This is useful if in your onLayout() method,
* you need to add more views (as does the list view for example).
@@ -4710,29 +4739,36 @@
}
/**
- * Returns the basis of alignment during layout operations on this view group:
+ * Returns the basis of alignment during layout operations on this ViewGroup:
* either {@link #LAYOUT_MODE_CLIP_BOUNDS} or {@link #LAYOUT_MODE_OPTICAL_BOUNDS}.
+ * <p>
+ * If no layoutMode was explicitly set, either programmatically or in an XML resource,
+ * the method returns the layoutMode of the view's parent ViewGroup if such a parent exists,
+ * otherwise the method returns a default value of {@link #LAYOUT_MODE_CLIP_BOUNDS}.
*
* @return the layout mode to use during layout operations
*
* @see #setLayoutMode(int)
*/
public int getLayoutMode() {
+ if (mLayoutMode == LAYOUT_MODE_UNDEFINED) {
+ mLayoutMode = (mParent instanceof ViewGroup) ?
+ ((ViewGroup)mParent).getLayoutMode() : LAYOUT_MODE_DEFAULT;
+ }
return mLayoutMode;
}
/**
- * Sets the basis of alignment during the layout of this view group.
+ * Sets the basis of alignment during the layout of this ViewGroup.
* Valid values are either {@link #LAYOUT_MODE_CLIP_BOUNDS} or
* {@link #LAYOUT_MODE_OPTICAL_BOUNDS}.
- * <p>
- * The default is {@link #LAYOUT_MODE_CLIP_BOUNDS}.
*
* @param layoutMode the layout mode to use during layout operations
*
* @see #getLayoutMode()
*/
public void setLayoutMode(int layoutMode) {
+ setBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET, layoutMode != LAYOUT_MODE_UNDEFINED);
if (mLayoutMode != layoutMode) {
mLayoutMode = layoutMode;
requestLayout();
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 792188b..4cc9adb 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -527,6 +527,14 @@
*/
public static final int TYPE_RECENTS_OVERLAY = FIRST_SYSTEM_WINDOW+28;
+
+ /**
+ * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
+ * In multiuser systems shows on all users' windows.
+ * @hide
+ */
+ public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
+
/**
* End of types of system windows.
*/
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index f3983187..00b00cd 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -856,7 +856,7 @@
* defaults to 'text/html'.
* @param encoding the encoding of the data
* @param historyUrl the URL to use as the history entry. If null defaults
- * to 'about:blank'.
+ * to 'about:blank'. If non-null, this must be a valid URL.
*/
public void loadDataWithBaseURL(String baseUrl, String data,
String mimeType, String encoding, String historyUrl) {
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 85ed8db..52acd4f 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -124,6 +124,17 @@
* GridLayout's algorithms favour rows and columns that are closer to its <em>right</em>
* and <em>bottom</em> edges.
*
+ * <h4>Interpretation of GONE</h4>
+ *
+ * For layout purposes, GridLayout treats views whose visibility status is
+ * {@link View#GONE GONE}, as having zero width and height. This is subtly different from
+ * the policy of ignoring views that are marked as GONE outright. If, for example, a gone-marked
+ * view was alone in a column, that column would itself collapse to zero width if and only if
+ * no gravity was defined on the view. If gravity was defined, then the gone-marked
+ * view has no effect on the layout and the container should be laid out as if the view
+ * had never been added to it.
+ * These statements apply equally to rows as well as columns, and to groups of rows or columns.
+ *
* <h5>Limitations</h5>
*
* GridLayout does not provide support for the principle of <em>weight</em>, as defined in
@@ -915,7 +926,7 @@
protected void onChildVisibilityChanged(View child, int oldVisibility, int newVisibility) {
super.onChildVisibilityChanged(child, oldVisibility, newVisibility);
if (oldVisibility == GONE || newVisibility == GONE) {
- invalidateStructure();
+ invalidateStructure();
}
}
@@ -1235,6 +1246,7 @@
Assoc<Spec, Bounds> assoc = Assoc.of(Spec.class, Bounds.class);
for (int i = 0, N = getChildCount(); i < N; i++) {
View c = getChildAt(i);
+ // we must include views that are GONE here, see introductory javadoc
LayoutParams lp = getLayoutParams(c);
Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
Bounds bounds = getAlignment(spec.alignment, horizontal).getBounds();
@@ -1250,6 +1262,7 @@
}
for (int i = 0, N = getChildCount(); i < N; i++) {
View c = getChildAt(i);
+ // we must include views that are GONE here, see introductory javadoc
LayoutParams lp = getLayoutParams(c);
Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
groupBounds.getValue(i).include(GridLayout.this, c, spec, this);
@@ -2655,6 +2668,9 @@
@Override
public int getAlignmentValue(View view, int viewSize, int mode) {
+ if (view.getVisibility() == GONE) {
+ return 0;
+ }
int baseline = view.getBaseline();
return baseline == -1 ? UNDEFINED : baseline;
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a1ced6e..6ea9482 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -282,6 +282,13 @@
private boolean mPreDrawRegistered;
+ // A flag to prevent repeated movements from escaping the enclosing text view. The idea here is
+ // that if a user is holding down a movement key to traverse text, we shouldn't also traverse
+ // the view hierarchy. On the other hand, if the user is using the movement key to traverse views
+ // (i.e. the first movement was to traverse out of this view, or this view was traversed into by
+ // the user holding the movement key down) then we shouldn't prevent the focus from changing.
+ private boolean mPreventDefaultMovement;
+
private TextUtils.TruncateAt mEllipsize;
static class Drawables {
@@ -5229,7 +5236,6 @@
public boolean onKeyDown(int keyCode, KeyEvent event) {
int which = doKeyDown(keyCode, event, null);
if (which == 0) {
- // Go through default dispatching.
return super.onKeyDown(keyCode, event);
}
@@ -5327,6 +5333,15 @@
return 0;
}
+ // If this is the initial keydown, we don't want to prevent a movement away from this view.
+ // While this shouldn't be necessary because any time we're preventing default movement we
+ // should be restricting the focus to remain within this view, thus we'll also receive
+ // the key up event, occasionally key up events will get dropped and we don't want to
+ // prevent the user from traversing out of this on the next key down.
+ if (event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(keyCode)) {
+ mPreventDefaultMovement = false;
+ }
+
switch (keyCode) {
case KeyEvent.KEYCODE_ENTER:
if (event.hasNoModifiers()) {
@@ -5435,12 +5450,16 @@
}
}
if (doDown) {
- if (mMovement.onKeyDown(this, (Spannable)mText, keyCode, event))
+ if (mMovement.onKeyDown(this, (Spannable)mText, keyCode, event)) {
+ if (event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(keyCode)) {
+ mPreventDefaultMovement = true;
+ }
return 2;
+ }
}
}
- return 0;
+ return mPreventDefaultMovement && !KeyEvent.isModifierKey(keyCode) ? -1 : 0;
}
/**
@@ -5473,6 +5492,10 @@
return super.onKeyUp(keyCode, event);
}
+ if (!KeyEvent.isModifierKey(keyCode)) {
+ mPreventDefaultMovement = false;
+ }
+
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
if (event.hasNoModifiers()) {
diff --git a/core/java/com/android/internal/policy/IKeyguardResult.aidl b/core/java/com/android/internal/policy/IKeyguardResult.aidl
new file mode 100644
index 0000000..998cd61
--- /dev/null
+++ b/core/java/com/android/internal/policy/IKeyguardResult.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2012 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.internal.policy;
+
+oneway interface IKeyguardResult {
+ void onShown(IBinder windowToken);
+ void onKeyguardExitResult(boolean success);
+}
diff --git a/core/java/com/android/internal/policy/IKeyguardService.aidl b/core/java/com/android/internal/policy/IKeyguardService.aidl
new file mode 100644
index 0000000..76a4cfa
--- /dev/null
+++ b/core/java/com/android/internal/policy/IKeyguardService.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 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.internal.policy;
+
+import com.android.internal.policy.IKeyguardResult;
+
+import android.os.Bundle;
+
+interface IKeyguardService {
+ boolean isShowing();
+ boolean isSecure();
+ boolean isShowingAndNotHidden();
+ boolean isInputRestricted();
+ boolean isDismissable();
+ oneway void userActivity();
+ oneway void verifyUnlock(IKeyguardResult result);
+ oneway void keyguardDone(boolean authenticated, boolean wakeup);
+ oneway void setHidden(boolean isHidden);
+ oneway void dismiss();
+ oneway void onWakeKeyWhenKeyguardShowingTq(int keyCode);
+ oneway void onWakeMotionWhenKeyguardShowingTq();
+ oneway void onDreamingStarted();
+ oneway void onDreamingStopped();
+ oneway void onScreenTurnedOff(int reason);
+ oneway void onScreenTurnedOn(IKeyguardResult result);
+ oneway void setKeyguardEnabled(boolean enabled);
+ oneway void onSystemReady();
+ oneway void doKeyguardTimeout(in Bundle options);
+ oneway void setCurrentUser(int userId);
+ oneway void showAssistant();
+}
diff --git a/core/java/com/android/internal/widget/TransportControlView.java b/core/java/com/android/internal/widget/TransportControlView.java
deleted file mode 100644
index c33f038..0000000
--- a/core/java/com/android/internal/widget/TransportControlView.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * Copyright (C) 2011 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.internal.widget;
-
-import java.lang.ref.WeakReference;
-
-import com.android.internal.widget.LockScreenWidgetCallback;
-import com.android.internal.widget.LockScreenWidgetInterface;
-
-import android.app.PendingIntent;
-import android.app.PendingIntent.CanceledException;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.media.AudioManager;
-import android.media.MediaMetadataRetriever;
-import android.media.RemoteControlClient;
-import android.media.IRemoteControlDisplay;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.RemoteException;
-import android.os.SystemClock;
-import android.text.Spannable;
-import android.text.TextUtils;
-import android.text.style.ForegroundColorSpan;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-
-import com.android.internal.R;
-
-public class TransportControlView extends FrameLayout implements OnClickListener,
- LockScreenWidgetInterface {
-
- private static final int MSG_UPDATE_STATE = 100;
- private static final int MSG_SET_METADATA = 101;
- private static final int MSG_SET_TRANSPORT_CONTROLS = 102;
- private static final int MSG_SET_ARTWORK = 103;
- private static final int MSG_SET_GENERATION_ID = 104;
- private static final int MAXDIM = 512;
- private static final int DISPLAY_TIMEOUT_MS = 5000; // 5s
- protected static final boolean DEBUG = false;
- protected static final String TAG = "TransportControlView";
-
- private ImageView mAlbumArt;
- private TextView mTrackTitle;
- private ImageView mBtnPrev;
- private ImageView mBtnPlay;
- private ImageView mBtnNext;
- private int mClientGeneration;
- private Metadata mMetadata = new Metadata();
- private boolean mAttached;
- private PendingIntent mClientIntent;
- private int mTransportControlFlags;
- private int mCurrentPlayState;
- private AudioManager mAudioManager;
- private LockScreenWidgetCallback mWidgetCallbacks;
- private IRemoteControlDisplayWeak mIRCD;
-
- /**
- * The metadata which should be populated into the view once we've been attached
- */
- private Bundle mPopulateMetadataWhenAttached = null;
-
- // This handler is required to ensure messages from IRCD are handled in sequence and on
- // the UI thread.
- private Handler mHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_UPDATE_STATE:
- if (mClientGeneration == msg.arg1) updatePlayPauseState(msg.arg2);
- break;
-
- case MSG_SET_METADATA:
- if (mClientGeneration == msg.arg1) updateMetadata((Bundle) msg.obj);
- break;
-
- case MSG_SET_TRANSPORT_CONTROLS:
- if (mClientGeneration == msg.arg1) updateTransportControls(msg.arg2);
- break;
-
- case MSG_SET_ARTWORK:
- if (mClientGeneration == msg.arg1) {
- if (mMetadata.bitmap != null) {
- mMetadata.bitmap.recycle();
- }
- mMetadata.bitmap = (Bitmap) msg.obj;
- mAlbumArt.setImageBitmap(mMetadata.bitmap);
- }
- break;
-
- case MSG_SET_GENERATION_ID:
- if (msg.arg2 != 0) {
- // This means nobody is currently registered. Hide the view.
- if (mWidgetCallbacks != null) {
- mWidgetCallbacks.requestHide(TransportControlView.this);
- }
- }
- if (DEBUG) Log.v(TAG, "New genId = " + msg.arg1 + ", clearing = " + msg.arg2);
- mClientGeneration = msg.arg1;
- mClientIntent = (PendingIntent) msg.obj;
- break;
-
- }
- }
- };
-
- /**
- * This class is required to have weak linkage to the current TransportControlView
- * because the remote process can hold a strong reference to this binder object and
- * we can't predict when it will be GC'd in the remote process. Without this code, it
- * would allow a heavyweight object to be held on this side of the binder when there's
- * no requirement to run a GC on the other side.
- */
- private static class IRemoteControlDisplayWeak extends IRemoteControlDisplay.Stub {
- private WeakReference<Handler> mLocalHandler;
-
- IRemoteControlDisplayWeak(Handler handler) {
- mLocalHandler = new WeakReference<Handler>(handler);
- }
-
- public void setPlaybackState(int generationId, int state, long stateChangeTimeMs) {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_UPDATE_STATE, generationId, state).sendToTarget();
- }
- }
-
- public void setMetadata(int generationId, Bundle metadata) {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_SET_METADATA, generationId, 0, metadata).sendToTarget();
- }
- }
-
- public void setTransportControlFlags(int generationId, int flags) {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_SET_TRANSPORT_CONTROLS, generationId, flags)
- .sendToTarget();
- }
- }
-
- public void setArtwork(int generationId, Bitmap bitmap) {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_SET_ARTWORK, generationId, 0, bitmap).sendToTarget();
- }
- }
-
- public void setAllMetadata(int generationId, Bundle metadata, Bitmap bitmap) {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_SET_METADATA, generationId, 0, metadata).sendToTarget();
- handler.obtainMessage(MSG_SET_ARTWORK, generationId, 0, bitmap).sendToTarget();
- }
- }
-
- public void setCurrentClientId(int clientGeneration, PendingIntent mediaIntent,
- boolean clearing) throws RemoteException {
- Handler handler = mLocalHandler.get();
- if (handler != null) {
- handler.obtainMessage(MSG_SET_GENERATION_ID,
- clientGeneration, (clearing ? 1 : 0), mediaIntent).sendToTarget();
- }
- }
- };
-
- public TransportControlView(Context context, AttributeSet attrs) {
- super(context, attrs);
- if (DEBUG) Log.v(TAG, "Create TCV " + this);
- mAudioManager = new AudioManager(mContext);
- mCurrentPlayState = RemoteControlClient.PLAYSTATE_NONE; // until we get a callback
- mIRCD = new IRemoteControlDisplayWeak(mHandler);
- }
-
- private void updateTransportControls(int transportControlFlags) {
- mTransportControlFlags = transportControlFlags;
- }
-
- @Override
- public void onFinishInflate() {
- super.onFinishInflate();
- mTrackTitle = (TextView) findViewById(R.id.title);
- mTrackTitle.setSelected(true); // enable marquee
- mAlbumArt = (ImageView) findViewById(R.id.albumart);
- mBtnPrev = (ImageView) findViewById(R.id.btn_prev);
- mBtnPlay = (ImageView) findViewById(R.id.btn_play);
- mBtnNext = (ImageView) findViewById(R.id.btn_next);
- final View buttons[] = { mBtnPrev, mBtnPlay, mBtnNext };
- for (View view : buttons) {
- view.setOnClickListener(this);
- }
- }
-
- @Override
- public void onAttachedToWindow() {
- super.onAttachedToWindow();
- if (mPopulateMetadataWhenAttached != null) {
- updateMetadata(mPopulateMetadataWhenAttached);
- mPopulateMetadataWhenAttached = null;
- }
- if (!mAttached) {
- if (DEBUG) Log.v(TAG, "Registering TCV " + this);
- mAudioManager.registerRemoteControlDisplay(mIRCD);
- }
- mAttached = true;
- }
-
- @Override
- public void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- if (mAttached) {
- if (DEBUG) Log.v(TAG, "Unregistering TCV " + this);
- mAudioManager.unregisterRemoteControlDisplay(mIRCD);
- }
- mAttached = false;
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int dim = Math.min(MAXDIM, Math.max(getWidth(), getHeight()));
-// Log.v(TAG, "setting max bitmap size: " + dim + "x" + dim);
-// mAudioManager.remoteControlDisplayUsesBitmapSize(mIRCD, dim, dim);
- }
-
- class Metadata {
- private String artist;
- private String trackTitle;
- private String albumTitle;
- private Bitmap bitmap;
-
- public String toString() {
- return "Metadata[artist=" + artist + " trackTitle=" + trackTitle + " albumTitle=" + albumTitle + "]";
- }
- }
-
- private String getMdString(Bundle data, int id) {
- return data.getString(Integer.toString(id));
- }
-
- private void updateMetadata(Bundle data) {
- if (mAttached) {
- mMetadata.artist = getMdString(data, MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST);
- mMetadata.trackTitle = getMdString(data, MediaMetadataRetriever.METADATA_KEY_TITLE);
- mMetadata.albumTitle = getMdString(data, MediaMetadataRetriever.METADATA_KEY_ALBUM);
- populateMetadata();
- } else {
- mPopulateMetadataWhenAttached = data;
- }
- }
-
- /**
- * Populates the given metadata into the view
- */
- private void populateMetadata() {
- StringBuilder sb = new StringBuilder();
- int trackTitleLength = 0;
- if (!TextUtils.isEmpty(mMetadata.trackTitle)) {
- sb.append(mMetadata.trackTitle);
- trackTitleLength = mMetadata.trackTitle.length();
- }
- if (!TextUtils.isEmpty(mMetadata.artist)) {
- if (sb.length() != 0) {
- sb.append(" - ");
- }
- sb.append(mMetadata.artist);
- }
- if (!TextUtils.isEmpty(mMetadata.albumTitle)) {
- if (sb.length() != 0) {
- sb.append(" - ");
- }
- sb.append(mMetadata.albumTitle);
- }
- mTrackTitle.setText(sb.toString(), TextView.BufferType.SPANNABLE);
- Spannable str = (Spannable) mTrackTitle.getText();
- if (trackTitleLength != 0) {
- str.setSpan(new ForegroundColorSpan(0xffffffff), 0, trackTitleLength,
- Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- trackTitleLength++;
- }
- if (sb.length() > trackTitleLength) {
- str.setSpan(new ForegroundColorSpan(0x7fffffff), trackTitleLength, sb.length(),
- Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- }
-
- mAlbumArt.setImageBitmap(mMetadata.bitmap);
- final int flags = mTransportControlFlags;
- setVisibilityBasedOnFlag(mBtnPrev, flags, RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS);
- setVisibilityBasedOnFlag(mBtnNext, flags, RemoteControlClient.FLAG_KEY_MEDIA_NEXT);
- setVisibilityBasedOnFlag(mBtnPlay, flags,
- RemoteControlClient.FLAG_KEY_MEDIA_PLAY
- | RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
- | RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
- | RemoteControlClient.FLAG_KEY_MEDIA_STOP);
-
- updatePlayPauseState(mCurrentPlayState);
- }
-
- private static void setVisibilityBasedOnFlag(View view, int flags, int flag) {
- if ((flags & flag) != 0) {
- view.setVisibility(View.VISIBLE);
- } else {
- view.setVisibility(View.GONE);
- }
- }
-
- private void updatePlayPauseState(int state) {
- if (DEBUG) Log.v(TAG,
- "updatePlayPauseState(), old=" + mCurrentPlayState + ", state=" + state);
- if (state == mCurrentPlayState) {
- return;
- }
- final int imageResId;
- final int imageDescId;
- boolean showIfHidden = false;
- switch (state) {
- case RemoteControlClient.PLAYSTATE_ERROR:
- imageResId = com.android.internal.R.drawable.stat_sys_warning;
- // TODO use more specific image description string for warning, but here the "play"
- // message is still valid because this button triggers a play command.
- imageDescId = com.android.internal.R.string.lockscreen_transport_play_description;
- break;
-
- case RemoteControlClient.PLAYSTATE_PLAYING:
- imageResId = com.android.internal.R.drawable.ic_media_pause;
- imageDescId = com.android.internal.R.string.lockscreen_transport_pause_description;
- showIfHidden = true;
- break;
-
- case RemoteControlClient.PLAYSTATE_BUFFERING:
- imageResId = com.android.internal.R.drawable.ic_media_stop;
- imageDescId = com.android.internal.R.string.lockscreen_transport_stop_description;
- showIfHidden = true;
- break;
-
- case RemoteControlClient.PLAYSTATE_PAUSED:
- default:
- imageResId = com.android.internal.R.drawable.ic_media_play;
- imageDescId = com.android.internal.R.string.lockscreen_transport_play_description;
- showIfHidden = false;
- break;
- }
- mBtnPlay.setImageResource(imageResId);
- mBtnPlay.setContentDescription(getResources().getString(imageDescId));
- if (showIfHidden && mWidgetCallbacks != null && !mWidgetCallbacks.isVisible(this)) {
- mWidgetCallbacks.requestShow(this);
- }
- mCurrentPlayState = state;
- }
-
- static class SavedState extends BaseSavedState {
- boolean wasShowing;
-
- SavedState(Parcelable superState) {
- super(superState);
- }
-
- private SavedState(Parcel in) {
- super(in);
- this.wasShowing = in.readInt() != 0;
- }
-
- @Override
- public void writeToParcel(Parcel out, int flags) {
- super.writeToParcel(out, flags);
- out.writeInt(this.wasShowing ? 1 : 0);
- }
-
- public static final Parcelable.Creator<SavedState> CREATOR
- = new Parcelable.Creator<SavedState>() {
- public SavedState createFromParcel(Parcel in) {
- return new SavedState(in);
- }
-
- public SavedState[] newArray(int size) {
- return new SavedState[size];
- }
- };
- }
-
- @Override
- public Parcelable onSaveInstanceState() {
- if (DEBUG) Log.v(TAG, "onSaveInstanceState()");
- Parcelable superState = super.onSaveInstanceState();
- SavedState ss = new SavedState(superState);
- ss.wasShowing = mWidgetCallbacks != null && mWidgetCallbacks.isVisible(this);
- return ss;
- }
-
- @Override
- public void onRestoreInstanceState(Parcelable state) {
- if (DEBUG) Log.v(TAG, "onRestoreInstanceState()");
- if (!(state instanceof SavedState)) {
- super.onRestoreInstanceState(state);
- return;
- }
- SavedState ss = (SavedState) state;
- super.onRestoreInstanceState(ss.getSuperState());
- if (ss.wasShowing && mWidgetCallbacks != null) {
- mWidgetCallbacks.requestShow(this);
- }
- }
-
- public void onClick(View v) {
- int keyCode = -1;
- if (v == mBtnPrev) {
- keyCode = KeyEvent.KEYCODE_MEDIA_PREVIOUS;
- } else if (v == mBtnNext) {
- keyCode = KeyEvent.KEYCODE_MEDIA_NEXT;
- } else if (v == mBtnPlay) {
- keyCode = KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE;
-
- }
- if (keyCode != -1) {
- sendMediaButtonClick(keyCode);
- if (mWidgetCallbacks != null) {
- mWidgetCallbacks.userActivity(this);
- }
- }
- }
-
- private void sendMediaButtonClick(int keyCode) {
- if (mClientIntent == null) {
- // Shouldn't be possible because this view should be hidden in this case.
- Log.e(TAG, "sendMediaButtonClick(): No client is currently registered");
- return;
- }
- // use the registered PendingIntent that will be processed by the registered
- // media button event receiver, which is the component of mClientIntent
- KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
- Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
- intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
- try {
- mClientIntent.send(getContext(), 0, intent);
- } catch (CanceledException e) {
- Log.e(TAG, "Error sending intent for media button down: "+e);
- e.printStackTrace();
- }
-
- keyEvent = new KeyEvent(KeyEvent.ACTION_UP, keyCode);
- intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
- intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
- try {
- mClientIntent.send(getContext(), 0, intent);
- } catch (CanceledException e) {
- Log.e(TAG, "Error sending intent for media button up: "+e);
- e.printStackTrace();
- }
- }
-
- public void setCallback(LockScreenWidgetCallback callback) {
- mWidgetCallbacks = callback;
- }
-
- public boolean providesClock() {
- return false;
- }
-
- private boolean wasPlayingRecently(int state, long stateChangeTimeMs) {
- switch (state) {
- case RemoteControlClient.PLAYSTATE_PLAYING:
- case RemoteControlClient.PLAYSTATE_FAST_FORWARDING:
- case RemoteControlClient.PLAYSTATE_REWINDING:
- case RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS:
- case RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS:
- case RemoteControlClient.PLAYSTATE_BUFFERING:
- // actively playing or about to play
- return true;
- case RemoteControlClient.PLAYSTATE_NONE:
- return false;
- case RemoteControlClient.PLAYSTATE_STOPPED:
- case RemoteControlClient.PLAYSTATE_PAUSED:
- case RemoteControlClient.PLAYSTATE_ERROR:
- // we have stopped playing, check how long ago
- if (DEBUG) {
- if ((SystemClock.elapsedRealtime() - stateChangeTimeMs) < DISPLAY_TIMEOUT_MS) {
- Log.v(TAG, "wasPlayingRecently: time < TIMEOUT was playing recently");
- } else {
- Log.v(TAG, "wasPlayingRecently: time > TIMEOUT");
- }
- }
- return ((SystemClock.elapsedRealtime() - stateChangeTimeMs) < DISPLAY_TIMEOUT_MS);
- default:
- Log.e(TAG, "Unknown playback state " + state + " in wasPlayingRecently()");
- return false;
- }
- }
-}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 8a53cc3..bedb33c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2187,6 +2187,13 @@
android:description="@string/permdesc_accessNotifications"
android:protectionLevel="signature|system" />
+ <!-- Allows access to keyguard secure storage. Only allowed for system processes.
+ @hide -->
+ <permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"
+ android:protectionLevel="signature"
+ android:label="@string/permlab_access_keyguard_secure_storage"
+ android:description="@string/permdesc_access_keyguard_secure_storage" />
+
<!-- The system process is explicitly the only one allowed to launch the
confirmation UI for full backup/restore -->
<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>
diff --git a/core/res/res/drawable-hdpi/kg_add_widget.png b/core/res/res/drawable-hdpi/kg_add_widget.png
deleted file mode 100644
index 68971a5..0000000
--- a/core/res/res/drawable-hdpi/kg_add_widget.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_security_lock_focused.png b/core/res/res/drawable-hdpi/kg_security_lock_focused.png
deleted file mode 100644
index abcf683..0000000
--- a/core/res/res/drawable-hdpi/kg_security_lock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_security_lock_normal.png b/core/res/res/drawable-hdpi/kg_security_lock_normal.png
deleted file mode 100644
index e8cff24..0000000
--- a/core/res/res/drawable-hdpi/kg_security_lock_normal.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_security_lock_pressed.png b/core/res/res/drawable-hdpi/kg_security_lock_pressed.png
deleted file mode 100644
index 3214dcb..0000000
--- a/core/res/res/drawable-hdpi/kg_security_lock_pressed.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget.png b/core/res/res/drawable-mdpi/kg_add_widget.png
deleted file mode 100644
index 136ae17..0000000
--- a/core/res/res/drawable-mdpi/kg_add_widget.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_security_lock_focused.png b/core/res/res/drawable-mdpi/kg_security_lock_focused.png
deleted file mode 100644
index c567a82..0000000
--- a/core/res/res/drawable-mdpi/kg_security_lock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_security_lock_normal.png b/core/res/res/drawable-mdpi/kg_security_lock_normal.png
deleted file mode 100644
index 6fbecc1..0000000
--- a/core/res/res/drawable-mdpi/kg_security_lock_normal.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_security_lock_pressed.png b/core/res/res/drawable-mdpi/kg_security_lock_pressed.png
deleted file mode 100644
index a883258..0000000
--- a/core/res/res/drawable-mdpi/kg_security_lock_pressed.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget.png b/core/res/res/drawable-xhdpi/kg_add_widget.png
deleted file mode 100644
index ca48be2..0000000
--- a/core/res/res/drawable-xhdpi/kg_add_widget.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_security_lock_focused.png b/core/res/res/drawable-xhdpi/kg_security_lock_focused.png
deleted file mode 100644
index ee21647..0000000
--- a/core/res/res/drawable-xhdpi/kg_security_lock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_security_lock_normal.png b/core/res/res/drawable-xhdpi/kg_security_lock_normal.png
deleted file mode 100644
index eae7d8c..0000000
--- a/core/res/res/drawable-xhdpi/kg_security_lock_normal.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_security_lock_pressed.png b/core/res/res/drawable-xhdpi/kg_security_lock_pressed.png
deleted file mode 100644
index 5e9a52b..0000000
--- a/core/res/res/drawable-xhdpi/kg_security_lock_pressed.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/lockscreen_password_field_dark.xml b/core/res/res/drawable/lockscreen_password_field_dark.xml
deleted file mode 100644
index 92ceb79..0000000
--- a/core/res/res/drawable/lockscreen_password_field_dark.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_bg_default_holo_dark" />
- <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_bg_disabled_holo_dark" />
- <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_bg_activated_holo_dark" />
- <iten android:state_enabled="true" android:state_activated="true" android:drawable="@drawable/textfield_bg_focused_holo_dark" />
- <item android:state_enabled="true" android:drawable="@drawable/textfield_bg_default_holo_dark" />
- <item android:state_focused="true" android:drawable="@drawable/textfield_bg_disabled_focused_holo_dark" />
- <item android:drawable="@drawable/textfield_bg_disabled_holo_dark" />
-</selector>
-
diff --git a/core/res/res/layout-land/keyguard_glow_pad_container.xml b/core/res/res/layout-land/keyguard_glow_pad_container.xml
deleted file mode 100644
index f8364f1..0000000
--- a/core/res/res/layout-land/keyguard_glow_pad_container.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2012, 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.
-*/
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/keyguard_glow_pad_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center" />
-</merge>
\ No newline at end of file
diff --git a/core/res/res/layout-sw600dp-port/keyguard_status_area.xml b/core/res/res/layout-sw600dp-port/keyguard_status_area.xml
deleted file mode 100644
index 88dd760..0000000
--- a/core/res/res/layout-sw600dp-port/keyguard_status_area.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2009, 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.
-*/
--->
-
-<!-- This is a view that shows general status information in Keyguard. -->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/keyguard_status_area"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:layout_marginTop="-16dp"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/kg_status_date_font_size"
- />
-
- <TextView
- android:id="@+id/alarm_status"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:layout_marginTop="28dp"
- android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearance"
- android:textSize="@dimen/kg_status_line_font_size"
- android:drawablePadding="4dip"
- />
-
-</LinearLayout>
diff --git a/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml b/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml
deleted file mode 100644
index 2e6fa37..0000000
--- a/core/res/res/layout-sw600dp/keyguard_sim_puk_pin_navigation.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2012, 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.
-*/
--->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
diff --git a/core/res/res/layout-sw600dp/keyguard_transport_control.xml b/core/res/res/layout-sw600dp/keyguard_transport_control.xml
deleted file mode 100644
index f864339..0000000
--- a/core/res/res/layout-sw600dp/keyguard_transport_control.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-
-<!-- *** Note *** This should mirror the file in layout/ with the exception of the background set
- here for adding a drop shadow on tablets. -->
-
-<com.android.internal.widget.TransportControlView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/transport_controls"
- android:background="@drawable/transportcontrol_bg">
-
- <!-- FrameLayout used as scrim to show between album art and buttons -->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:foreground="@drawable/ic_lockscreen_player_background">
- <!-- We use ImageView for its cropping features, otherwise could be android:background -->
- <ImageView
- android:id="@+id/albumart"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="fill"
- android:scaleType="centerCrop"
- android:adjustViewBounds="false"
- />
- </FrameLayout>
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom">
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip"
- android:gravity="center_horizontal"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceMedium"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginTop="5dip">
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1">
- <ImageView
- android:id="@+id/btn_prev"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:src="@drawable/ic_media_previous"
- android:clickable="true"
- android:background="?android:attr/selectableItemBackground"
- android:padding="10dip"
- android:contentDescription="@string/lockscreen_transport_prev_description"/>
- </FrameLayout>
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1">
- <ImageView
- android:id="@+id/btn_play"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:clickable="true"
- android:src="@drawable/ic_media_play"
- android:background="?android:attr/selectableItemBackground"
- android:padding="10dip"
- android:contentDescription="@string/lockscreen_transport_play_description"/>
- </FrameLayout>
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1">
- <ImageView
- android:id="@+id/btn_next"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:clickable="true"
- android:src="@drawable/ic_media_next"
- android:background="?android:attr/selectableItemBackground"
- android:padding="10dip"
- android:contentDescription="@string/lockscreen_transport_next_description"/>
- </FrameLayout>
- </LinearLayout>
- </LinearLayout>
-
-</com.android.internal.widget.TransportControlView>
diff --git a/core/res/res/layout/keyguard_multi_user_selector_widget.xml b/core/res/res/layout/keyguard_multi_user_selector_widget.xml
deleted file mode 100644
index fc126fe..0000000
--- a/core/res/res/layout/keyguard_multi_user_selector_widget.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2009, 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.
-*/
--->
-
-<!-- This is a view that shows general status information in Keyguard. -->
-<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/keyguard_multi_user_selector"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
\ No newline at end of file
diff --git a/core/res/res/layout/keyguard_sim_puk_pin_account_navigation.xml b/core/res/res/layout/keyguard_sim_puk_pin_account_navigation.xml
deleted file mode 100644
index 2e6fa37..0000000
--- a/core/res/res/layout/keyguard_sim_puk_pin_account_navigation.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2012, 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.
-*/
--->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index a64758c..8cfad68 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Altydaan-VPN koppel tans..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Altydaan-VPN gekoppel"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Altydaan-VPN-fout"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Raak om op te stel"</string>
<string name="upload_file" msgid="2897957172366730416">"Kies lêer"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Geen lêer gekies nie"</string>
<string name="reset" msgid="2448168080964209908">"Stel terug"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 2a23541..2cef636 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"ሁልጊዜ የበራ VPN በመገናኘት ላይ…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"ሁልጊዜ የበራ VPN ተገናኝቷል"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"ሁልጊዜ የበራ VPN ስህተት"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"ለማዋቀር ይንኩ"</string>
<string name="upload_file" msgid="2897957172366730416">"ፋይል ምረጥ"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"ምንም ፋይል አልተመረጠም"</string>
<string name="reset" msgid="2448168080964209908">"ዳግም አስጀምር"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index cba7680..9f6345f 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"جارٍ الاتصال بشبكة ظاهرية خاصة (VPN) دائمة التشغيل..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"تم الاتصال بشبكة ظاهرية خاصة (VPN) دائمة التشغيل"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"خطأ بشبكة ظاهرية خاصة (VPN) دائمة التشغيل"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"المس للتهيئة"</string>
<string name="upload_file" msgid="2897957172366730416">"اختيار ملف"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"لم يتم اختيار أي ملف"</string>
<string name="reset" msgid="2448168080964209908">"إعادة تعيين"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index a2284ce..2c6aff3 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Падключэнне заўсёды ўключанага VPN..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Заўсёды ўключаны i падключаны VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Памылка заўсёды ўключанага VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Націсніце, каб змяніць налады"</string>
<string name="upload_file" msgid="2897957172366730416">"Выберыце файл"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Файл не выбраны"</string>
<string name="reset" msgid="2448168080964209908">"Скінуць"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index cc8ec59..f5f89a6 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Установява се връзка с винаги включената виртуална частна мрежа (VPN)…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Установена е връзка с винаги включената виртуална частна мрежа (VPN)"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Грешка във винаги включената виртуална частна мрежа (VPN)"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Докоснете, за да конфигурирате"</string>
<string name="upload_file" msgid="2897957172366730416">"Избор на файл"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Няма избран файл"</string>
<string name="reset" msgid="2448168080964209908">"Повторно задаване"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 4e8aa9c..b077308 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"T\'estàs connectant a la VPN sempre activada…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Estàs connectat a la VPN sempre activada"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Error de la VPN sempre activada"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Toca per configurar"</string>
<string name="upload_file" msgid="2897957172366730416">"Trieu un fitxer"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"No s\'ha escollit cap fitxer"</string>
<string name="reset" msgid="2448168080964209908">"Reinicia"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 76c17de..3482ed4f 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Připojování k trvalé síti VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Je připojena trvalá síť VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Chyba trvalé sítě VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Dotykem zahájíte konfiguraci"</string>
<string name="upload_file" msgid="2897957172366730416">"Zvolit soubor"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Není vybrán žádný soubor"</string>
<string name="reset" msgid="2448168080964209908">"Resetovat"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 6b01a68..3fb84ec 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Opretter forbindelse til Always-on VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Always-on VPN er forbundet"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Fejl i Always-on VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Tryk for at konfigurere"</string>
<string name="upload_file" msgid="2897957172366730416">"Vælg fil"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Ingen fil er valgt"</string>
<string name="reset" msgid="2448168080964209908">"Nulstil"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 7fb0014..95e0b5b 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Verbindung zu durchgehend aktivem VPN wird hergestellt…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Mit durchgehend aktivem VPN verbunden"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Durchgehend aktives VPN – Verbindungsfehler"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Zum Konfigurieren berühren"</string>
<string name="upload_file" msgid="2897957172366730416">"Datei auswählen"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Keine ausgewählt"</string>
<string name="reset" msgid="2448168080964209908">"Zurücksetzen"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 3307abf..478b064 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Σύνδεση πάντα ενεργοποιημένου VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Έχει συνδεθεί πάντα ενεργοποιημένο VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Σφάλμα πάντα ενεργοποιημένου VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Αγγίξτε για διαμόρφωση"</string>
<string name="upload_file" msgid="2897957172366730416">"Επιλογή αρχείου"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Δεν έχει επιλεγεί αρχείο"</string>
<string name="reset" msgid="2448168080964209908">"Επαναφορά"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index a695432..8794a5d 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Always-on VPN connecting…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Always-on VPN connected"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Always-on VPN error"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Touch to configure"</string>
<string name="upload_file" msgid="2897957172366730416">"Choose file"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"No file chosen"</string>
<string name="reset" msgid="2448168080964209908">"Reset"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 788c265c..febefe3 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Conectando VPN siempre activada…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN siempre activada conectada"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Error de VPN siempre activada"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Toca para configurar"</string>
<string name="upload_file" msgid="2897957172366730416">"Seleccionar archivo"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Archivo no seleccionado"</string>
<string name="reset" msgid="2448168080964209908">"Restablecer"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 3312381e..2815c43 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Ühendamine alati sees VPN-iga …"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Ühendatud alati sees VPN-iga"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Alati sees VPN-i viga"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Puudutage seadistamiseks"</string>
<string name="upload_file" msgid="2897957172366730416">"Valige fail"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Ühtegi faili pole valitud"</string>
<string name="reset" msgid="2448168080964209908">"Lähtesta"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index b6e3abe..660029a 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"در حال اتصال VPN همیشه فعال…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN همیشه فعال متصل شد"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"خطای VPN همیشه فعال"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"برای پیکربندی لمس کنید"</string>
<string name="upload_file" msgid="2897957172366730416">"انتخاب فایل"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"هیچ فایلی انتخاب نشد"</string>
<string name="reset" msgid="2448168080964209908">"بازنشانی"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 92712bc..78e1412 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Yhdistetään aina käytössä olevaan VPN-verkkoon..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Yhdistetty aina käytössä olevaan VPN-verkkoon"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Aina käytössä oleva VPN: virhe"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Kosketa ja tee määritykset"</string>
<string name="upload_file" msgid="2897957172366730416">"Valitse tiedosto"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Ei valittua tiedostoa"</string>
<string name="reset" msgid="2448168080964209908">"Palauta"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 4c8ccc5..4c9c0a5 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"VPN permanent en cours de connexion…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN permanent connecté"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Erreur du VPN permanent"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Appuyer pour configurer"</string>
<string name="upload_file" msgid="2897957172366730416">"Sélectionner un fichier"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Aucun fichier sélectionné"</string>
<string name="reset" msgid="2448168080964209908">"Réinitialiser"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 057f620..3aaace5 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"हमेशा-चालू VPN कनेक्ट हो रहा है…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"हमेशा-चालू VPN कनेक्ट है"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"हमेशा-चालू VPN त्रुटि"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"कॉन्फ़िगर करने के लिए स्पर्श करें"</string>
<string name="upload_file" msgid="2897957172366730416">"फ़ाइल चुनें"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"कोई फ़ाइल चुनी नहीं गई"</string>
<string name="reset" msgid="2448168080964209908">"रीसेट करें"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index f0fd1ef..33e3b2d2 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Menyambungkan VPN selalu aktif..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN selalu aktif tersambung"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Kesalahan VPN selalu aktif"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Sentuh untuk mengonfigurasi"</string>
<string name="upload_file" msgid="2897957172366730416">"Pilih file"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Tidak ada file yang dipilih"</string>
<string name="reset" msgid="2448168080964209908">"Setel ulang"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 9a2275b..6a0d9e2 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"ה-VPN שמופעל תמיד, מתחבר..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"ה-VPN שפועל תמיד, מחובר"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"שגיאת VPN שמופעל תמיד"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"גע כדי להגדיר"</string>
<string name="upload_file" msgid="2897957172366730416">"בחר קובץ"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"לא נבחר קובץ"</string>
<string name="reset" msgid="2448168080964209908">"איפוס"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 67192dd..46e6339 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"연결 유지 VPN에 연결하는 중…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"연결 유지 VPN에 연결됨"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"연결 유지 VPN 오류"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"설정하려면 터치하세요."</string>
<string name="upload_file" msgid="2897957172366730416">"파일 선택"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"파일을 선택하지 않았습니다."</string>
<string name="reset" msgid="2448168080964209908">"초기화"</string>
diff --git a/core/res/res/values-land/arrays.xml b/core/res/res/values-land/arrays.xml
index 240b9e4..5602a1c 100644
--- a/core/res/res/values-land/arrays.xml
+++ b/core/res/res/values-land/arrays.xml
@@ -19,54 +19,4 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Resources for GlowPadView in LockScreen -->
- <array name="lockscreen_targets_when_silent">
- <item>@null</item>"
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_soundon</item>
- <item>@drawable/ic_lockscreen_unlock</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_silent">
- <item>@null</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_soundon</item>
- <item>@string/description_target_unlock</item>
- </array>
-
- <array name="lockscreen_direction_descriptions">
- <item>@null</item>
- <item>@string/description_direction_up</item>
- <item>@string/description_direction_left</item>
- <item>@string/description_direction_down</item>
- </array>
-
- <array name="lockscreen_targets_when_soundon">
- <item>@null</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_silent</item>
- <item>@drawable/ic_lockscreen_unlock</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_soundon">
- <item>@null</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_silent</item>
- <item>@string/description_target_unlock</item>
- </array>
-
- <array name="lockscreen_targets_with_camera">
- <item>@null</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_camera</item>
- <item>@drawable/ic_lockscreen_unlock</item>
- </array>
-
- <array name="lockscreen_target_descriptions_with_camera">
- <item>@null</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_camera</item>
- <item>@string/description_target_unlock</item>
- </array>
-
</resources>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 22656ff..fb476b5 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Prisijungiama prie visada įjungto VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Prisijungta prie visada įjungto VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Visada įjungto VPN klaida"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Jei norite konfigūruoti, palieskite."</string>
<string name="upload_file" msgid="2897957172366730416">"Pasirinkti failą"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nepasirinktas joks failas"</string>
<string name="reset" msgid="2448168080964209908">"Atstatyti"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index f9b3381..667e29c 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Notiek savienojuma izveide ar vienmēr ieslēgtu VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Izveidots savienojums ar vienmēr ieslēgtu VPN."</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Kļūda saistībā ar vienmēr ieslēgtu VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Pieskarieties, lai konfigurētu."</string>
<string name="upload_file" msgid="2897957172366730416">"Izvēlēties failu"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Neviens fails nav izvēlēts"</string>
<string name="reset" msgid="2448168080964209908">"Atiestatīt"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index d9b39aa..a04aac1 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"VPN sentiasa hidup sedang disambungkan..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN sentiasa hidup telah disambungkan"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Ralat VPN sentiasa hidup"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Sentuh untuk mengkonfigurasikan"</string>
<string name="upload_file" msgid="2897957172366730416">"Pilih fail"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Tiada fail dipilih"</string>
<string name="reset" msgid="2448168080964209908">"Tetapkan semula"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 4e7eba8..62da0ae 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Alltid-på VPN kobler til ..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Alltid-på VPN er tilkoblet"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Alltid-på VPN-feil"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Trykk for å konfigurere"</string>
<string name="upload_file" msgid="2897957172366730416">"Velg fil"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Ingen fil er valgt"</string>
<string name="reset" msgid="2448168080964209908">"Tilbakestill"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index e7bee92..98d7477 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Łączę z zawsze włączoną siecią VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Połączono z zawsze włączoną siecią VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Błąd zawsze włączonej sieci VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Kliknij, by skonfigurować"</string>
<string name="upload_file" msgid="2897957172366730416">"Wybierz plik"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nie wybrano pliku"</string>
<string name="reset" msgid="2448168080964209908">"Resetuj"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 552d24e..5a701a0 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"A ligar VPN sempre ativa..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN sempre ativa ligada"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Erro da VPN sempre ativa"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Tocar para configurar"</string>
<string name="upload_file" msgid="2897957172366730416">"Escolher ficheiro"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Não foi selecionado nenhum ficheiro"</string>
<string name="reset" msgid="2448168080964209908">"Repor"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index db894a0..9eb11b2 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"VPN sempre ativa conectando..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"VPN sempre ativa conectada"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Erro na VPN sempre ativa"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Toque para configurar"</string>
<string name="upload_file" msgid="2897957172366730416">"Escolher arquivo"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nenhum arquivo escolhido"</string>
<string name="reset" msgid="2448168080964209908">"Redefinir"</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index fe7b437..eb7185f 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Se efectuează conectarea la reţeaua VPN activată permanent…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Conectat(ă) la reţeaua VPN activată permanent"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Eroare de reţea VPN activată permanent"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Atingeți pentru a configura"</string>
<string name="upload_file" msgid="2897957172366730416">"Alegeţi un fişier"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nu au fost găsite fişiere"</string>
<string name="reset" msgid="2448168080964209908">"Resetaţi"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 249e46b..b8b1c29 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Подключение…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Подключено"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Ошибка"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Нажмите, чтобы изменить настройки"</string>
<string name="upload_file" msgid="2897957172366730416">"Выбрать файл"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Не выбран файл"</string>
<string name="reset" msgid="2448168080964209908">"Сбросить"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index e11f93a..c1d2c46 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Prebieha pripájanie k vždy zapnutej sieti VPN..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Pripojenie k vždy zapnutej sieti VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Chyba vždy zapnutej siete VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Dotykom spustíte konfiguráciu"</string>
<string name="upload_file" msgid="2897957172366730416">"Zvoliť súbor"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nie je vybratý žiadny súbor"</string>
<string name="reset" msgid="2448168080964209908">"Obnoviť"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 5a3f897..7eb8583 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Povezovanje v stalno vklopljeno navidezno zasebno omrežje ..."</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Vzpostavljena povezava v stalno vklopljeno navidezno zasebno omrežje"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Napaka stalno vklopljenega navideznega zasebnega omrežja"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Dotaknite se, če želite konfigurirati"</string>
<string name="upload_file" msgid="2897957172366730416">"Izberi datoteko"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Nobena datoteka ni izbrana"</string>
<string name="reset" msgid="2448168080964209908">"Ponastavi"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index a678e1f..f30d11f 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Kila mara VPN iliyowashwa inaunganishwa…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Kila mara VPN iliyowashwa imeunganishwa"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Kila mara kuna hitilafu ya VPN iliyowashwa"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Gusa ili kusanidi"</string>
<string name="upload_file" msgid="2897957172366730416">"Chagua faili"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Hakuna faili iliyochaguliwa"</string>
<string name="reset" msgid="2448168080964209908">"Weka upya"</string>
diff --git a/core/res/res/values-sw600dp-land/arrays.xml b/core/res/res/values-sw600dp-land/arrays.xml
index 5550216..5602a1c 100644
--- a/core/res/res/values-sw600dp-land/arrays.xml
+++ b/core/res/res/values-sw600dp-land/arrays.xml
@@ -19,54 +19,4 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Resources for GlowPadView in LockScreen -->
- <array name="lockscreen_targets_when_silent">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@null</item>
- <item>@drawable/ic_lockscreen_soundon</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_silent">
- <item>@string/description_target_unlock</item>
- <item>@null</item>
- <item>@string/description_target_soundon</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_direction_descriptions">
- <item>@string/description_direction_right</item>
- <item>@null</item>
- <item>@string/description_direction_left</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_targets_when_soundon">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@null</item>
- <item>@drawable/ic_lockscreen_silent</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_soundon">
- <item>@string/description_target_unlock</item>
- <item>@null</item>
- <item>@string/description_target_silent</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_targets_with_camera">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_camera</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_with_camera">
- <item>@string/description_target_unlock</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_camera</item>
- <item>@null</item>
- </array>
-
</resources>
diff --git a/core/res/res/values-sw600dp/alias.xml b/core/res/res/values-sw600dp/alias.xml
deleted file mode 100644
index bf3eecb..0000000
--- a/core/res/res/values-sw600dp/alias.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/assets/res/any/colors.xml
-**
-** Copyright 2012, 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.
-*/
--->
-<resources>
- <!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area</item>
-</resources>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index cfc3c7b..aa3244c 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Her zaman açık VPN\'ye bağlanılıyor…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Her zaman açık VPN\'ye bağlanıldı"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Her zaman açık VPN hatası"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Yapılandırmak için dokunun"</string>
<string name="upload_file" msgid="2897957172366730416">"Dosya seç"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Seçili dosya yok"</string>
<string name="reset" msgid="2448168080964209908">"Sıfırla"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 095c364..2f6d65c 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"Під’єднання до постійної мережі VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"Під’єднано до постійної мережі VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Помилка постійної мережі VPN"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Натисніть, щоб налаштувати"</string>
<string name="upload_file" msgid="2897957172366730416">"Виберіть файл"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Не вибрано файл"</string>
<string name="reset" msgid="2448168080964209908">"Віднов."</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 2ceb440..c13cdf7 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"正在連線至永久連線的 VPN…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"已連線至永久連線的 VPN"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"永久連線的 VPN 發生錯誤"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"輕觸即可設定"</string>
<string name="upload_file" msgid="2897957172366730416">"選擇檔案"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"未選擇任何檔案"</string>
<string name="reset" msgid="2448168080964209908">"重設"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 01cadb7..6dc9e68 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -1269,8 +1269,7 @@
<string name="vpn_lockdown_connecting" msgid="6443438964440960745">"I-VPN ehlala ikhanya iyaxhuma…"</string>
<string name="vpn_lockdown_connected" msgid="8202679674819213931">"I-VPN ehlala ikhanya ixhunyiwe"</string>
<string name="vpn_lockdown_error" msgid="6009249814034708175">"Iphutha le-VPN ehlala ikhanya"</string>
- <!-- no translation found for vpn_lockdown_config (6415899150671537970) -->
- <skip />
+ <string name="vpn_lockdown_config" msgid="6415899150671537970">"Thinta ukuze ulungiselele"</string>
<string name="upload_file" msgid="2897957172366730416">"Khetha ifayela"</string>
<string name="no_file_chosen" msgid="6363648562170759465">"Ayikho ifayela ekhethiwe"</string>
<string name="reset" msgid="2448168080964209908">"Setha kabusha"</string>
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index f7ff77b..7cdc7bb 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -342,75 +342,4 @@
<item>中文 (繁體)</item>
</string-array>
- <!-- Resources for GlowPadView in LockScreen -->
- <array name="lockscreen_targets_when_silent">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_soundon</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_silent">
- <item>@string/description_target_unlock</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_soundon</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_direction_descriptions">
- <item>@string/description_direction_right</item>
- <item>@string/description_direction_up</item>
- <item>@string/description_direction_left</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_targets_when_soundon">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_silent</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_when_soundon">
- <item>@string/description_target_unlock</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_silent</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_targets_with_camera">
- <item>@drawable/ic_lockscreen_unlock</item>
- <item>@drawable/ic_action_assist_generic</item>
- <item>@drawable/ic_lockscreen_camera</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_target_descriptions_with_camera">
- <item>@string/description_target_unlock</item>
- <item>@string/description_target_search</item>
- <item>@string/description_target_camera</item>
- <item>@null</item>
- </array>
-
- <array name="lockscreen_targets_unlock_only">
- <item>@*android:drawable/ic_lockscreen_unlock</item>
- </array>
-
- <array name="lockscreen_target_descriptions_unlock_only">
- <item>@*android:string/description_target_unlock</item>
- </array>
-
- <!-- list of 3- or 4-letter mnemonics for a 10-key numeric keypad -->
- <string-array translatable="false" name="lockscreen_num_pad_klondike">
- <item></item><!-- 0 -->
- <item></item><!-- 1 -->
- <item>ABC</item><!-- 2 -->
- <item>DEF</item><!-- 3 -->
- <item>GHI</item><!-- 4 -->
- <item>JKL</item><!-- 5 -->
- <item>MNO</item><!-- 6 -->
- <item>PQRS</item><!-- 7 -->
- <item>TUV</item><!-- 8 -->
- <item>WXYZ</item><!-- 9 -->
- </string-array>
</resources>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index d899e9d..762c971 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -1699,4 +1699,12 @@
<!-- Concrete value to put for this named extra data. -->
<attr name="value" />
</declare-styleable>
+
+ <attr name="keyset" />
+ <declare-styleable name="PublicKey">
+ <attr name="value" />
+ </declare-styleable>
+ <declare-styleable name="KeySet">
+ <attr name="name" />
+ </declare-styleable>
</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 42e5cf1..f5918fb 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2041,6 +2041,7 @@
=============================================================== -->
<eat-comment />
+ <public type="attr" name="keyset" id="0x010103cf" />
<public type="attr" name="windowOverscan" />
<public type="style" name="Theme.NoTitleBar.Overscan" />
<public type="style" name="Theme.Light.NoTitleBar.Overscan" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 5fc26fc..a96a6e9 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3429,6 +3429,11 @@
<!-- Description of an application permission that lets an application route media output. -->
<string name="permdesc_route_media_output">Allows an application to route media output to other external devices.</string>
+ <!-- Title of an application permission that lets an application access keyguard secure storage. -->
+ <string name="permlab_access_keyguard_secure_storage">Access keyguard secure storage</string>
+ <!-- Description of an application permission that lets an application access keyguard secure storage. -->
+ <string name="permdesc_access_keyguard_secure_storage">Allows an application to access keguard secure storage.</string>
+
<!-- Shown in the tutorial for tap twice for zoom control. -->
<string name="tutorial_double_tap_to_zoom_message_short">Touch twice for zoom control</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index c87cb27..a26f67a 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -38,16 +38,12 @@
<java-symbol type="id" name="action_menu_presenter" />
<java-symbol type="id" name="action_mode_close_button" />
<java-symbol type="id" name="activity_chooser_view_content" />
- <java-symbol type="id" name="albumart" />
<java-symbol type="id" name="alertTitle" />
<java-symbol type="id" name="allow_button" />
<java-symbol type="id" name="alwaysUse" />
<java-symbol type="id" name="amPm" />
<java-symbol type="id" name="authtoken_type" />
<java-symbol type="id" name="back_button" />
- <java-symbol type="id" name="btn_next" />
- <java-symbol type="id" name="btn_play" />
- <java-symbol type="id" name="btn_prev" />
<java-symbol type="id" name="button_bar" />
<java-symbol type="id" name="buttonPanel" />
<java-symbol type="id" name="by_common" />
@@ -558,26 +554,6 @@
<java-symbol type="string" name="keyboardview_keycode_enter" />
<java-symbol type="string" name="keyboardview_keycode_mode_change" />
<java-symbol type="string" name="keyboardview_keycode_shift" />
- <java-symbol type="string" name="keyguard_accessibility_add_widget" />
- <java-symbol type="string" name="keyguard_accessibility_camera" />
- <java-symbol type="string" name="keyguard_accessibility_expand_lock_area" />
- <java-symbol type="string" name="keyguard_accessibility_face_unlock" />
- <java-symbol type="string" name="keygaurd_accessibility_media_controls" />
- <java-symbol type="string" name="keyguard_accessibility_pattern_area" />
- <java-symbol type="string" name="keyguard_accessibility_pattern_unlock" />
- <java-symbol type="string" name="keyguard_accessibility_password_unlock" />
- <java-symbol type="string" name="keyguard_accessibility_pin_unlock" />
- <java-symbol type="string" name="keyguard_accessibility_slide_area" />
- <java-symbol type="string" name="keyguard_accessibility_slide_unlock" />
- <java-symbol type="string" name="keyguard_accessibility_status" />
- <java-symbol type="string" name="keyguard_accessibility_user_selector" />
- <java-symbol type="string" name="keyguard_accessibility_widget" />
- <java-symbol type="string" name="keyguard_accessibility_widget_deleted" />
- <java-symbol type="string" name="keyguard_accessibility_widget_empty_slot" />
- <java-symbol type="string" name="keyguard_accessibility_widget_reorder_start" />
- <java-symbol type="string" name="keyguard_accessibility_widget_reorder_end" />
- <java-symbol type="string" name="keyguard_accessibility_unlock_area_collapsed" />
- <java-symbol type="string" name="keyguard_accessibility_unlock_area_expanded" />
<java-symbol type="string" name="kilobyteShort" />
<java-symbol type="string" name="last_month" />
<java-symbol type="string" name="launchBrowserDefault" />
@@ -587,9 +563,6 @@
<java-symbol type="string" name="lockscreen_access_pattern_start" />
<java-symbol type="string" name="lockscreen_emergency_call" />
<java-symbol type="string" name="lockscreen_return_to_call" />
- <java-symbol type="string" name="lockscreen_transport_pause_description" />
- <java-symbol type="string" name="lockscreen_transport_play_description" />
- <java-symbol type="string" name="lockscreen_transport_stop_description" />
<java-symbol type="string" name="low_memory" />
<java-symbol type="string" name="media_bad_removal" />
<java-symbol type="string" name="media_checking" />
@@ -1000,16 +973,11 @@
<java-symbol type="drawable" name="unlock_halo" />
<java-symbol type="drawable" name="unlock_ring" />
<java-symbol type="drawable" name="unlock_wave" />
- <java-symbol type="drawable" name="ic_lockscreen_camera" />
- <java-symbol type="drawable" name="ic_lockscreen_silent" />
- <java-symbol type="drawable" name="ic_lockscreen_unlock" />
<java-symbol type="drawable" name="ic_action_assist_generic" />
- <java-symbol type="drawable" name="ic_lockscreen_alarm" />
<java-symbol type="drawable" name="notification_bg" />
<java-symbol type="drawable" name="notification_bg_low" />
<java-symbol type="drawable" name="notification_template_icon_bg" />
<java-symbol type="drawable" name="notification_template_icon_low_bg" />
- <java-symbol type="drawable" name="ic_lockscreen_unlock_phantom" />
<java-symbol type="drawable" name="ic_media_route_on_holo_dark" />
<java-symbol type="drawable" name="ic_media_route_disabled_holo_dark" />
@@ -1109,10 +1077,7 @@
<java-symbol type="layout" name="notification_template_part_time" />
<java-symbol type="layout" name="notification_template_part_chronometer" />
<java-symbol type="layout" name="notification_template_inbox" />
- <java-symbol type="layout" name="keyguard_multi_user_avatar" />
- <java-symbol type="layout" name="keyguard_multi_user_selector_widget" />
<java-symbol type="layout" name="sms_short_code_confirmation_dialog" />
- <java-symbol type="layout" name="keyguard_add_widget" />
<java-symbol type="layout" name="action_bar_up_container" />
<java-symbol type="anim" name="slide_in_child_bottom" />
@@ -1129,7 +1094,6 @@
<java-symbol type="xml" name="password_kbd_qwerty_shifted" />
<java-symbol type="xml" name="password_kbd_symbols" />
<java-symbol type="xml" name="password_kbd_symbols_shift" />
- <java-symbol type="xml" name="kg_password_kbd_numeric" />
<java-symbol type="xml" name="power_profile" />
<java-symbol type="xml" name="time_zones_by_country" />
<java-symbol type="xml" name="sms_short_codes" />
@@ -1181,8 +1145,6 @@
<!-- From android.policy -->
<java-symbol type="anim" name="app_starting_exit" />
- <java-symbol type="anim" name="lock_screen_behind_enter" />
- <java-symbol type="anim" name="lock_screen_wallpaper_behind_enter" />
<java-symbol type="anim" name="dock_top_enter" />
<java-symbol type="anim" name="dock_top_exit" />
<java-symbol type="anim" name="dock_bottom_enter" />
@@ -1191,22 +1153,12 @@
<java-symbol type="anim" name="dock_left_exit" />
<java-symbol type="anim" name="dock_right_enter" />
<java-symbol type="anim" name="dock_right_exit" />
- <java-symbol type="anim" name="keyguard_security_animate_in" />
- <java-symbol type="anim" name="keyguard_security_animate_out" />
- <java-symbol type="anim" name="keyguard_security_fade_in" />
- <java-symbol type="anim" name="keyguard_security_fade_out" />
- <java-symbol type="anim" name="keyguard_action_assist_exit" />
- <java-symbol type="anim" name="keyguard_action_assist_enter" />
<java-symbol type="array" name="config_keyboardTapVibePattern" />
<java-symbol type="array" name="config_longPressVibePattern" />
<java-symbol type="array" name="config_safeModeDisabledVibePattern" />
<java-symbol type="array" name="config_safeModeEnabledVibePattern" />
<java-symbol type="array" name="config_virtualKeyVibePattern" />
- <java-symbol type="array" name="lockscreen_targets_when_silent" />
- <java-symbol type="array" name="lockscreen_targets_when_soundon" />
- <java-symbol type="array" name="lockscreen_targets_with_camera" />
- <java-symbol type="array" name="lockscreen_num_pad_klondike" />
<java-symbol type="attr" name="actionModePopupWindowStyle" />
<java-symbol type="attr" name="dialogCustomTitleDecorLayout" />
<java-symbol type="attr" name="dialogTitleDecorLayout" />
@@ -1221,33 +1173,11 @@
<java-symbol type="bool" name="config_lidControlsSleep" />
<java-symbol type="bool" name="config_reverseDefaultRotation" />
<java-symbol type="bool" name="config_showNavigationBar" />
- <java-symbol type="bool" name="kg_enable_camera_default_widget" />
- <java-symbol type="bool" name="kg_share_status_area" />
- <java-symbol type="bool" name="kg_sim_puk_account_full_screen" />
- <java-symbol type="bool" name="kg_top_align_page_shrink_on_bouncer_visible" />
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
- <java-symbol type="bool" name="kg_center_small_widgets_vertically" />
- <java-symbol type="bool" name="kg_show_ime_at_screen_on" />
- <java-symbol type="color" name="kg_multi_user_text_active" />
- <java-symbol type="color" name="kg_multi_user_text_inactive" />
- <java-symbol type="color" name="kg_widget_pager_gradient" />
- <java-symbol type="color" name="keyguard_avatar_frame_color" />
- <java-symbol type="color" name="keyguard_avatar_frame_pressed_color" />
- <java-symbol type="color" name="keyguard_avatar_frame_shadow_color" />
- <java-symbol type="color" name="keyguard_avatar_nick_color" />
<java-symbol type="dimen" name="navigation_bar_height" />
<java-symbol type="dimen" name="navigation_bar_height_landscape" />
<java-symbol type="dimen" name="navigation_bar_width" />
<java-symbol type="dimen" name="status_bar_height" />
- <java-symbol type="dimen" name="kg_widget_pager_horizontal_padding" />
- <java-symbol type="dimen" name="kg_widget_pager_top_padding" />
- <java-symbol type="dimen" name="kg_widget_pager_bottom_padding" />
- <java-symbol type="dimen" name="keyguard_avatar_size" />
- <java-symbol type="dimen" name="keyguard_avatar_frame_stroke_width" />
- <java-symbol type="dimen" name="keyguard_avatar_frame_shadow_radius" />
- <java-symbol type="dimen" name="kg_edge_swipe_region_size" />
- <java-symbol type="dimen" name="kg_squashed_layout_threshold" />
- <java-symbol type="dimen" name="kg_small_widget_height" />
<java-symbol type="drawable" name="ic_jog_dial_sound_off" />
<java-symbol type="drawable" name="ic_jog_dial_sound_on" />
<java-symbol type="drawable" name="ic_jog_dial_unlock" />
@@ -1266,9 +1196,7 @@
<java-symbol type="drawable" name="magnified_region_frame" />
<java-symbol type="drawable" name="menu_background" />
<java-symbol type="drawable" name="stat_sys_secure" />
- <java-symbol type="drawable" name="kg_widget_bg_padded" />
<java-symbol type="id" name="action_mode_bar_stub" />
- <java-symbol type="id" name="alarm_status" />
<java-symbol type="id" name="button0" />
<java-symbol type="id" name="button4" />
<java-symbol type="id" name="button5" />
@@ -1276,15 +1204,12 @@
<java-symbol type="id" name="button7" />
<java-symbol type="id" name="date" />
<java-symbol type="id" name="eight" />
- <java-symbol type="id" name="face_unlock_area_view" />
- <java-symbol type="id" name="face_unlock_cancel_button" />
<java-symbol type="id" name="five" />
<java-symbol type="id" name="four" />
<java-symbol type="id" name="icon_menu_presenter" />
<java-symbol type="id" name="keyboard" />
<java-symbol type="id" name="list_menu_presenter" />
<java-symbol type="id" name="lock_screen" />
- <java-symbol type="id" name="login" />
<java-symbol type="id" name="nine" />
<java-symbol type="id" name="no_applications_message" />
<java-symbol type="id" name="ok" />
@@ -1292,56 +1217,14 @@
<java-symbol type="id" name="option1" />
<java-symbol type="id" name="option2" />
<java-symbol type="id" name="option3" />
- <java-symbol type="id" name="password" />
- <java-symbol type="id" name="passwordEntry" />
- <java-symbol type="id" name="pinEntry" />
<java-symbol type="id" name="right_icon" />
<java-symbol type="id" name="seven" />
<java-symbol type="id" name="six" />
<java-symbol type="id" name="status" />
- <java-symbol type="id" name="switch_ime_button" />
<java-symbol type="id" name="three" />
<java-symbol type="id" name="title_container" />
<java-symbol type="id" name="two" />
<java-symbol type="id" name="zero" />
- <java-symbol type="id" name="keyguard_message_area" />
- <java-symbol type="id" name="keyguard_click_area" />
- <java-symbol type="id" name="keyguard_selector_view" />
- <java-symbol type="id" name="keyguard_pattern_view" />
- <java-symbol type="id" name="keyguard_password_view" />
- <java-symbol type="id" name="keyguard_pin_view" />
- <java-symbol type="id" name="keyguard_face_unlock_view" />
- <java-symbol type="id" name="keyguard_sim_pin_view" />
- <java-symbol type="id" name="keyguard_sim_puk_view" />
- <java-symbol type="id" name="keyguard_account_view" />
- <java-symbol type="id" name="keyguard_selector_fade_container" />
- <java-symbol type="id" name="keyguard_widget_pager_delete_target" />
- <java-symbol type="id" name="keyguard_bouncer_frame" />
- <java-symbol type="id" name="app_widget_container" />
- <java-symbol type="id" name="view_flipper" />
- <java-symbol type="id" name="emergency_call_button" />
- <java-symbol type="id" name="keyguard_host_view" />
- <java-symbol type="id" name="delete_button" />
- <java-symbol type="id" name="lockPatternView" />
- <java-symbol type="id" name="forgot_password_button" />
- <java-symbol type="id" name="glow_pad_view" />
- <java-symbol type="id" name="delete_button" />
- <java-symbol type="id" name="keyguard_user_avatar" />
- <java-symbol type="id" name="keyguard_user_name" />
- <java-symbol type="id" name="keyguard_transport_control" />
- <java-symbol type="id" name="keyguard_status_view" />
- <java-symbol type="id" name="keyguard_status_view_face_palm" />
- <java-symbol type="id" name="keyguard_users_grid" />
- <java-symbol type="id" name="clock_text" />
- <java-symbol type="id" name="clock_view" />
- <java-symbol type="id" name="keyguard_multi_user_selector" />
- <java-symbol type="id" name="sliding_layout" />
- <java-symbol type="id" name="keyguard_add_widget" />
- <java-symbol type="id" name="keyguard_add_widget_view" />
- <java-symbol type="id" name="multi_pane_challenge" />
- <java-symbol type="id" name="keyguard_user_selector" />
- <java-symbol type="id" name="key_enter" />
- <java-symbol type="id" name="keyguard_selector_view_frame" />
<java-symbol type="integer" name="config_carDockRotation" />
<java-symbol type="integer" name="config_defaultUiModeType" />
<java-symbol type="integer" name="config_deskDockRotation" />
@@ -1349,18 +1232,8 @@
<java-symbol type="integer" name="config_lidNavigationAccessibility" />
<java-symbol type="integer" name="config_lidOpenRotation" />
<java-symbol type="integer" name="config_longPressOnHomeBehavior" />
- <java-symbol type="integer" name="kg_security_flip_duration" />
- <java-symbol type="integer" name="kg_carousel_angle" />
<java-symbol type="layout" name="global_actions_item" />
<java-symbol type="layout" name="global_actions_silent_mode" />
- <java-symbol type="layout" name="keyguard_selector_view" />
- <java-symbol type="layout" name="keyguard_pattern_view" />
- <java-symbol type="layout" name="keyguard_password_view" />
- <java-symbol type="layout" name="keyguard_pin_view" />
- <java-symbol type="layout" name="keyguard_face_unlock_view" />
- <java-symbol type="layout" name="keyguard_sim_pin_view" />
- <java-symbol type="layout" name="keyguard_sim_puk_view" />
- <java-symbol type="layout" name="keyguard_account_view" />
<java-symbol type="layout" name="recent_apps_dialog" />
<java-symbol type="layout" name="screen_action_bar" />
<java-symbol type="layout" name="screen_action_bar_overlay" />
@@ -1370,9 +1243,6 @@
<java-symbol type="layout" name="screen_simple_overlay_action_mode" />
<java-symbol type="layout" name="screen_title" />
<java-symbol type="layout" name="screen_title_icons" />
- <java-symbol type="layout" name="keyguard_host_view" />
- <java-symbol type="layout" name="keyguard_transport_control_view" />
- <java-symbol type="layout" name="keyguard_status_view" />
<java-symbol type="string" name="abbrev_wday_month_day_no_year" />
<java-symbol type="string" name="system_ui_date_pattern" />
<java-symbol type="string" name="android_upgrading_title" />
@@ -1388,41 +1258,7 @@
<java-symbol type="string" name="global_action_silent_mode_on_status" />
<java-symbol type="string" name="global_action_toggle_silent_mode" />
<java-symbol type="string" name="invalidPuk" />
- <java-symbol type="string" name="keyguard_password_enter_pin_code" />
- <java-symbol type="string" name="keyguard_password_enter_puk_code" />
- <java-symbol type="string" name="keyguard_password_wrong_pin_code" />
<java-symbol type="string" name="lockscreen_carrier_default" />
- <java-symbol type="string" name="lockscreen_charged" />
- <java-symbol type="string" name="lockscreen_failed_attempts_almost_at_wipe" />
- <java-symbol type="string" name="lockscreen_failed_attempts_almost_glogin" />
- <java-symbol type="string" name="lockscreen_failed_attempts_now_wiping" />
- <java-symbol type="string" name="lockscreen_forgot_pattern_button_text" />
- <java-symbol type="string" name="lockscreen_glogin_checking_password" />
- <java-symbol type="string" name="lockscreen_glogin_forgot_pattern" />
- <java-symbol type="string" name="lockscreen_glogin_invalid_input" />
- <java-symbol type="string" name="lockscreen_glogin_too_many_attempts" />
- <java-symbol type="string" name="lockscreen_instructions_when_pattern_disabled" />
- <java-symbol type="string" name="lockscreen_low_battery" />
- <java-symbol type="string" name="lockscreen_missing_sim_instructions" />
- <java-symbol type="string" name="lockscreen_missing_sim_instructions_long" />
- <java-symbol type="string" name="lockscreen_missing_sim_message_short" />
- <java-symbol type="string" name="lockscreen_network_locked_message" />
- <java-symbol type="string" name="lockscreen_password_wrong" />
- <java-symbol type="string" name="lockscreen_pattern_instructions" />
- <java-symbol type="string" name="lockscreen_pattern_wrong" />
- <java-symbol type="string" name="lockscreen_permanent_disabled_sim_message_short" />
- <java-symbol type="string" name="lockscreen_permanent_disabled_sim_instructions" />
- <java-symbol type="string" name="lockscreen_plugged_in" />
- <java-symbol type="string" name="lockscreen_sim_locked_message" />
- <java-symbol type="string" name="lockscreen_sim_puk_locked_message" />
- <java-symbol type="string" name="lockscreen_sim_unlock_progress_dialog_message" />
- <java-symbol type="string" name="lockscreen_sound_off_label" />
- <java-symbol type="string" name="lockscreen_sound_on_label" />
- <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" />
- <java-symbol type="string" name="lockscreen_too_many_failed_attempts_dialog_message" />
- <java-symbol type="string" name="lockscreen_too_many_failed_password_attempts_dialog_message" />
- <java-symbol type="string" name="lockscreen_too_many_failed_pin_attempts_dialog_message" />
- <java-symbol type="string" name="lockscreen_unlock_label" />
<java-symbol type="string" name="status_bar_device_locked" />
<java-symbol type="style" name="Animation.LockScreen" />
<java-symbol type="style" name="Theme.Dialog.RecentApplications" />
@@ -1430,40 +1266,6 @@
<java-symbol type="style" name="Widget.Button.NumPadKey" />
<java-symbol type="style" name="TextAppearance.NumPadKey" />
<java-symbol type="style" name="TextAppearance.NumPadKey.Klondike" />
- <java-symbol type="string" name="kg_emergency_call_label" />
- <java-symbol type="string" name="kg_forgot_pattern_button_text" />
- <java-symbol type="string" name="kg_wrong_pattern" />
- <java-symbol type="string" name="kg_wrong_password" />
- <java-symbol type="string" name="kg_wrong_pin" />
- <java-symbol type="string" name="kg_too_many_failed_attempts_countdown" />
- <java-symbol type="string" name="kg_pattern_instructions" />
- <java-symbol type="string" name="kg_sim_pin_instructions" />
- <java-symbol type="string" name="kg_pin_instructions" />
- <java-symbol type="string" name="kg_password_instructions" />
- <java-symbol type="string" name="kg_puk_enter_puk_hint" />
- <java-symbol type="string" name="kg_puk_enter_pin_hint" />
- <java-symbol type="string" name="kg_sim_unlock_progress_dialog_message" />
- <java-symbol type="string" name="kg_password_wrong_pin_code" />
- <java-symbol type="string" name="kg_invalid_sim_pin_hint" />
- <java-symbol type="string" name="kg_invalid_sim_puk_hint" />
- <java-symbol type="string" name="kg_invalid_puk" />
- <java-symbol type="string" name="kg_login_too_many_attempts" />
- <java-symbol type="string" name="kg_login_instructions" />
- <java-symbol type="string" name="kg_login_username_hint" />
- <java-symbol type="string" name="kg_login_password_hint" />
- <java-symbol type="string" name="kg_login_submit_button" />
- <java-symbol type="string" name="kg_login_invalid_input" />
- <java-symbol type="string" name="kg_login_account_recovery_hint" />
- <java-symbol type="string" name="kg_login_checking_password" />
- <java-symbol type="string" name="kg_too_many_failed_pin_attempts_dialog_message" />
- <java-symbol type="string" name="kg_too_many_failed_pattern_attempts_dialog_message" />
- <java-symbol type="string" name="kg_too_many_failed_password_attempts_dialog_message" />
- <java-symbol type="string" name="kg_failed_attempts_almost_at_wipe" />
- <java-symbol type="string" name="kg_failed_attempts_now_wiping" />
- <java-symbol type="string" name="kg_failed_attempts_almost_at_login" />
- <java-symbol type="string" name="kg_enter_confirm_pin_hint" />
- <java-symbol type="string" name="kg_invalid_confirm_pin_hint" />
- <java-symbol type="string" name="kg_text_message_separator" />
<!-- From services -->
<java-symbol type="anim" name="screen_rotate_0_enter" />
@@ -1680,6 +1482,9 @@
<java-symbol type="anim" name="push_down_out" />
<java-symbol type="anim" name="push_up_in" />
<java-symbol type="anim" name="push_up_out" />
+ <java-symbol type="anim" name="lock_screen_wallpaper_behind_enter" />
+ <java-symbol type="anim" name="lock_screen_behind_enter" />
+
<java-symbol type="bool" name="config_alwaysUseCdmaRssi" />
<java-symbol type="dimen" name="status_bar_icon_size" />
<java-symbol type="dimen" name="system_bar_icon_size" />
diff --git a/docs/html/training/monitoring-device-state/battery-monitoring.jd b/docs/html/training/monitoring-device-state/battery-monitoring.jd
index c963a18..81b6e6b 100644
--- a/docs/html/training/monitoring-device-state/battery-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/battery-monitoring.jd
@@ -65,7 +65,7 @@
status == BatteryManager.BATTERY_STATUS_FULL;
// How are we charging?
-int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
@@ -119,8 +119,8 @@
<p>You can find the current battery charge by extracting the current battery level and scale from
the battery status intent as shown here:</p>
-<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
-int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+<pre>int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
float batteryPct = level / (float)scale;</pre>
diff --git a/packages/BackupRestoreConfirmation/res/values-sw/strings.xml b/packages/BackupRestoreConfirmation/res/values-sw/strings.xml
index 493c168..24d9c39 100644
--- a/packages/BackupRestoreConfirmation/res/values-sw/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-sw/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="backup_confirm_title" msgid="827563724209303345">"Kuhifadhi kikamilifu"</string>
- <string name="restore_confirm_title" msgid="5469365809567486602">"Kurejeza kamili"</string>
+ <string name="restore_confirm_title" msgid="5469365809567486602">"Kurejesha kila kitu"</string>
<string name="backup_confirm_text" msgid="1878021282758896593">"Chelezo kamili la data iliyounganishwa kwenye eneo kazi la kompyuta limeombwa. Unataka kuruhusu hii kutendeka?"\n\n" Ikiwa hukuomba chelezo mwenyewe, usikubali uendeshaji kuendelea."</string>
<string name="allow_backup_button_label" msgid="4217228747769644068">"Cheleza data yangu"</string>
<string name="deny_backup_button_label" msgid="6009119115581097708">"Usicheleze"</string>
@@ -32,7 +32,7 @@
<string name="restore_enc_password_text" msgid="6140898525580710823">"Ikiwa data iliyorejeshwa upya, tafadhali ingiza nenosiri lililo hapo chini:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"Inaanza kuhifadhi..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"Imemaliza kuhifadhi"</string>
- <string name="toast_restore_started" msgid="7881679218971277385">"Inaanza kurejeza..."</string>
- <string name="toast_restore_ended" msgid="1764041639199696132">"Kurejeza kumekamilika"</string>
+ <string name="toast_restore_started" msgid="7881679218971277385">"Inaanza kurejesha..."</string>
+ <string name="toast_restore_ended" msgid="1764041639199696132">"Kurejesha kumekamilika"</string>
<string name="toast_timeout" msgid="5276598587087626877">"Muda wa uendeshaji umeisha"</string>
</resources>
diff --git a/packages/Keyguard/Android.mk b/packages/Keyguard/Android.mk
new file mode 100644
index 0000000..2f8edad
--- /dev/null
+++ b/packages/Keyguard/Android.mk
@@ -0,0 +1,31 @@
+# Copyright (C) 2013 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.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files) $(call all-subdir-Iaidl-files)
+
+LOCAL_JAVA_LIBRARIES := services
+
+LOCAL_PACKAGE_NAME := Keyguard
+
+LOCAL_CERTIFICATE := platform
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/Keyguard/AndroidManifest.xml b/packages/Keyguard/AndroidManifest.xml
new file mode 100644
index 0000000..0741882
--- /dev/null
+++ b/packages/Keyguard/AndroidManifest.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2013, 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.
+*/
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.keyguard"
+ android:sharedUserId="android.uid.systemui"
+ coreApp="true">
+ <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/>
+ <uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
+ <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+ <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
+ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.STATUS_BAR" />
+ <uses-permission android:name="android.permission.DEVICE_POWER" />
+ <uses-permission android:name="android.permission.MANAGE_USERS" />
+ <uses-permission android:name="android.permission.MANAGE_APP_TOKENS" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+ <uses-permission android:name="android.permission.BIND_APPWIDGET" />
+ <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
+ <uses-permission android:name="android.permission.BIND_DEVICE_ADMIN" />
+ <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
+
+ <application android:label="@string/app_name" android:icon="@drawable/app_icon"
+ android:process="com.android.systemui.keyguard"
+ android:persistent="true" >
+
+ <service android:name=".KeyguardService"
+ android:exported="true" />
+
+ <activity android:name=".KeyguardTestActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Holo"
+ android:hardwareAccelerated="true"
+ android:process="com.android.keyguard.keyguard_test"
+ >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ </application>
+</manifest>
diff --git a/packages/Keyguard/NOTICE b/packages/Keyguard/NOTICE
new file mode 100644
index 0000000..33ff961
--- /dev/null
+++ b/packages/Keyguard/NOTICE
@@ -0,0 +1,190 @@
+
+ Copyright (c) 2005-2012, 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.
+
+ 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.
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
diff --git a/packages/Keyguard/proguard.flags b/packages/Keyguard/proguard.flags
new file mode 100644
index 0000000..00ca0fa
--- /dev/null
+++ b/packages/Keyguard/proguard.flags
@@ -0,0 +1,2 @@
+-keep public class com.android.keyguard.KeyguardService
+
diff --git a/core/res/res/anim/keyguard_action_assist_enter.xml b/packages/Keyguard/res/anim/keyguard_action_assist_enter.xml
similarity index 100%
rename from core/res/res/anim/keyguard_action_assist_enter.xml
rename to packages/Keyguard/res/anim/keyguard_action_assist_enter.xml
diff --git a/core/res/res/anim/keyguard_action_assist_exit.xml b/packages/Keyguard/res/anim/keyguard_action_assist_exit.xml
similarity index 100%
rename from core/res/res/anim/keyguard_action_assist_exit.xml
rename to packages/Keyguard/res/anim/keyguard_action_assist_exit.xml
diff --git a/core/res/res/anim/keyguard_security_animate_in.xml b/packages/Keyguard/res/anim/keyguard_security_animate_in.xml
similarity index 100%
rename from core/res/res/anim/keyguard_security_animate_in.xml
rename to packages/Keyguard/res/anim/keyguard_security_animate_in.xml
diff --git a/core/res/res/anim/keyguard_security_animate_out.xml b/packages/Keyguard/res/anim/keyguard_security_animate_out.xml
similarity index 100%
rename from core/res/res/anim/keyguard_security_animate_out.xml
rename to packages/Keyguard/res/anim/keyguard_security_animate_out.xml
diff --git a/core/res/res/anim/keyguard_security_fade_in.xml b/packages/Keyguard/res/anim/keyguard_security_fade_in.xml
similarity index 92%
rename from core/res/res/anim/keyguard_security_fade_in.xml
rename to packages/Keyguard/res/anim/keyguard_security_fade_in.xml
index 6293432..c66c604 100644
--- a/core/res/res/anim/keyguard_security_fade_in.xml
+++ b/packages/Keyguard/res/anim/keyguard_security_fade_in.xml
@@ -17,6 +17,6 @@
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:interpolator/decelerate_quad"
android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@*android:integer/kg_security_fade_duration" />
+ android:duration="@integer/kg_security_fade_duration" />
diff --git a/core/res/res/anim/keyguard_security_fade_out.xml b/packages/Keyguard/res/anim/keyguard_security_fade_out.xml
similarity index 92%
rename from core/res/res/anim/keyguard_security_fade_out.xml
rename to packages/Keyguard/res/anim/keyguard_security_fade_out.xml
index 4ab0229..6465b35 100644
--- a/core/res/res/anim/keyguard_security_fade_out.xml
+++ b/packages/Keyguard/res/anim/keyguard_security_fade_out.xml
@@ -17,5 +17,5 @@
android:interpolator="@android:interpolator/accelerate_quad"
android:fromAlpha="1.0"
android:toAlpha="0.0"
- android:duration="@*android:integer/kg_security_fade_duration"
+ android:duration="@integer/kg_security_fade_duration"
/>
diff --git a/packages/Keyguard/res/anim/lock_screen_enter.xml b/packages/Keyguard/res/anim/lock_screen_enter.xml
new file mode 100644
index 0000000..4344cf9
--- /dev/null
+++ b/packages/Keyguard/res/anim/lock_screen_enter.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2007, 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@android:interpolator/accelerate_cubic">
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@integer/config_activityDefaultDur" />
+</set>
diff --git a/packages/Keyguard/res/anim/lock_screen_exit.xml b/packages/Keyguard/res/anim/lock_screen_exit.xml
new file mode 100644
index 0000000..c75b3cc
--- /dev/null
+++ b/packages/Keyguard/res/anim/lock_screen_exit.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2007, 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.
+*/
+-->
+
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:zAdjustment="top"
+ android:shareInterpolator="false">
+ <scale
+ android:fromXScale="1.0" android:toXScale="1.10"
+ android:fromYScale="1.0" android:toYScale="1.10"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:fillEnabled="true" android:fillAfter="true"
+ android:interpolator="@android:interpolator/accelerate_quint"
+ android:duration="@android:integer/config_shortAnimTime" />
+ <alpha
+ android:fromAlpha="1.0" android:toAlpha="0"
+ android:fillEnabled="true" android:fillAfter="true"
+ android:interpolator="@android:interpolator/accelerate_quad"
+ android:duration="@android:integer/config_shortAnimTime"/>
+</set>
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..c0e2098
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..a852e2c
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_facial_backup.png b/packages/Keyguard/res/drawable-hdpi/ic_facial_backup.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_facial_backup.png
rename to packages/Keyguard/res/drawable-hdpi/ic_facial_backup.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_input_delete.png b/packages/Keyguard/res/drawable-hdpi/ic_input_delete.png
new file mode 100644
index 0000000..5d638bd
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_input_delete.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_alarm.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_alarm.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_alarm.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_alarm.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_camera_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_camera_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_emergencycall_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_emergencycall_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_emergencycall_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_emergencycall_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_emergencycall_pressed.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_emergencycall_pressed.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_emergencycall_pressed.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_emergencycall_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_forgotpassword_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_forgotpassword_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_forgotpassword_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_forgotpassword_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_forgotpassword_pressed.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_forgotpassword_pressed.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_forgotpassword_pressed.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_forgotpassword_pressed.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_glowdot.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_glowdot.png
new file mode 100644
index 0000000..983c45e
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_glowdot.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_google_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_google_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_google_focused.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_focused.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_google_focused.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_focused.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_google_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_google_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_google_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..58a5f16
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_ime.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_ime.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_ime.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_ime.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_lock_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_lock_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_lock_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_lock_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_lock_pressed.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_lock_pressed.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_lock_pressed.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_player_background.9.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_player_background.9.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_search_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_search_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_search_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_search_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_search_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_search_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_search_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_search_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_silent_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_silent_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_silent_focused.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_focused.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_silent_focused.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_focused.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_silent_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_silent_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_silent_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_sim.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_sim.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_sim.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_sim.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_soundon_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_soundon_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_soundon_focused.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_focused.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_soundon_focused.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_focused.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_soundon_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_soundon_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_soundon_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_unlock_activated.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_unlock_activated.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_unlock_activated.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_unlock_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_unlock_normal.png b/packages/Keyguard/res/drawable-hdpi/ic_lockscreen_unlock_normal.png
similarity index 100%
rename from core/res/res/drawable-hdpi/ic_lockscreen_unlock_normal.png
rename to packages/Keyguard/res/drawable-hdpi/ic_lockscreen_unlock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_media_next.png b/packages/Keyguard/res/drawable-hdpi/ic_media_next.png
new file mode 100644
index 0000000..6e27b81
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_media_next.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_media_play.png b/packages/Keyguard/res/drawable-hdpi/ic_media_play.png
new file mode 100644
index 0000000..2746d17
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_media_play.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_media_previous.png b/packages/Keyguard/res/drawable-hdpi/ic_media_previous.png
new file mode 100644
index 0000000..85b3766
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/ic_media_previous.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/intro_bg.png b/packages/Keyguard/res/drawable-hdpi/intro_bg.png
similarity index 100%
rename from core/res/res/drawable-hdpi/intro_bg.png
rename to packages/Keyguard/res/drawable-hdpi/intro_bg.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/kg_add_widget.png b/packages/Keyguard/res/drawable-hdpi/kg_add_widget.png
new file mode 100644
index 0000000..7456705b
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_add_widget_disabled.png b/packages/Keyguard/res/drawable-hdpi/kg_add_widget_disabled.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_add_widget_disabled.png
rename to packages/Keyguard/res/drawable-hdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_add_widget_pressed.png b/packages/Keyguard/res/drawable-hdpi/kg_add_widget_pressed.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_add_widget_pressed.png
rename to packages/Keyguard/res/drawable-hdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png b/packages/Keyguard/res/drawable-hdpi/kg_bouncer_bg_white.9.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_bouncer_bg_white.9.png
rename to packages/Keyguard/res/drawable-hdpi/kg_bouncer_bg_white.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_security_grip.9.png b/packages/Keyguard/res/drawable-hdpi/kg_security_grip.9.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_security_grip.9.png
rename to packages/Keyguard/res/drawable-hdpi/kg_security_grip.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_security_lock.png b/packages/Keyguard/res/drawable-hdpi/kg_security_lock.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_security_lock.png
rename to packages/Keyguard/res/drawable-hdpi/kg_security_lock.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/kg_security_lock_focused.png b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_focused.png
new file mode 100644
index 0000000..9a82799
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_focused.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/kg_security_lock_normal.png b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_normal.png
new file mode 100644
index 0000000..d608707
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-hdpi/kg_security_lock_pressed.png b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_pressed.png
new file mode 100644
index 0000000..7ca995d
--- /dev/null
+++ b/packages/Keyguard/res/drawable-hdpi/kg_security_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_widget_bg_padded.9.png b/packages/Keyguard/res/drawable-hdpi/kg_widget_bg_padded.9.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_widget_bg_padded.9.png
rename to packages/Keyguard/res/drawable-hdpi/kg_widget_bg_padded.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_widget_delete_drop_target.png b/packages/Keyguard/res/drawable-hdpi/kg_widget_delete_drop_target.png
similarity index 100%
rename from core/res/res/drawable-hdpi/kg_widget_delete_drop_target.png
rename to packages/Keyguard/res/drawable-hdpi/kg_widget_delete_drop_target.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/lockscreen_protection_pattern.png b/packages/Keyguard/res/drawable-hdpi/lockscreen_protection_pattern.png
similarity index 100%
rename from core/res/res/drawable-hdpi/lockscreen_protection_pattern.png
rename to packages/Keyguard/res/drawable-hdpi/lockscreen_protection_pattern.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/sym_keyboard_return_holo.png b/packages/Keyguard/res/drawable-hdpi/sym_keyboard_return_holo.png
similarity index 100%
rename from core/res/res/drawable-hdpi/sym_keyboard_return_holo.png
rename to packages/Keyguard/res/drawable-hdpi/sym_keyboard_return_holo.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-ldpi/ic_input_delete.png b/packages/Keyguard/res/drawable-ldpi/ic_input_delete.png
new file mode 100644
index 0000000..d7eff17
--- /dev/null
+++ b/packages/Keyguard/res/drawable-ldpi/ic_input_delete.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-ldpi/ic_media_next.png b/packages/Keyguard/res/drawable-ldpi/ic_media_next.png
new file mode 100644
index 0000000..99927fd
--- /dev/null
+++ b/packages/Keyguard/res/drawable-ldpi/ic_media_next.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-ldpi/ic_media_play.png b/packages/Keyguard/res/drawable-ldpi/ic_media_play.png
new file mode 100644
index 0000000..e7c1972
--- /dev/null
+++ b/packages/Keyguard/res/drawable-ldpi/ic_media_play.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-ldpi/ic_media_previous.png b/packages/Keyguard/res/drawable-ldpi/ic_media_previous.png
new file mode 100644
index 0000000..df04322
--- /dev/null
+++ b/packages/Keyguard/res/drawable-ldpi/ic_media_previous.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..f88f7e1
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..7426994
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_facial_backup.png b/packages/Keyguard/res/drawable-mdpi/ic_facial_backup.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_facial_backup.png
rename to packages/Keyguard/res/drawable-mdpi/ic_facial_backup.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_input_delete.png b/packages/Keyguard/res/drawable-mdpi/ic_input_delete.png
new file mode 100644
index 0000000..47c8708
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_input_delete.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_alarm.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_alarm.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_alarm.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_alarm.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_camera_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_camera_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_emergencycall_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_emergencycall_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_emergencycall_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_emergencycall_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_emergencycall_pressed.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_emergencycall_pressed.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_emergencycall_pressed.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_emergencycall_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_forgotpassword_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_forgotpassword_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_forgotpassword_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_forgotpassword_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_forgotpassword_pressed.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_forgotpassword_pressed.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_forgotpassword_pressed.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_forgotpassword_pressed.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_glowdot.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_glowdot.png
new file mode 100644
index 0000000..056c3f17
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_glowdot.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_google_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_google_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_google_focused.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_focused.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_google_focused.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_focused.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_google_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_google_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_google_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..0187a02
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_ime.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_ime.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_ime.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_ime.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_lock_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_lock_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_lock_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_lock_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_lock_pressed.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_lock_pressed.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_lock_pressed.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_player_background.9.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_player_background.9.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_search_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_search_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_search_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_search_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_search_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_search_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_search_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_search_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_silent_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_silent_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_silent_focused.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_focused.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_silent_focused.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_focused.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_silent_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_silent_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_silent_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_sim.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_sim.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_sim.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_sim.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_soundon_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_soundon_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_soundon_focused.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_focused.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_soundon_focused.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_focused.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_soundon_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_soundon_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_soundon_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_unlock_activated.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_unlock_activated.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_unlock_activated.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_unlock_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_unlock_normal.png b/packages/Keyguard/res/drawable-mdpi/ic_lockscreen_unlock_normal.png
similarity index 100%
rename from core/res/res/drawable-mdpi/ic_lockscreen_unlock_normal.png
rename to packages/Keyguard/res/drawable-mdpi/ic_lockscreen_unlock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_media_next.png b/packages/Keyguard/res/drawable-mdpi/ic_media_next.png
new file mode 100644
index 0000000..fcd73d9
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_media_next.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_media_play.png b/packages/Keyguard/res/drawable-mdpi/ic_media_play.png
new file mode 100644
index 0000000..7966bbc
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_media_play.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_media_previous.png b/packages/Keyguard/res/drawable-mdpi/ic_media_previous.png
new file mode 100644
index 0000000..b653d05
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/ic_media_previous.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/intro_bg.png b/packages/Keyguard/res/drawable-mdpi/intro_bg.png
similarity index 100%
rename from core/res/res/drawable-mdpi/intro_bg.png
rename to packages/Keyguard/res/drawable-mdpi/intro_bg.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/kg_add_widget.png b/packages/Keyguard/res/drawable-mdpi/kg_add_widget.png
new file mode 100644
index 0000000..1cab0d9
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget_disabled.png b/packages/Keyguard/res/drawable-mdpi/kg_add_widget_disabled.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_add_widget_disabled.png
rename to packages/Keyguard/res/drawable-mdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget_pressed.png b/packages/Keyguard/res/drawable-mdpi/kg_add_widget_pressed.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_add_widget_pressed.png
rename to packages/Keyguard/res/drawable-mdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png b/packages/Keyguard/res/drawable-mdpi/kg_bouncer_bg_white.9.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_bouncer_bg_white.9.png
rename to packages/Keyguard/res/drawable-mdpi/kg_bouncer_bg_white.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_security_grip.9.png b/packages/Keyguard/res/drawable-mdpi/kg_security_grip.9.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_security_grip.9.png
rename to packages/Keyguard/res/drawable-mdpi/kg_security_grip.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_security_lock.png b/packages/Keyguard/res/drawable-mdpi/kg_security_lock.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_security_lock.png
rename to packages/Keyguard/res/drawable-mdpi/kg_security_lock.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/kg_security_lock_focused.png b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_focused.png
new file mode 100644
index 0000000..c3608f9
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_focused.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/kg_security_lock_normal.png b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_normal.png
new file mode 100644
index 0000000..7957c79
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/kg_security_lock_pressed.png b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_pressed.png
new file mode 100644
index 0000000..41715f5
--- /dev/null
+++ b/packages/Keyguard/res/drawable-mdpi/kg_security_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_widget_bg_padded.9.png b/packages/Keyguard/res/drawable-mdpi/kg_widget_bg_padded.9.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_widget_bg_padded.9.png
rename to packages/Keyguard/res/drawable-mdpi/kg_widget_bg_padded.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_widget_delete_drop_target.png b/packages/Keyguard/res/drawable-mdpi/kg_widget_delete_drop_target.png
similarity index 100%
rename from core/res/res/drawable-mdpi/kg_widget_delete_drop_target.png
rename to packages/Keyguard/res/drawable-mdpi/kg_widget_delete_drop_target.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/lockscreen_protection_pattern.png b/packages/Keyguard/res/drawable-mdpi/lockscreen_protection_pattern.png
similarity index 100%
rename from core/res/res/drawable-mdpi/lockscreen_protection_pattern.png
rename to packages/Keyguard/res/drawable-mdpi/lockscreen_protection_pattern.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/sym_keyboard_return_holo.png b/packages/Keyguard/res/drawable-mdpi/sym_keyboard_return_holo.png
similarity index 100%
rename from core/res/res/drawable-mdpi/sym_keyboard_return_holo.png
rename to packages/Keyguard/res/drawable-mdpi/sym_keyboard_return_holo.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-nodpi/app_icon.png b/packages/Keyguard/res/drawable-nodpi/app_icon.png
new file mode 100644
index 0000000..ea31bd8
--- /dev/null
+++ b/packages/Keyguard/res/drawable-nodpi/app_icon.png
Binary files differ
diff --git a/core/res/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..728fc67
--- /dev/null
+++ b/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..c7da024
--- /dev/null
+++ b/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..534c10b
--- /dev/null
+++ b/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_activated.png
new file mode 100644
index 0000000..500b157
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_activated.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_normal.png
new file mode 100644
index 0000000..d0e4cf3
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_action_assist_generic_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_facial_backup.png b/packages/Keyguard/res/drawable-xhdpi/ic_facial_backup.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_facial_backup.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_facial_backup.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_input_delete.png b/packages/Keyguard/res/drawable-xhdpi/ic_input_delete.png
new file mode 100644
index 0000000..8b822d9
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_input_delete.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_alarm.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_alarm.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_alarm.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_alarm.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_emergencycall_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_emergencycall_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_emergencycall_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_emergencycall_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_emergencycall_pressed.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_emergencycall_pressed.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_emergencycall_pressed.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_emergencycall_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_forgotpassword_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_forgotpassword_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_forgotpassword_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_forgotpassword_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_forgotpassword_pressed.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_forgotpassword_pressed.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_forgotpassword_pressed.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_forgotpassword_pressed.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_glowdot.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_glowdot.png
new file mode 100644
index 0000000..cbd039a
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_glowdot.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_google_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_activated.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_google_activated.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_google_focused.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_focused.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_google_focused.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_focused.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_google_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_google_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_google_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_handle_pressed.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_handle_pressed.png
new file mode 100644
index 0000000..2d28009
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_handle_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_ime.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_ime.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_ime.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_ime.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_lock_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_lock_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_lock_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_lock_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_lock_pressed.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_lock_pressed.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_lock_pressed.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_player_background.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_silent_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_activated.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_silent_activated.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_silent_focused.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_focused.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_silent_focused.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_focused.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_silent_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_silent_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_silent_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_sim.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_sim.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_sim.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_sim.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_soundon_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_activated.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_soundon_activated.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_soundon_focused.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_focused.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_soundon_focused.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_focused.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_soundon_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_soundon_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_soundon_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_unlock_activated.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_unlock_activated.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_unlock_activated.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_unlock_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_unlock_normal.png b/packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_unlock_normal.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/ic_lockscreen_unlock_normal.png
rename to packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_unlock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_media_next.png b/packages/Keyguard/res/drawable-xhdpi/ic_media_next.png
new file mode 100644
index 0000000..4def965
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_media_next.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_media_play.png b/packages/Keyguard/res/drawable-xhdpi/ic_media_play.png
new file mode 100644
index 0000000..ccfef18
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_media_play.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_media_previous.png b/packages/Keyguard/res/drawable-xhdpi/ic_media_previous.png
new file mode 100644
index 0000000..c4472ae
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/ic_media_previous.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/intro_bg.png b/packages/Keyguard/res/drawable-xhdpi/intro_bg.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/intro_bg.png
rename to packages/Keyguard/res/drawable-xhdpi/intro_bg.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/kg_add_widget.png b/packages/Keyguard/res/drawable-xhdpi/kg_add_widget.png
new file mode 100644
index 0000000..d71905f
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget_disabled.png b/packages/Keyguard/res/drawable-xhdpi/kg_add_widget_disabled.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_add_widget_disabled.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget_pressed.png b/packages/Keyguard/res/drawable-xhdpi/kg_add_widget_pressed.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_add_widget_pressed.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png b/packages/Keyguard/res/drawable-xhdpi/kg_bouncer_bg_white.9.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_bouncer_bg_white.9.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_bouncer_bg_white.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_security_grip.9.png b/packages/Keyguard/res/drawable-xhdpi/kg_security_grip.9.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_security_grip.9.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_security_grip.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_security_lock.png b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_security_lock.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_security_lock.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_focused.png b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_focused.png
new file mode 100644
index 0000000..db22016
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_focused.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_normal.png b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_normal.png
new file mode 100644
index 0000000..17ebb5f
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_normal.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_pressed.png b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_pressed.png
new file mode 100644
index 0000000..186b6ff
--- /dev/null
+++ b/packages/Keyguard/res/drawable-xhdpi/kg_security_lock_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_widget_bg_padded.9.png b/packages/Keyguard/res/drawable-xhdpi/kg_widget_bg_padded.9.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_widget_bg_padded.9.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_widget_bg_padded.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_widget_delete_drop_target.png b/packages/Keyguard/res/drawable-xhdpi/kg_widget_delete_drop_target.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/kg_widget_delete_drop_target.png
rename to packages/Keyguard/res/drawable-xhdpi/kg_widget_delete_drop_target.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/lockscreen_protection_pattern.png b/packages/Keyguard/res/drawable-xhdpi/lockscreen_protection_pattern.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/lockscreen_protection_pattern.png
rename to packages/Keyguard/res/drawable-xhdpi/lockscreen_protection_pattern.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/sym_keyboard_return_holo.png b/packages/Keyguard/res/drawable-xhdpi/sym_keyboard_return_holo.png
similarity index 100%
rename from core/res/res/drawable-xhdpi/sym_keyboard_return_holo.png
rename to packages/Keyguard/res/drawable-xhdpi/sym_keyboard_return_holo.png
Binary files differ
diff --git a/packages/Keyguard/res/drawable/ic_action_assist_generic.xml b/packages/Keyguard/res/drawable/ic_action_assist_generic.xml
new file mode 100644
index 0000000..60f5d5d
--- /dev/null
+++ b/packages/Keyguard/res/drawable/ic_action_assist_generic.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:state_enabled="true"
+ android:state_active="false"
+ android:state_focused="false"
+ android:drawable="@drawable/ic_action_assist_generic_normal" />
+
+ <item
+ android:state_enabled="true"
+ android:state_active="true"
+ android:state_focused="false"
+ android:drawable="@drawable/ic_action_assist_generic_activated" />
+
+ <item
+ android:state_enabled="true"
+ android:state_active="false"
+ android:state_focused="true"
+ android:drawable="@drawable/ic_action_assist_generic_activated" />
+
+</selector>
diff --git a/core/res/res/drawable/ic_lockscreen_camera.xml b/packages/Keyguard/res/drawable/ic_lockscreen_camera.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_camera.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_camera.xml
diff --git a/core/res/res/drawable/ic_lockscreen_handle.xml b/packages/Keyguard/res/drawable/ic_lockscreen_handle.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_handle.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_handle.xml
diff --git a/packages/Keyguard/res/drawable/ic_lockscreen_outerring.xml b/packages/Keyguard/res/drawable/ic_lockscreen_outerring.xml
new file mode 100644
index 0000000..75bea70
--- /dev/null
+++ b/packages/Keyguard/res/drawable/ic_lockscreen_outerring.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval"
+ >
+ <size android:height="@dimen/keyguard_lockscreen_outerring_diameter"
+ android:width="@dimen/keyguard_lockscreen_outerring_diameter" />
+ <solid android:color="#00000000" />
+ <stroke android:color="#1affffff" android:width="2dp" />
+</shape>
diff --git a/core/res/res/drawable/ic_lockscreen_silent.xml b/packages/Keyguard/res/drawable/ic_lockscreen_silent.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_silent.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_silent.xml
diff --git a/core/res/res/drawable/ic_lockscreen_soundon.xml b/packages/Keyguard/res/drawable/ic_lockscreen_soundon.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_soundon.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_soundon.xml
diff --git a/core/res/res/drawable/ic_lockscreen_unlock.xml b/packages/Keyguard/res/drawable/ic_lockscreen_unlock.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_unlock.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_unlock.xml
diff --git a/core/res/res/drawable/ic_lockscreen_unlock_phantom.xml b/packages/Keyguard/res/drawable/ic_lockscreen_unlock_phantom.xml
similarity index 100%
rename from core/res/res/drawable/ic_lockscreen_unlock_phantom.xml
rename to packages/Keyguard/res/drawable/ic_lockscreen_unlock_phantom.xml
diff --git a/core/res/res/drawable/keyguard_add_widget_button.xml b/packages/Keyguard/res/drawable/keyguard_add_widget_button.xml
similarity index 100%
rename from core/res/res/drawable/keyguard_add_widget_button.xml
rename to packages/Keyguard/res/drawable/keyguard_add_widget_button.xml
diff --git a/core/res/res/drawable/keyguard_expand_challenge_handle.xml b/packages/Keyguard/res/drawable/keyguard_expand_challenge_handle.xml
similarity index 100%
rename from core/res/res/drawable/keyguard_expand_challenge_handle.xml
rename to packages/Keyguard/res/drawable/keyguard_expand_challenge_handle.xml
diff --git a/core/res/res/drawable/lockscreen_emergency_button.xml b/packages/Keyguard/res/drawable/lockscreen_emergency_button.xml
similarity index 100%
rename from core/res/res/drawable/lockscreen_emergency_button.xml
rename to packages/Keyguard/res/drawable/lockscreen_emergency_button.xml
diff --git a/core/res/res/drawable/lockscreen_forgot_password_button.xml b/packages/Keyguard/res/drawable/lockscreen_forgot_password_button.xml
similarity index 100%
rename from core/res/res/drawable/lockscreen_forgot_password_button.xml
rename to packages/Keyguard/res/drawable/lockscreen_forgot_password_button.xml
diff --git a/core/res/res/layout-land/keyguard_host_view.xml b/packages/Keyguard/res/layout-land/keyguard_host_view.xml
similarity index 82%
rename from core/res/res/layout-land/keyguard_host_view.xml
rename to packages/Keyguard/res/layout-land/keyguard_host_view.xml
index 6b36235..eeb9ee7 100644
--- a/core/res/res/layout-land/keyguard_host_view.xml
+++ b/packages/Keyguard/res/layout-land/keyguard_host_view.xml
@@ -19,18 +19,19 @@
<!-- This is the host view that generally contains two sub views: the widget view
and the security view. -->
-<com.android.internal.policy.impl.keyguard.KeyguardHostView
+<com.android.keyguard.KeyguardHostView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_host_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
- <com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout
+ <com.android.keyguard.MultiPaneChallengeLayout
android:id="@+id/multi_pane_challenge"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:orientation="horizontal"
android:clipChildren="false">
<include layout="@layout/keyguard_widget_remove_drop_target"
@@ -55,13 +56,13 @@
androidprv:layout_childType="scrim"
android:background="#99000000" />
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
+ <com.android.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androidprv:layout_childType="challenge"
androidprv:layout_centerWithinArea="0.55">
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
+ <com.android.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -72,9 +73,9 @@
android:paddingRight="@dimen/keyguard_security_view_margin"
android:paddingBottom="@dimen/keyguard_security_view_margin"
android:gravity="center">
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
+ </com.android.keyguard.KeyguardSecurityViewFlipper>
+ </com.android.keyguard.KeyguardSecurityContainer>
- </com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardHostView>
+ </com.android.keyguard.MultiPaneChallengeLayout>
+</com.android.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-land/keyguard_status_area.xml b/packages/Keyguard/res/layout-land/keyguard_status_area.xml
similarity index 100%
rename from core/res/res/layout-land/keyguard_status_area.xml
rename to packages/Keyguard/res/layout-land/keyguard_status_area.xml
diff --git a/core/res/res/layout-land/keyguard_widget_pager.xml b/packages/Keyguard/res/layout-land/keyguard_widget_pager.xml
similarity index 83%
rename from core/res/res/layout-land/keyguard_widget_pager.xml
rename to packages/Keyguard/res/layout-land/keyguard_widget_pager.xml
index 02c6d0e..da31065 100644
--- a/core/res/res/layout-land/keyguard_widget_pager.xml
+++ b/packages/Keyguard/res/layout-land/keyguard_widget_pager.xml
@@ -18,8 +18,8 @@
-->
<!-- This is the selector widget that allows the user to select an action. -->
-<com.android.internal.policy.impl.keyguard.KeyguardWidgetCarousel
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+<com.android.keyguard.KeyguardWidgetCarousel
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingLeft="25dp"
android:paddingRight="25dp"
@@ -27,4 +27,4 @@
android:paddingBottom="25dp"
android:clipToPadding="false"
androidprv:pageSpacing="10dp">
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetCarousel>
\ No newline at end of file
+</com.android.keyguard.KeyguardWidgetCarousel>
diff --git a/core/res/res/layout-port/keyguard_host_view.xml b/packages/Keyguard/res/layout-port/keyguard_host_view.xml
similarity index 82%
rename from core/res/res/layout-port/keyguard_host_view.xml
rename to packages/Keyguard/res/layout-port/keyguard_host_view.xml
index fb25f9c..8498dcf 100644
--- a/core/res/res/layout-port/keyguard_host_view.xml
+++ b/packages/Keyguard/res/layout-port/keyguard_host_view.xml
@@ -19,16 +19,16 @@
<!-- This is the host view that generally contains two sub views: the widget view
and the security view. -->
-<com.android.internal.policy.impl.keyguard.KeyguardHostView
+<com.android.keyguard.KeyguardHostView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_host_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
- <com.android.internal.policy.impl.keyguard.SlidingChallengeLayout
+ <com.android.keyguard.SlidingChallengeLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -60,15 +60,15 @@
androidprv:layout_childType="scrim"
android:background="#99000000" />
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
+ <com.android.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
androidprv:layout_childType="challenge"
android:padding="0dp"
android:gravity="bottom|center_horizontal">
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
+ <com.android.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -76,8 +76,8 @@
android:clipToPadding="false"
android:paddingTop="@dimen/keyguard_security_view_margin"
android:gravity="center">
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
+ </com.android.keyguard.KeyguardSecurityViewFlipper>
+ </com.android.keyguard.KeyguardSecurityContainer>
<ImageButton
android:layout_width="match_parent"
@@ -89,6 +89,6 @@
android:scaleType="center"
android:contentDescription="@string/keyguard_accessibility_expand_lock_area" />
- </com.android.internal.policy.impl.keyguard.SlidingChallengeLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardHostView>
+ </com.android.keyguard.SlidingChallengeLayout>
+</com.android.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-port/keyguard_status_area.xml b/packages/Keyguard/res/layout-port/keyguard_status_area.xml
similarity index 100%
rename from core/res/res/layout-port/keyguard_status_area.xml
rename to packages/Keyguard/res/layout-port/keyguard_status_area.xml
diff --git a/core/res/res/layout-port/keyguard_widget_pager.xml b/packages/Keyguard/res/layout-port/keyguard_widget_pager.xml
similarity index 84%
rename from core/res/res/layout-port/keyguard_widget_pager.xml
rename to packages/Keyguard/res/layout-port/keyguard_widget_pager.xml
index 7f22709..d0a07ca 100644
--- a/core/res/res/layout-port/keyguard_widget_pager.xml
+++ b/packages/Keyguard/res/layout-port/keyguard_widget_pager.xml
@@ -18,8 +18,8 @@
-->
<!-- This is the selector widget that allows the user to select an action. -->
-<com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+<com.android.keyguard.KeyguardWidgetPager
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/app_widget_container"
android:paddingLeft="25dp"
@@ -28,4 +28,4 @@
android:paddingBottom="@dimen/kg_widget_pager_bottom_padding"
android:clipToPadding="false"
androidprv:pageSpacing="10dp">
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
+</com.android.keyguard.KeyguardWidgetPager>
diff --git a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml b/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml
similarity index 82%
rename from core/res/res/layout-sw600dp-port/keyguard_host_view.xml
rename to packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml
index e3d577d..77bc9b5 100644
--- a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
+++ b/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml
@@ -19,15 +19,15 @@
<!-- This is the host view that generally contains two sub views: the widget view
and the security view. -->
-<com.android.internal.policy.impl.keyguard.KeyguardHostView
+<com.android.keyguard.KeyguardHostView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_host_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
- <com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout
+ <com.android.keyguard.MultiPaneChallengeLayout
android:id="@+id/multi_pane_challenge"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -57,14 +57,14 @@
androidprv:layout_childType="scrim"
android:background="#99000000" />
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
+ <com.android.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androidprv:layout_centerWithinArea="0.5"
androidprv:layout_childType="challenge"
android:layout_gravity="center_horizontal|bottom">
- <com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
+ <com.android.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -75,8 +75,8 @@
android:paddingRight="@dimen/keyguard_security_view_margin"
android:paddingBottom="@dimen/keyguard_security_view_margin"
android:gravity="center">
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper>
- </com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer>
+ </com.android.keyguard.KeyguardSecurityViewFlipper>
+ </com.android.keyguard.KeyguardSecurityContainer>
- </com.android.internal.policy.impl.keyguard.MultiPaneChallengeLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardHostView>
+ </com.android.keyguard.MultiPaneChallengeLayout>
+</com.android.keyguard.KeyguardHostView>
diff --git a/core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml b/packages/Keyguard/res/layout-sw600dp/keyguard_glow_pad_container.xml
similarity index 100%
rename from core/res/res/layout-sw600dp/keyguard_glow_pad_container.xml
rename to packages/Keyguard/res/layout-sw600dp/keyguard_glow_pad_container.xml
diff --git a/core/res/res/layout/keyguard_account_view.xml b/packages/Keyguard/res/layout/keyguard_account_view.xml
similarity index 90%
rename from core/res/res/layout/keyguard_account_view.xml
rename to packages/Keyguard/res/layout/keyguard_account_view.xml
index fa36371..766effa 100644
--- a/core/res/res/layout/keyguard_account_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_account_view.xml
@@ -16,13 +16,14 @@
** limitations under the License.
*/
-->
-<com.android.internal.policy.impl.keyguard.KeyguardAccountView
+<com.android.keyguard.KeyguardAccountView
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_account_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:orientation="vertical">
<include layout="@layout/keyguard_message_area"
@@ -84,4 +85,4 @@
android:gravity="center_horizontal" />
-->
-</com.android.internal.policy.impl.keyguard.KeyguardAccountView>
+</com.android.keyguard.KeyguardAccountView>
diff --git a/core/res/res/layout/keyguard_add_widget.xml b/packages/Keyguard/res/layout/keyguard_add_widget.xml
similarity index 92%
rename from core/res/res/layout/keyguard_add_widget.xml
rename to packages/Keyguard/res/layout/keyguard_add_widget.xml
index d043fdb..01b616c 100644
--- a/core/res/res/layout/keyguard_add_widget.xml
+++ b/packages/Keyguard/res/layout/keyguard_add_widget.xml
@@ -18,7 +18,7 @@
-->
<!-- This is a view that shows general status information in Keyguard. -->
-<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
+<com.android.keyguard.KeyguardWidgetFrame
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyguard_add_widget"
android:layout_width="match_parent"
@@ -39,4 +39,4 @@
android:src="@drawable/keyguard_add_widget_button"
android:contentDescription="@string/keyguard_accessibility_add_widget"/>
</FrameLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
+</com.android.keyguard.KeyguardWidgetFrame>
diff --git a/core/res/res/layout/keyguard_emergency_carrier_area.xml b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
similarity index 90%
rename from core/res/res/layout/keyguard_emergency_carrier_area.xml
rename to packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
index 52adc04..1e2de92 100644
--- a/core/res/res/layout/keyguard_emergency_carrier_area.xml
+++ b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
@@ -28,7 +28,7 @@
android:layout_alignParentBottom="true"
android:clickable="true">
- <com.android.internal.policy.impl.keyguard.CarrierText
+ <com.android.keyguard.CarrierText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
@@ -46,12 +46,12 @@
android:gravity="center"
android:weightSum="2">
- <com.android.internal.policy.impl.keyguard.EmergencyButton
+ <com.android.keyguard.EmergencyButton
android:id="@+id/emergency_call_button"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
+ android:drawableLeft="@drawable/lockscreen_emergency_button"
android:text="@string/kg_emergency_call_label"
style="?android:attr/buttonBarButtonStyle"
android:textAppearance="?android:attr/textAppearanceMedium"
@@ -63,7 +63,7 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:drawableLeft="@*android:drawable/lockscreen_forgot_password_button"
+ android:drawableLeft="@drawable/lockscreen_forgot_password_button"
style="?android:attr/buttonBarButtonStyle"
android:textSize="@dimen/kg_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
diff --git a/core/res/res/layout/keyguard_emergency_carrier_area_empty.xml b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area_empty.xml
similarity index 100%
rename from core/res/res/layout/keyguard_emergency_carrier_area_empty.xml
rename to packages/Keyguard/res/layout/keyguard_emergency_carrier_area_empty.xml
diff --git a/core/res/res/layout/keyguard_face_unlock_view.xml b/packages/Keyguard/res/layout/keyguard_face_unlock_view.xml
similarity index 83%
rename from core/res/res/layout/keyguard_face_unlock_view.xml
rename to packages/Keyguard/res/layout/keyguard_face_unlock_view.xml
index c9f1176..94c68a5 100644
--- a/core/res/res/layout/keyguard_face_unlock_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_face_unlock_view.xml
@@ -18,14 +18,15 @@
-->
<!-- This is the screen that allows the user to unlock by showing their face. -->
-<com.android.internal.policy.impl.keyguard.KeyguardFaceUnlockView
+<com.android.keyguard.KeyguardFaceUnlockView
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_face_unlock_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:contentDescription="@string/keyguard_accessibility_face_unlock">
<include layout="@layout/keyguard_message_area"
@@ -35,7 +36,7 @@
<FrameLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
@@ -45,14 +46,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
- android:background="@*android:drawable/intro_bg"
+ android:background="@drawable/intro_bg"
android:gravity="center">
<View
android:id="@+id/spotlightMask"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@*android:color/facelock_spotlight_mask"
+ android:background="@color/facelock_spotlight_mask"
/>
<ImageButton
@@ -63,7 +64,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:background="#00000000"
- android:src="@*android:drawable/ic_facial_backup"
+ android:src="@drawable/ic_facial_backup"
/>
</com.android.internal.widget.FaceUnlockView>
</FrameLayout>
@@ -75,4 +76,4 @@
android:orientation="vertical"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-</com.android.internal.policy.impl.keyguard.KeyguardFaceUnlockView>
+</com.android.keyguard.KeyguardFaceUnlockView>
diff --git a/core/res/res/layout/keyguard_glow_pad_container.xml b/packages/Keyguard/res/layout/keyguard_glow_pad_container.xml
similarity index 94%
rename from core/res/res/layout/keyguard_glow_pad_container.xml
rename to packages/Keyguard/res/layout/keyguard_glow_pad_container.xml
index d86707f..376d0e9 100644
--- a/core/res/res/layout/keyguard_glow_pad_container.xml
+++ b/packages/Keyguard/res/layout/keyguard_glow_pad_container.xml
@@ -22,5 +22,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
- android:layout_marginBottom="-60dp"/>
+ android:layout_marginBottom="-80dp"/>
</merge>
\ No newline at end of file
diff --git a/core/res/res/layout/keyguard_glow_pad_view.xml b/packages/Keyguard/res/layout/keyguard_glow_pad_view.xml
similarity index 72%
rename from core/res/res/layout/keyguard_glow_pad_view.xml
rename to packages/Keyguard/res/layout/keyguard_glow_pad_view.xml
index cfd8160..3a466dd 100644
--- a/core/res/res/layout/keyguard_glow_pad_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_glow_pad_view.xml
@@ -31,16 +31,16 @@
prvandroid:targetDrawables="@array/lockscreen_targets_unlock_only"
prvandroid:targetDescriptions="@array/lockscreen_target_descriptions_unlock_only"
- prvandroid:directionDescriptions="@*android:array/lockscreen_direction_descriptions"
- prvandroid:handleDrawable="@*android:drawable/ic_lockscreen_handle"
- prvandroid:outerRingDrawable="@*android:drawable/ic_lockscreen_outerring"
- prvandroid:outerRadius="@*android:dimen/glowpadview_target_placement_radius"
- prvandroid:innerRadius="@*android:dimen/glowpadview_inner_radius"
- prvandroid:snapMargin="@*android:dimen/glowpadview_snap_margin"
+ prvandroid:directionDescriptions="@array/lockscreen_direction_descriptions"
+ prvandroid:handleDrawable="@drawable/ic_lockscreen_handle"
+ prvandroid:outerRingDrawable="@drawable/ic_lockscreen_outerring"
+ prvandroid:outerRadius="@dimen/glowpadview_target_placement_radius"
+ prvandroid:innerRadius="@dimen/glowpadview_inner_radius"
+ prvandroid:snapMargin="@dimen/glowpadview_snap_margin"
prvandroid:firstItemOffset="@integer/kg_glowpad_rotation_offset"
prvandroid:magneticTargets="true"
prvandroid:feedbackCount="1"
prvandroid:vibrationDuration="20"
- prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius"
- prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot"
+ prvandroid:glowRadius="@dimen/glowpadview_glow_radius"
+ prvandroid:pointDrawable="@drawable/ic_lockscreen_glowdot"
prvandroid:allowScaling="true" />
diff --git a/core/res/res/layout/keyguard_message_area.xml b/packages/Keyguard/res/layout/keyguard_message_area.xml
similarity index 94%
rename from core/res/res/layout/keyguard_message_area.xml
rename to packages/Keyguard/res/layout/keyguard_message_area.xml
index 37463cf..a709e98 100644
--- a/core/res/res/layout/keyguard_message_area.xml
+++ b/packages/Keyguard/res/layout/keyguard_message_area.xml
@@ -18,7 +18,7 @@
-->
<!-- This contains emergency call button and carrier as shared by pin/pattern/password screens -->
-<com.android.internal.policy.impl.keyguard.KeyguardMessageArea
+<com.android.keyguard.KeyguardMessageArea
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/core/res/res/layout/keyguard_message_area_large.xml b/packages/Keyguard/res/layout/keyguard_message_area_large.xml
similarity index 94%
rename from core/res/res/layout/keyguard_message_area_large.xml
rename to packages/Keyguard/res/layout/keyguard_message_area_large.xml
index 584cec4..ab6246d 100644
--- a/core/res/res/layout/keyguard_message_area_large.xml
+++ b/packages/Keyguard/res/layout/keyguard_message_area_large.xml
@@ -18,7 +18,7 @@
-->
<!-- This contains emergency call button and carrier as shared by pin/pattern/password screens -->
-<com.android.internal.policy.impl.keyguard.KeyguardMessageArea
+<com.android.keyguard.KeyguardMessageArea
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/core/res/res/layout/keyguard_multi_user_avatar.xml b/packages/Keyguard/res/layout/keyguard_multi_user_avatar.xml
similarity index 92%
rename from core/res/res/layout/keyguard_multi_user_avatar.xml
rename to packages/Keyguard/res/layout/keyguard_multi_user_avatar.xml
index 2d8f02d..41b0be9 100644
--- a/core/res/res/layout/keyguard_multi_user_avatar.xml
+++ b/packages/Keyguard/res/layout/keyguard_multi_user_avatar.xml
@@ -18,7 +18,7 @@
-->
<!-- This is a view that shows general status information in Keyguard. -->
-<com.android.internal.policy.impl.keyguard.KeyguardMultiUserAvatar
+<com.android.keyguard.KeyguardMultiUserAvatar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/keyguard_avatar_size"
android:layout_height="@dimen/keyguard_avatar_size"
@@ -42,4 +42,4 @@
android:ellipsize="end"
android:paddingLeft="2dp"
android:paddingRight="2dp" />
-</com.android.internal.policy.impl.keyguard.KeyguardMultiUserAvatar>
+</com.android.keyguard.KeyguardMultiUserAvatar>
diff --git a/core/res/res/layout/keyguard_multi_user_selector.xml b/packages/Keyguard/res/layout/keyguard_multi_user_selector.xml
similarity index 78%
rename from core/res/res/layout/keyguard_multi_user_selector.xml
rename to packages/Keyguard/res/layout/keyguard_multi_user_selector.xml
index ee01285..c1d5326 100644
--- a/core/res/res/layout/keyguard_multi_user_selector.xml
+++ b/packages/Keyguard/res/layout/keyguard_multi_user_selector.xml
@@ -16,8 +16,8 @@
** limitations under the License.
*/
-->
-<com.android.internal.policy.impl.keyguard.KeyguardMultiUserSelectorView
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+<com.android.keyguard.KeyguardMultiUserSelectorView
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
xmlns:android="http://schemas.android.com/apk/res/android"
androidprv:layout_childType="userSwitcher"
android:id="@+id/keyguard_user_selector"
@@ -25,10 +25,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:contentDescription="@*android:string/keyguard_accessibility_user_selector"
+ android:contentDescription="@string/keyguard_accessibility_user_selector"
android:visibility="gone">
- <com.android.internal.policy.impl.keyguard.KeyguardLinearLayout
+ <com.android.keyguard.KeyguardLinearLayout
android:id="@+id/keyguard_users_grid"
android:orientation="horizontal"
android:layout_width="wrap_content"
@@ -36,4 +36,4 @@
android:layout_height="@dimen/keyguard_avatar_size"
android:layout_gravity="center|bottom" />
-</com.android.internal.policy.impl.keyguard.KeyguardMultiUserSelectorView>
+</com.android.keyguard.KeyguardMultiUserSelectorView>
diff --git a/core/res/res/layout/keyguard_password_view.xml b/packages/Keyguard/res/layout/keyguard_password_view.xml
similarity index 87%
rename from core/res/res/layout/keyguard_password_view.xml
rename to packages/Keyguard/res/layout/keyguard_password_view.xml
index aab54c3..d8012bf 100644
--- a/core/res/res/layout/keyguard_password_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_password_view.xml
@@ -16,14 +16,15 @@
** limitations under the License.
*/
-->
-<com.android.internal.policy.impl.keyguard.KeyguardPasswordView
+<com.android.keyguard.KeyguardPasswordView
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_password_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="bottom"
android:contentDescription="@string/keyguard_accessibility_password_unlock"
>
@@ -43,7 +44,7 @@
since the backspace/IME switcher looks better inside -->
<FrameLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
@@ -62,7 +63,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:layout_gravity="center_vertical"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword"
@@ -76,7 +77,7 @@
<ImageView android:id="@+id/switch_ime_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@*android:drawable/ic_lockscreen_ime"
+ android:src="@drawable/ic_lockscreen_ime"
android:clickable="true"
android:padding="8dip"
android:layout_gravity="center"
@@ -101,4 +102,4 @@
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-</com.android.internal.policy.impl.keyguard.KeyguardPasswordView>
+</com.android.keyguard.KeyguardPasswordView>
diff --git a/core/res/res/layout/keyguard_pattern_view.xml b/packages/Keyguard/res/layout/keyguard_pattern_view.xml
similarity index 88%
rename from core/res/res/layout/keyguard_pattern_view.xml
rename to packages/Keyguard/res/layout/keyguard_pattern_view.xml
index 1bd3e4e..0c9380c 100644
--- a/core/res/res/layout/keyguard_pattern_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_pattern_view.xml
@@ -20,14 +20,15 @@
<!-- This is the screen that shows the 9 circle unlock widget and instructs
the user how to unlock their device, or make an emergency call. This
is the portrait layout. -->
-<com.android.internal.policy.impl.keyguard.KeyguardPatternView
+<com.android.keyguard.KeyguardPatternView
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_pattern_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="center_horizontal"
android:contentDescription="@string/keyguard_accessibility_pattern_unlock">
@@ -48,7 +49,7 @@
<FrameLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
@@ -75,4 +76,4 @@
</LinearLayout>
</FrameLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardPatternView>
+</com.android.keyguard.KeyguardPatternView>
diff --git a/core/res/res/layout/keyguard_pin_view.xml b/packages/Keyguard/res/layout/keyguard_pin_view.xml
similarity index 85%
rename from core/res/res/layout/keyguard_pin_view.xml
rename to packages/Keyguard/res/layout/keyguard_pin_view.xml
index 6a3b9e6..00c6a21 100644
--- a/core/res/res/layout/keyguard_pin_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_pin_view.xml
@@ -17,14 +17,14 @@
*/
-->
-<com.android.internal.policy.impl.keyguard.KeyguardPINView
+<com.android.keyguard.KeyguardPINView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_pin_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:orientation="vertical"
android:contentDescription="@string/keyguard_accessibility_pin_unlock"
>
@@ -34,7 +34,7 @@
/>
<LinearLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
@@ -53,7 +53,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:cursorVisible="false"
android:background="@null"
@@ -64,7 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
+ android:src="@drawable/ic_input_delete"
android:clickable="true"
android:paddingTop="8dip"
android:paddingBottom="8dip"
@@ -85,7 +85,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key1"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -94,7 +94,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key2"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -103,7 +103,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="2"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key3"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -119,7 +119,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key4"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -128,7 +128,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="4"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key5"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -137,7 +137,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="5"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key6"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -153,7 +153,7 @@
android:orientation="horizontal"
android:layout_weight="1"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key7"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -162,7 +162,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="7"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key8"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -171,7 +171,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="8"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key9"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -192,7 +192,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key0"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -221,4 +221,4 @@
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-</com.android.internal.policy.impl.keyguard.KeyguardPINView>
+</com.android.keyguard.KeyguardPINView>
diff --git a/core/res/res/layout/keyguard_selector_view.xml b/packages/Keyguard/res/layout/keyguard_selector_view.xml
similarity index 84%
rename from core/res/res/layout/keyguard_selector_view.xml
rename to packages/Keyguard/res/layout/keyguard_selector_view.xml
index dfacb6a..6cb5e67 100644
--- a/core/res/res/layout/keyguard_selector_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_selector_view.xml
@@ -18,14 +18,14 @@
-->
<!-- This is the selector widget that allows the user to select an action. -->
-<com.android.internal.policy.impl.keyguard.KeyguardSelectorView
- xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
+<com.android.keyguard.KeyguardSelectorView
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_selector_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="420dp"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="420dp"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
@@ -49,7 +49,7 @@
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
- android:background="@*android:drawable/kg_bouncer_bg_white"/>
+ android:background="@drawable/kg_bouncer_bg_white"/>
<include layout="@layout/keyguard_glow_pad_container" />
@@ -60,5 +60,5 @@
android:layout_gravity="bottom|center_horizontal" />
</FrameLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardSelectorView>
+</com.android.keyguard.KeyguardSelectorView>
diff --git a/core/res/res/layout/keyguard_sim_pin_view.xml b/packages/Keyguard/res/layout/keyguard_sim_pin_view.xml
similarity index 86%
rename from core/res/res/layout/keyguard_sim_pin_view.xml
rename to packages/Keyguard/res/layout/keyguard_sim_pin_view.xml
index 6e6fe08..eccac19 100644
--- a/core/res/res/layout/keyguard_sim_pin_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_sim_pin_view.xml
@@ -17,15 +17,15 @@
*/
-->
<!-- This is the SIM PIN view that allows the user to enter a SIM PIN to unlock the device. -->
-<com.android.internal.policy.impl.keyguard.KeyguardSimPinView
+<com.android.keyguard.KeyguardSimPinView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_sim_pin_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="center_horizontal">
<ImageView
@@ -39,7 +39,7 @@
/>
<LinearLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
@@ -58,7 +58,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:cursorVisible="false"
android:background="@null"
@@ -69,7 +69,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
+ android:src="@drawable/ic_input_delete"
android:clickable="true"
android:paddingTop="8dip"
android:paddingBottom="8dip"
@@ -90,7 +90,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key1"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -99,7 +99,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key2"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -108,7 +108,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="2"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key3"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -124,7 +124,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key4"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -133,7 +133,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="4"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key5"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -142,7 +142,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="5"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key6"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -158,7 +158,7 @@
android:orientation="horizontal"
android:layout_weight="1"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key7"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -167,7 +167,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="7"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key8"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -176,7 +176,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="8"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key9"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -197,7 +197,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key0"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -227,4 +227,4 @@
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-</com.android.internal.policy.impl.keyguard.KeyguardSimPinView>
+</com.android.keyguard.KeyguardSimPinView>
diff --git a/core/res/res/layout/keyguard_sim_puk_view.xml b/packages/Keyguard/res/layout/keyguard_sim_puk_view.xml
similarity index 86%
rename from core/res/res/layout/keyguard_sim_puk_view.xml
rename to packages/Keyguard/res/layout/keyguard_sim_puk_view.xml
index 0412fdc..fe37203 100644
--- a/core/res/res/layout/keyguard_sim_puk_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_sim_puk_view.xml
@@ -18,15 +18,15 @@
-->
<!-- This is the SIM PUK view that allows the user to recover their device by entering the
carrier-provided PUK code and entering a new SIM PIN for it. -->
-<com.android.internal.policy.impl.keyguard.KeyguardSimPukView
+<com.android.keyguard.KeyguardSimPukView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_sim_puk_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="center_horizontal">
<ImageView
@@ -40,7 +40,7 @@
/>
<LinearLayout
android:id="@+id/keyguard_bouncer_frame"
- android:background="@*android:drawable/kg_bouncer_bg_white"
+ android:background="@drawable/kg_bouncer_bg_white"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
@@ -59,7 +59,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
- android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
+ android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:cursorVisible="false"
android:background="@null"
@@ -70,7 +70,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
- android:src="@*android:drawable/ic_input_delete"
+ android:src="@drawable/ic_input_delete"
android:clickable="true"
android:paddingTop="8dip"
android:paddingBottom="8dip"
@@ -91,7 +91,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key1"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -100,7 +100,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key2"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -109,7 +109,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="2"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key3"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -125,7 +125,7 @@
android:layout_weight="1"
android:orientation="horizontal"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key4"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -134,7 +134,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="4"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key5"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -143,7 +143,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="5"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key6"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -159,7 +159,7 @@
android:orientation="horizontal"
android:layout_weight="1"
>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key7"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -168,7 +168,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="7"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key8"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -177,7 +177,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="8"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key9"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -198,7 +198,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
/>
- <view class="com.android.internal.policy.impl.keyguard.NumPadKey"
+ <view class="com.android.keyguard.NumPadKey"
android:id="@+id/key0"
style="@style/Widget.Button.NumPadKey"
android:layout_width="0px"
@@ -227,4 +227,4 @@
android:orientation="vertical"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal" />
-</com.android.internal.policy.impl.keyguard.KeyguardSimPukView>
+</com.android.keyguard.KeyguardSimPukView>
diff --git a/core/res/res/layout/keyguard_status_view.xml b/packages/Keyguard/res/layout/keyguard_status_view.xml
similarity index 80%
rename from core/res/res/layout/keyguard_status_view.xml
rename to packages/Keyguard/res/layout/keyguard_status_view.xml
index 9e36df3..2304d9f 100644
--- a/core/res/res/layout/keyguard_status_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_status_view.xml
@@ -18,29 +18,30 @@
-->
<!-- This is a view that shows general status information in Keyguard. -->
-<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
+<com.android.keyguard.KeyguardWidgetFrame
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
android:id="@+id/keyguard_status_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_maxWidth="@dimen/keyguard_security_width"
- android:layout_maxHeight="@dimen/keyguard_security_height"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width"
+ androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="center_horizontal">
- <com.android.internal.policy.impl.keyguard.KeyguardStatusView
+ <com.android.keyguard.KeyguardStatusView
android:id="@+id/keyguard_status_view_face_palm"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal|top"
- android:contentDescription="@android:string/keyguard_accessibility_status">
+ android:contentDescription="@string/keyguard_accessibility_status">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:orientation="vertical"
android:focusable="true">
- <com.android.internal.policy.impl.keyguard.ClockView
+ <com.android.keyguard.ClockView
android:id="@+id/clock_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -58,10 +59,10 @@
android:drawablePadding="2dip"
/>
- </com.android.internal.policy.impl.keyguard.ClockView>
+ </com.android.keyguard.ClockView>
<include layout="@layout/keyguard_status_area" />
</LinearLayout>
- </com.android.internal.policy.impl.keyguard.KeyguardStatusView>
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
+ </com.android.keyguard.KeyguardStatusView>
+</com.android.keyguard.KeyguardWidgetFrame>
diff --git a/packages/Keyguard/res/layout/keyguard_test_activity.xml b/packages/Keyguard/res/layout/keyguard_test_activity.xml
new file mode 100644
index 0000000..a3b75b0
--- /dev/null
+++ b/packages/Keyguard/res/layout/keyguard_test_activity.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, 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.
+*/
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center">
+
+ <Button android:id="@+id/do_keyguard"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/do_keyguard" />
+
+ <Button android:id="@+id/on_screen_turned_off"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/on_screen_turned_off" />
+
+ <Button android:id="@+id/on_screen_turned_on"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/on_screen_turned_on" />
+
+ <Button android:id="@+id/verify_unlock"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/verify_unlock" />
+
+</LinearLayout>
diff --git a/core/res/res/layout/keyguard_transport_control_view.xml b/packages/Keyguard/res/layout/keyguard_transport_control_view.xml
similarity index 83%
rename from core/res/res/layout/keyguard_transport_control_view.xml
rename to packages/Keyguard/res/layout/keyguard_transport_control_view.xml
index 532322c..7e36f9f 100644
--- a/core/res/res/layout/keyguard_transport_control_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_transport_control_view.xml
@@ -15,7 +15,7 @@
-->
<!-- This is a view to control music playback in keyguard. -->
-<com.android.internal.policy.impl.keyguard.KeyguardTransportControlView
+<com.android.keyguard.KeyguardTransportControlView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -26,8 +26,8 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:foreground="@*android:drawable/ic_lockscreen_player_background"
- android:contentDescription="@*android:string/keygaurd_accessibility_media_controls">
+ android:foreground="@drawable/ic_lockscreen_player_background"
+ android:contentDescription="@string/keygaurd_accessibility_media_controls">
<!-- Use ImageView for its cropping features; otherwise could be android:background -->
<ImageView
android:id="@+id/albumart"
@@ -70,11 +70,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:src="@*android:drawable/ic_media_previous"
+ android:src="@drawable/ic_media_previous"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:padding="10dip"
- android:contentDescription="@*android:string/lockscreen_transport_prev_description"/>
+ android:contentDescription="@string/keyguard_accessibility_transport_prev_description"/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
@@ -86,10 +86,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="true"
- android:src="@*android:drawable/ic_media_play"
+ android:src="@drawable/ic_media_play"
android:background="?android:attr/selectableItemBackground"
android:padding="10dip"
- android:contentDescription="@*android:string/lockscreen_transport_play_description"/>
+ android:contentDescription="@string/keyguard_accessibility_transport_play_description"/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
@@ -101,12 +101,12 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="true"
- android:src="@*android:drawable/ic_media_next"
+ android:src="@drawable/ic_media_next"
android:background="?android:attr/selectableItemBackground"
android:padding="10dip"
- android:contentDescription="@*android:string/lockscreen_transport_next_description"/>
+ android:contentDescription="@string/keyguard_accessibility_transport_next_description"/>
</FrameLayout>
</LinearLayout>
</LinearLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardTransportControlView>
\ No newline at end of file
+</com.android.keyguard.KeyguardTransportControlView>
diff --git a/core/res/res/layout/keyguard_widget_remove_drop_target.xml b/packages/Keyguard/res/layout/keyguard_widget_remove_drop_target.xml
similarity index 100%
rename from core/res/res/layout/keyguard_widget_remove_drop_target.xml
rename to packages/Keyguard/res/layout/keyguard_widget_remove_drop_target.xml
diff --git a/packages/Keyguard/res/menu/optionmenu.xml b/packages/Keyguard/res/menu/optionmenu.xml
new file mode 100644
index 0000000..22f300d
--- /dev/null
+++ b/packages/Keyguard/res/menu/optionmenu.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/none_menu_item"
+ android:title="@string/none_menu_item" />
+ <item android:id="@+id/pin_menu_item"
+ android:title="@string/pin_menu_item" />
+ <item android:id="@+id/password_menu_item"
+ android:title="@string/password_menu_item" />
+ <item android:id="@+id/pattern_menu_item"
+ android:title="@string/pattern_menu_item" />
+ <item android:id="@+id/sim_pin_menu_item"
+ android:title="@string/sim_pin_menu_item" />
+ <item android:id="@+id/sim_puk_menu_item"
+ android:title="@string/sim_puk_menu_item" />
+ <item android:id="@+id/add_widget_item"
+ android:title="@string/add_widget_item" />
+</menu>
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-land/alias.xml
similarity index 88%
rename from core/res/res/values-land/alias.xml
rename to packages/Keyguard/res/values-land/alias.xml
index eac5ece..7aac5b4 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-land/alias.xml
@@ -19,5 +19,5 @@
-->
<resources>
<!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
+ <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area_empty</item>
</resources>
diff --git a/packages/Keyguard/res/values-land/arrays.xml b/packages/Keyguard/res/values-land/arrays.xml
new file mode 100644
index 0000000..240b9e4
--- /dev/null
+++ b/packages/Keyguard/res/values-land/arrays.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Resources for GlowPadView in LockScreen -->
+ <array name="lockscreen_targets_when_silent">
+ <item>@null</item>"
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_soundon</item>
+ <item>@drawable/ic_lockscreen_unlock</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_silent">
+ <item>@null</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_soundon</item>
+ <item>@string/description_target_unlock</item>
+ </array>
+
+ <array name="lockscreen_direction_descriptions">
+ <item>@null</item>
+ <item>@string/description_direction_up</item>
+ <item>@string/description_direction_left</item>
+ <item>@string/description_direction_down</item>
+ </array>
+
+ <array name="lockscreen_targets_when_soundon">
+ <item>@null</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_silent</item>
+ <item>@drawable/ic_lockscreen_unlock</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_soundon">
+ <item>@null</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_silent</item>
+ <item>@string/description_target_unlock</item>
+ </array>
+
+ <array name="lockscreen_targets_with_camera">
+ <item>@null</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_camera</item>
+ <item>@drawable/ic_lockscreen_unlock</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_with_camera">
+ <item>@null</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_camera</item>
+ <item>@string/description_target_unlock</item>
+ </array>
+
+</resources>
diff --git a/core/res/res/anim/keyguard_security_fade_out.xml b/packages/Keyguard/res/values-land/bools.xml
similarity index 70%
copy from core/res/res/anim/keyguard_security_fade_out.xml
copy to packages/Keyguard/res/values-land/bools.xml
index 4ab0229..a1dd2e4 100644
--- a/core/res/res/anim/keyguard_security_fade_out.xml
+++ b/packages/Keyguard/res/values-land/bools.xml
@@ -13,9 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:interpolator/accelerate_quad"
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:duration="@*android:integer/kg_security_fade_duration"
-/>
+
+<resources>
+ <bool name="kg_enable_camera_default_widget">false</bool>
+ <bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
+ <bool name="kg_share_status_area">false</bool>
+ <bool name="kg_sim_puk_account_full_screen">false</bool>
+</resources>
diff --git a/packages/Keyguard/res/values-land/dimens.xml b/packages/Keyguard/res/values-land/dimens.xml
new file mode 100644
index 0000000..64e043c
--- /dev/null
+++ b/packages/Keyguard/res/values-land/dimens.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, 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.
+*/
+-->
+
+<resources>
+ <!-- Default height of a key in the password keyboard for alpha -->
+ <dimen name="password_keyboard_key_height_alpha">47dip</dimen>
+ <!-- Default height of a key in the password keyboard for numeric -->
+ <dimen name="password_keyboard_key_height_numeric">50dip</dimen>
+ <!-- Default correction for the space key in the password keyboard -->
+ <dimen name="password_keyboard_spacebar_vertical_correction">2dip</dimen>
+ <dimen name="preference_widget_width">72dp</dimen>
+
+ <!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
+ <dimen name="keyguard_lockscreen_clock_font_size">70sp</dimen>
+
+ <!-- Shift emergency button from the left edge by this amount. Used by landscape layout on
+ phones -->
+ <dimen name="kg_emergency_button_shift">30dp</dimen>
+
+ <!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
+ <dimen name="kg_secure_padding_height">0dp</dimen>
+
+ <!-- Top padding for the widget pager -->
+ <dimen name="kg_widget_pager_top_padding">0dp</dimen>
+
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">0dp</dimen>
+
+ <!-- If the height if keyguard drops below this threshold (most likely
+ due to the appearance of the IME), then drop the multiuser selector.
+ Landscape's layout allows this to be smaller than for portrait. -->
+ <dimen name="kg_squashed_layout_threshold">400dp</dimen>
+
+</resources>
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-land/integers.xml
similarity index 65%
copy from core/res/res/values-land/alias.xml
copy to packages/Keyguard/res/values-land/integers.xml
index eac5ece..020fd23 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-land/integers.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/* //device/apps/common/assets/res/any/colors.xml
-**
+/*
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +17,10 @@
*/
-->
<resources>
- <!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
+ <!-- Gravity to make KeyguardSelectorView work in multiple orientations
+ 0x13 == "left|center_vertical" -->
+ <integer name="kg_selector_gravity">0x13</integer>
+ <integer name="kg_widget_region_weight">45</integer>
+ <integer name="kg_security_flipper_weight">55</integer>
+ <integer name="kg_glowpad_rotation_offset">-90</integer>
</resources>
diff --git a/packages/Keyguard/res/values-large/dimens.xml b/packages/Keyguard/res/values-large/dimens.xml
new file mode 100644
index 0000000..8cd614d
--- /dev/null
+++ b/packages/Keyguard/res/values-large/dimens.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2011, 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.
+*/
+-->
+<resources>
+ <!-- Default height of a key in the password keyboard for alpha -->
+ <dimen name="password_keyboard_key_height_alpha">75dip</dimen>
+ <!-- Default height of a key in the password keyboard for numeric -->
+ <dimen name="password_keyboard_key_height_numeric">75dip</dimen>
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <dimen name="password_keyboard_height">48.0mm</dimen>
+
+ <!-- Minimum width of the search view text entry area. -->
+ <dimen name="search_view_text_min_width">192dip</dimen>
+
+ <item type="dimen" name="dialog_min_width_major">55%</item>
+ <item type="dimen" name="dialog_min_width_minor">80%</item>
+
+ <!-- Preference UI dimensions for larger screens. -->
+ <dimen name="preference_widget_width">56dp</dimen>
+</resources>
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-port/alias.xml
similarity index 88%
copy from core/res/res/values-land/alias.xml
copy to packages/Keyguard/res/values-port/alias.xml
index eac5ece..c3ecbb9 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-port/alias.xml
@@ -19,5 +19,5 @@
-->
<resources>
<!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
+ <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area</item>
</resources>
diff --git a/core/res/res/anim/keyguard_security_fade_out.xml b/packages/Keyguard/res/values-port/bools.xml
similarity index 71%
copy from core/res/res/anim/keyguard_security_fade_out.xml
copy to packages/Keyguard/res/values-port/bools.xml
index 4ab0229..1e2a4f2 100644
--- a/core/res/res/anim/keyguard_security_fade_out.xml
+++ b/packages/Keyguard/res/values-port/bools.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:interpolator/accelerate_quad"
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:duration="@*android:integer/kg_security_fade_duration"
-/>
+
+<resources>
+ <bool name="action_bar_embed_tabs">false</bool>
+ <bool name="kg_share_status_area">true</bool>
+ <bool name="kg_sim_puk_account_full_screen">true</bool>
+</resources>
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-port/integers.xml
similarity index 75%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-port/integers.xml
index 2e6fa37..ef7e4da 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-port/integers.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
+/*
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +16,8 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <!-- Gravity to make KeyguardSelectorView work in multiple orientations
+ 0x31 == "top|center_horizontal" -->
+ <integer name="kg_selector_gravity">0x31</integer>
+</resources>
\ No newline at end of file
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw380dp-land/dimens.xml
similarity index 78%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-sw380dp-land/dimens.xml
index 2e6fa37..20eb1be 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw380dp-land/dimens.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
+/* //device/apps/common/assets/res/any/dimens.xml
**
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +17,7 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">48dp</dimen>
+</resources>
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw380dp/dimens.xml
similarity index 77%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-sw380dp/dimens.xml
index 2e6fa37..fc0e85d 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw380dp/dimens.xml
@@ -16,6 +16,8 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+
+<resources>
+ <!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
+ <dimen name="keyguard_security_width">340dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/packages/Keyguard/res/values-sw600dp-land/arrays.xml b/packages/Keyguard/res/values-sw600dp-land/arrays.xml
new file mode 100644
index 0000000..5550216
--- /dev/null
+++ b/packages/Keyguard/res/values-sw600dp-land/arrays.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Resources for GlowPadView in LockScreen -->
+ <array name="lockscreen_targets_when_silent">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@null</item>
+ <item>@drawable/ic_lockscreen_soundon</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_silent">
+ <item>@string/description_target_unlock</item>
+ <item>@null</item>
+ <item>@string/description_target_soundon</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_direction_descriptions">
+ <item>@string/description_direction_right</item>
+ <item>@null</item>
+ <item>@string/description_direction_left</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_targets_when_soundon">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@null</item>
+ <item>@drawable/ic_lockscreen_silent</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_soundon">
+ <item>@string/description_target_unlock</item>
+ <item>@null</item>
+ <item>@string/description_target_silent</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_targets_with_camera">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_camera</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_with_camera">
+ <item>@string/description_target_unlock</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_camera</item>
+ <item>@null</item>
+ </array>
+
+</resources>
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-sw600dp-land/dimens.xml
similarity index 65%
copy from core/res/res/values-land/alias.xml
copy to packages/Keyguard/res/values-sw600dp-land/dimens.xml
index eac5ece..5507e5f 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-sw600dp-land/dimens.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/* //device/apps/common/assets/res/any/colors.xml
+/* //device/apps/common/assets/res/any/dimens.xml
**
-** Copyright 2012, The Android Open Source Project
+** Copyright 2006, 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.
@@ -18,6 +18,9 @@
*/
-->
<resources>
- <!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
-</resources>
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">85dp</dimen>
+
+ <!-- Size of margin on the right of keyguard's status view -->
+ <dimen name="kg_status_line_font_right_margin">16dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw600dp-land/integers.xml
similarity index 75%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-sw600dp-land/integers.xml
index 2e6fa37..b724c90 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw600dp-land/integers.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
+/*
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +16,8 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <integer name="kg_widget_region_weight">50</integer>
+ <integer name="kg_security_flipper_weight">50</integer>
+ <integer name="kg_glowpad_rotation_offset">0</integer>
+</resources>
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw600dp-port/integers.xml
similarity index 80%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-sw600dp-port/integers.xml
index 2e6fa37..65b854a 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw600dp-port/integers.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
+/*
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +16,7 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <integer name="kg_widget_region_weight">46</integer>
+ <integer name="kg_security_flipper_weight">54</integer>
+</resources>
\ No newline at end of file
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-sw600dp/alias.xml
similarity index 88%
copy from core/res/res/values-land/alias.xml
copy to packages/Keyguard/res/values-sw600dp/alias.xml
index eac5ece..c3ecbb9 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-sw600dp/alias.xml
@@ -19,5 +19,5 @@
-->
<resources>
<!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
+ <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area</item>
</resources>
diff --git a/packages/Keyguard/res/values-sw600dp/bools.xml b/packages/Keyguard/res/values-sw600dp/bools.xml
new file mode 100644
index 0000000..ddc48c5
--- /dev/null
+++ b/packages/Keyguard/res/values-sw600dp/bools.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<resources>
+ <bool name="target_honeycomb_needs_options_menu">false</bool>
+ <bool name="show_ongoing_ime_switcher">true</bool>
+ <bool name="kg_share_status_area">false</bool>
+ <bool name="kg_sim_puk_account_full_screen">false</bool>
+ <bool name="kg_show_ime_at_screen_on">false</bool>
+ <!-- No camera for you, tablet user -->
+ <bool name="kg_enable_camera_default_widget">false</bool>
+ <bool name="kg_center_small_widgets_vertically">true</bool>
+ <bool name="kg_top_align_page_shrink_on_bouncer_visible">false</bool>
+</resources>
diff --git a/packages/Keyguard/res/values-sw600dp/dimens.xml b/packages/Keyguard/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..c0e3937
--- /dev/null
+++ b/packages/Keyguard/res/values-sw600dp/dimens.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/dimens.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources>
+ <!-- Size of clock font in LockScreen. -->
+ <dimen name="keyguard_pattern_unlock_clock_font_size">112sp</dimen>
+
+ <!-- Size of lockscreen outerring on unsecure unlock LockScreen -->
+ <dimen name="keyguard_lockscreen_outerring_diameter">364dp</dimen>
+
+ <!-- Height of FaceUnlock view in keyguard -->
+ <dimen name="face_unlock_height">430dip</dimen>
+
+ <!-- target placement radius for GlowPadView. Should be 1/2 of outerring diameter. -->
+ <dimen name="glowpadview_target_placement_radius">182dip</dimen>
+
+ <!-- Size of status line font in LockScreen. -->
+ <dimen name="keyguard_pattern_unlock_status_line_font_size">14sp</dimen>
+
+ <!-- Keyguard dimensions -->
+ <!-- Size of the clock font in keyguard's status view -->
+ <dimen name="kg_status_clock_font_size">141dp</dimen>
+
+ <!-- Size of the date font in keyguard's status view -->
+ <dimen name="kg_status_date_font_size">25.5dp</dimen>
+
+ <!-- Size of the generic status lines keyguard's status view -->
+ <dimen name="kg_status_line_font_size">16sp</dimen>
+
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">0dp</dimen>
+
+ <!-- Size of margin on the right of keyguard's status view -->
+ <dimen name="kg_status_line_font_right_margin">50dp</dimen>
+
+ <!-- Horizontal padding for the widget pager -->
+ <dimen name="kg_widget_pager_horizontal_padding">24dp</dimen>
+
+ <!-- Top padding for the widget pager -->
+ <dimen name="kg_widget_pager_top_padding">0dp</dimen>
+
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">0dp</dimen>
+
+ <!-- Top margin for the runway lights. We add a negative margin in large
+ devices to account for the widget pager padding -->
+ <dimen name="kg_runway_lights_top_margin">-10dp</dimen>
+
+ <!-- Margin around the various security views -->
+ <dimen name="keyguard_security_view_margin">12dp</dimen>
+
+ <!-- Margin around the various security views -->
+ <dimen name="keyguard_muliuser_selector_margin">12dp</dimen>
+
+</resources>
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw600dp/integers.xml
similarity index 82%
rename from core/res/res/layout-sw600dp/keyguard_navigation.xml
rename to packages/Keyguard/res/values-sw600dp/integers.xml
index 2e6fa37..de9829c 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw600dp/integers.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
+/*
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +16,6 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <integer name="kg_carousel_angle">60</integer>
+</resources>
diff --git a/core/res/res/values-land/alias.xml b/packages/Keyguard/res/values-sw720dp-land/dimens.xml
similarity index 62%
copy from core/res/res/values-land/alias.xml
copy to packages/Keyguard/res/values-sw720dp-land/dimens.xml
index eac5ece..14726ab 100644
--- a/core/res/res/values-land/alias.xml
+++ b/packages/Keyguard/res/values-sw720dp-land/dimens.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/* //device/apps/common/assets/res/any/colors.xml
+/* //device/apps/common/assets/res/any/dimens.xml
**
** Copyright 2012, The Android Open Source Project
**
@@ -18,6 +18,12 @@
*/
-->
<resources>
- <!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area_empty</item>
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">174dp</dimen>
+
+ <!-- Size of margin on the right of keyguard's status view -->
+ <dimen name="kg_status_line_font_right_margin">16dp</dimen>
+
+ <!-- Horizontal padding for the widget pager -->
+ <dimen name="kg_widget_pager_horizontal_padding">32dp</dimen>
</resources>
diff --git a/core/res/res/layout-sw600dp/keyguard_navigation.xml b/packages/Keyguard/res/values-sw720dp-port/integers.xml
similarity index 80%
copy from core/res/res/layout-sw600dp/keyguard_navigation.xml
copy to packages/Keyguard/res/values-sw720dp-port/integers.xml
index 2e6fa37..5f85f71 100644
--- a/core/res/res/layout-sw600dp/keyguard_navigation.xml
+++ b/packages/Keyguard/res/values-sw720dp-port/integers.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
+/*
** Copyright 2012, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License")
+** 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
**
@@ -16,6 +16,7 @@
** limitations under the License.
*/
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include layout="@layout/default_navigation" />
-</merge>
+<resources>
+ <integer name="kg_widget_region_weight">48</integer>
+ <integer name="kg_security_flipper_weight">52</integer>
+</resources>
\ No newline at end of file
diff --git a/packages/Keyguard/res/values-sw720dp/dimens.xml b/packages/Keyguard/res/values-sw720dp/dimens.xml
new file mode 100644
index 0000000..b29ac22
--- /dev/null
+++ b/packages/Keyguard/res/values-sw720dp/dimens.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, 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.
+*/
+-->
+<resources>
+ <!-- Keyguard dimensions -->
+ <!-- Size of the clock font in keyguard's status view -->
+ <dimen name="kg_status_clock_font_size">188dp</dimen>
+
+ <!-- Size of the date font in keyguard's status view -->
+ <dimen name="kg_status_date_font_size">34dp</dimen>
+
+ <!-- Size of the generic status lines keyguard's status view -->
+ <dimen name="kg_status_line_font_size">19sp</dimen>
+
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">0dp</dimen>
+
+ <!-- Size of margin on the right of keyguard's status view -->
+ <dimen name="kg_status_line_font_right_margin">32dp</dimen>
+
+ <!-- Horizontal padding for the widget pager -->
+ <dimen name="kg_widget_pager_horizontal_padding">80dp</dimen>
+
+ <!-- Top padding for the widget pager -->
+ <dimen name="kg_widget_pager_top_padding">0dp</dimen>
+
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">0dp</dimen>
+
+ <!-- Top margin for the runway lights. We add a negative margin in large
+ devices to account for the widget pager padding -->
+ <dimen name="kg_runway_lights_top_margin">-30dp</dimen>
+
+ <!-- Margin around the various security views -->
+ <dimen name="keyguard_muliuser_selector_margin">24dp</dimen>
+
+ <!-- Stroke width of the frame for the circular avatars. -->
+ <dimen name="keyguard_avatar_frame_stroke_width">3dp</dimen>
+
+ <!-- Size of the avator on the multiuser lockscreen. -->
+ <dimen name="keyguard_avatar_size">88dp</dimen>
+
+ <!-- Size of the text under the avator on the multiuser lockscreen. -->
+ <dimen name="keyguard_avatar_name_size">12sp</dimen>
+
+ <!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
+ <dimen name="keyguard_security_width">420dp</dimen>
+
+ <!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
+ <dimen name="keyguard_security_height">420dp</dimen>
+</resources>
diff --git a/packages/Keyguard/res/values-xlarge/dimens.xml b/packages/Keyguard/res/values-xlarge/dimens.xml
new file mode 100644
index 0000000..b8cf287
--- /dev/null
+++ b/packages/Keyguard/res/values-xlarge/dimens.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/dimens.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources>
+ <!-- Default height of a key in the password keyboard for alpha -->
+ <dimen name="password_keyboard_key_height_alpha">75dip</dimen>
+ <!-- Default height of a key in the password keyboard for numeric -->
+ <dimen name="password_keyboard_key_height_numeric">75dip</dimen>
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <dimen name="password_keyboard_height">48.0mm</dimen>
+</resources>
diff --git a/packages/Keyguard/res/values/activitystrings.xml b/packages/Keyguard/res/values/activitystrings.xml
new file mode 100644
index 0000000..5af9dea
--- /dev/null
+++ b/packages/Keyguard/res/values/activitystrings.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="app_name">KeyguardTestActivity</string>
+ <string name="secure_app_name">UnifiedCamera</string>
+ <string name="none_menu_item">No security</string>
+ <string name="pin_menu_item">PIN</string>
+ <string name="password_menu_item">Password</string>
+ <string name="pattern_menu_item">Pattern</string>
+ <string name="sim_pin_menu_item">SIM PIN</string>
+ <string name="sim_puk_menu_item">SIM PUK</string>
+ <string name="add_widget_item">Choose widget...</string>
+ <string name="on_screen_turned_off">onScreenTurnedOff</string>
+ <string name="on_screen_turned_on">onScreenTurnedOn</string>
+ <string name="do_keyguard">doKeyguard</string>
+ <string name="verify_unlock">verifyUnlock</string>
+</resources>
diff --git a/packages/Keyguard/res/values/alias.xml b/packages/Keyguard/res/values/alias.xml
new file mode 100644
index 0000000..47291b2
--- /dev/null
+++ b/packages/Keyguard/res/values/alias.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2013, 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.
+*/
+-->
+<resources>
+
+ <!-- Alias used to reference framework color for transparency. -->
+ <item type="color" name="transparent">@android:color/transparent</item>
+
+ <!-- Alias used to reference framework drawable in keyguard. -->
+ <item type="drawable" name="stat_sys_warning">@android:drawable/stat_sys_warning</item>
+
+ <!-- Alias used to reference framework drawable in keyguard. -->
+ <item type="drawable" name="ic_media_pause">@android:drawable/ic_media_pause</item>
+
+ <!-- Alias used to reference framework drawable in keyguard. -->
+ <item type="drawable" name="ic_media_stop">@*android:drawable/ic_media_stop</item>
+
+ <!-- Alias used to reference framework drawable in keyguard. -->
+ <item type="drawable" name="ic_contact_picture">@*android:drawable/ic_contact_picture</item>
+
+ <!-- Alias used to reference framework drawable in keyguard. -->
+ <item type="drawable" name="ic_lock_idle_alarm">@*android:drawable/ic_lock_idle_alarm</item>
+
+ <!-- Alias used to reference framework "OK" string in keyguard. -->
+ <item type="string" name="ok">@*android:string/ok</item>
+
+ <!-- Alias used to reference framework "OK" string in keyguard. -->
+ <item type="string" name="system_ui_date_pattern">@*android:string/system_ui_date_pattern</item>
+
+ <!-- Alias used to reference framework configuration for screen rotation. -->
+ <item type="bool" name="config_enableLockScreenRotation">@*android:bool/config_enableLockScreenRotation</item>
+
+ <!-- Alias used to reference framework activity duration. -->
+ <item type="integer" name="config_activityDefaultDur">@*android:integer/config_activityDefaultDur</item>
+
+</resources>
\ No newline at end of file
diff --git a/packages/Keyguard/res/values/arrays.xml b/packages/Keyguard/res/values/arrays.xml
new file mode 100644
index 0000000..550f80c
--- /dev/null
+++ b/packages/Keyguard/res/values/arrays.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Resources for GlowPadView in LockScreen -->
+ <array name="lockscreen_targets_when_silent">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_soundon</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_silent">
+ <item>@string/description_target_unlock</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_soundon</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_direction_descriptions">
+ <item>@string/description_direction_right</item>
+ <item>@string/description_direction_up</item>
+ <item>@string/description_direction_left</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_targets_when_soundon">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_silent</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_when_soundon">
+ <item>@string/description_target_unlock</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_silent</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_targets_with_camera">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ <item>@drawable/ic_action_assist_generic</item>
+ <item>@drawable/ic_lockscreen_camera</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_with_camera">
+ <item>@string/description_target_unlock</item>
+ <item>@string/description_target_search</item>
+ <item>@string/description_target_camera</item>
+ <item>@null</item>
+ </array>
+
+ <array name="lockscreen_targets_unlock_only">
+ <item>@drawable/ic_lockscreen_unlock</item>
+ </array>
+
+ <array name="lockscreen_target_descriptions_unlock_only">
+ <item>@string/description_target_unlock</item>
+ </array>
+
+ <!-- list of 3- or 4-letter mnemonics for a 10-key numeric keypad -->
+ <string-array translatable="false" name="lockscreen_num_pad_klondike">
+ <item></item><!-- 0 -->
+ <item></item><!-- 1 -->
+ <item>ABC</item><!-- 2 -->
+ <item>DEF</item><!-- 3 -->
+ <item>GHI</item><!-- 4 -->
+ <item>JKL</item><!-- 5 -->
+ <item>MNO</item><!-- 6 -->
+ <item>PQRS</item><!-- 7 -->
+ <item>TUV</item><!-- 8 -->
+ <item>WXYZ</item><!-- 9 -->
+ </string-array>
+</resources>
diff --git a/packages/Keyguard/res/values/attrs.xml b/packages/Keyguard/res/values/attrs.xml
new file mode 100644
index 0000000..e045dd2
--- /dev/null
+++ b/packages/Keyguard/res/values/attrs.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 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.
+-->
+
+<!-- Formatting note: terminate all comments with a period, to avoid breaking
+ the documentation output. To suppress comment lines from the documentation
+ output, insert an eat-comment element after the comment lines.
+-->
+
+<resources>
+ <!-- Standard gravity constant that a child supplies to its parent.
+ Defines how the child view should be positioned, on both the X and Y axes, within its enclosing layout. -->
+ <attr name="layout_gravity">
+ <!-- Push object to the top of its container, not changing its size. -->
+ <flag name="top" value="0x30" />
+ <!-- Push object to the bottom of its container, not changing its size. -->
+ <flag name="bottom" value="0x50" />
+ <!-- Push object to the left of its container, not changing its size. -->
+ <flag name="left" value="0x03" />
+ <!-- Push object to the right of its container, not changing its size. -->
+ <flag name="right" value="0x05" />
+ <!-- Place object in the vertical center of its container, not changing its size. -->
+ <flag name="center_vertical" value="0x10" />
+ <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
+ <flag name="fill_vertical" value="0x70" />
+ <!-- Place object in the horizontal center of its container, not changing its size. -->
+ <flag name="center_horizontal" value="0x01" />
+ <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
+ <flag name="fill_horizontal" value="0x07" />
+ <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
+ <flag name="center" value="0x11" />
+ <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
+ <flag name="fill" value="0x77" />
+ <!-- Additional option that can be set to have the top and/or bottom edges of
+ the child clipped to its container's bounds.
+ The clip will be based on the vertical gravity: a top gravity will clip the bottom
+ edge, a bottom gravity will clip the top edge, and neither will clip both edges. -->
+ <flag name="clip_vertical" value="0x80" />
+ <!-- Additional option that can be set to have the left and/or right edges of
+ the child clipped to its container's bounds.
+ The clip will be based on the horizontal gravity: a left gravity will clip the right
+ edge, a right gravity will clip the left edge, and neither will clip both edges. -->
+ <flag name="clip_horizontal" value="0x08" />
+ <!-- Push object to the beginning of its container, not changing its size. -->
+ <flag name="start" value="0x00800003" />
+ <!-- Push object to the end of its container, not changing its size. -->
+ <flag name="end" value="0x00800005" />
+ </attr>
+
+
+ <!-- PagedView specific attributes. These attributes are used to customize
+ a PagedView view in XML files. -->
+ <declare-styleable name="PagedView">
+ <!-- The space between adjacent pages of the PagedView. -->
+ <attr name="pageSpacing" format="dimension" />
+ <!-- The padding for the scroll indicator area -->
+ <attr name="scrollIndicatorPaddingLeft" format="dimension" />
+ <attr name="scrollIndicatorPaddingRight" format="dimension" />
+ </declare-styleable>
+
+ <declare-styleable name="KeyguardGlowStripView">
+ <attr name="dotSize" format="dimension" />
+ <attr name="numDots" format="integer" />
+ <attr name="glowDot" format="reference" />
+ <attr name="leftToRight" format="boolean" />
+ </declare-styleable>
+
+ <!-- Some child types have special behavior. -->
+ <attr name="layout_childType">
+ <!-- No special behavior. Layout will proceed as normal. -->
+ <enum name="none" value="0" />
+ <!-- Widget container.
+ This will be resized in response to certain events. -->
+ <enum name="widget" value="1" />
+ <!-- Security challenge container.
+ This will be dismissed/shown in response to certain events,
+ possibly obscuring widget elements. -->
+ <enum name="challenge" value="2" />
+ <!-- User switcher.
+ This will consume space from the total layout area. -->
+ <enum name="userSwitcher" value="3" />
+ <!-- Scrim. This will block access to child views that
+ come before it in the child list in bouncer mode. -->
+ <enum name="scrim" value="4" />
+ <!-- The home for widgets. All widgets will be descendents of this. -->
+ <enum name="widgets" value="5" />
+ <!-- This is a handle that is used for expanding the
+ security challenge container when it is collapsed. -->
+ <enum name="expandChallengeHandle" value="6" />
+ <!-- Delete drop target. This will be the drop target to delete pages. -->
+ <enum name="pageDeleteDropTarget" value="7" />
+ </attr>
+
+ <declare-styleable name="SlidingChallengeLayout_Layout">
+ <attr name="layout_childType" />
+ <attr name="layout_maxHeight" format="dimension" />
+ </declare-styleable>
+
+ <declare-styleable name="MultiPaneChallengeLayout">
+ <!-- Influences how layout_centerWithinArea behaves -->
+ <attr name="android:orientation" />
+ </declare-styleable>
+
+ <declare-styleable name="MultiPaneChallengeLayout_Layout">
+ <!-- Percentage of the screen this child should consume or center within.
+ If 0/default, the view will be measured by standard rules
+ as if this were a FrameLayout. -->
+ <attr name="layout_centerWithinArea" format="float" />
+ <attr name="layout_childType" />
+ <attr name="layout_gravity" />
+ <attr name="layout_maxWidth" format="dimension" />
+ <attr name="layout_maxHeight" />
+ </declare-styleable>
+
+ <declare-styleable name="KeyguardSecurityViewFlipper_Layout">
+ <attr name="layout_maxWidth" />
+ <attr name="layout_maxHeight" />
+ </declare-styleable>
+
+ <declare-styleable name="NumPadKey">
+ <attr name="digit" format="integer" />
+ <attr name="textView" format="reference" />
+ </declare-styleable>
+</resources>
diff --git a/core/res/res/anim/keyguard_security_fade_out.xml b/packages/Keyguard/res/values/bools.xml
similarity index 64%
copy from core/res/res/anim/keyguard_security_fade_out.xml
copy to packages/Keyguard/res/values/bools.xml
index 4ab0229..a9f69e5 100644
--- a/core/res/res/anim/keyguard_security_fade_out.xml
+++ b/packages/Keyguard/res/values/bools.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
+<!-- Copyright (C) 2011 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.
@@ -13,9 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:interpolator/accelerate_quad"
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:duration="@*android:integer/kg_security_fade_duration"
-/>
+
+<resources>
+ <bool name="kg_enable_camera_default_widget">true</bool>
+ <bool name="kg_center_small_widgets_vertically">false</bool>
+ <bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
+ <bool name="kg_show_ime_at_screen_on">true</bool>
+</resources>
diff --git a/packages/Keyguard/res/values/colors.xml b/packages/Keyguard/res/values/colors.xml
new file mode 100644
index 0000000..0c56a43
--- /dev/null
+++ b/packages/Keyguard/res/values/colors.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+<resources>
+ <!-- Keyguard colors -->
+ <color name="keyguard_avatar_frame_color">#ffffffff</color>
+ <color name="keyguard_avatar_frame_shadow_color">#80000000</color>
+ <color name="keyguard_avatar_nick_color">#ffffffff</color>
+ <color name="keyguard_avatar_frame_pressed_color">#ff35b5e5</color>
+ <color name="kg_widget_pager_gradient">#ffffffff</color>
+
+ <!-- FaceLock -->
+ <color name="facelock_spotlight_mask">#CC000000</color>
+</resources>
diff --git a/packages/Keyguard/res/values/config.xml b/packages/Keyguard/res/values/config.xml
new file mode 100644
index 0000000..de17c4b
--- /dev/null
+++ b/packages/Keyguard/res/values/config.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, 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.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Package name for default keyguard appwidget [DO NOT TRANSLATE] -->
+ <string name="widget_default_package_name"></string>
+
+ <!-- Class name for default keyguard appwidget [DO NOT TRANSLATE] -->
+ <string name="widget_default_class_name"></string>
+
+ <!-- Allow the menu hard key to be disabled in LockScreen on some devices [DO NOT TRANSLATE] -->
+ <bool name="config_disableMenuKeyInLockScreen">false</bool>
+
+</resources>
diff --git a/packages/Keyguard/res/values/dimens.xml b/packages/Keyguard/res/values/dimens.xml
new file mode 100644
index 0000000..fde63c4
--- /dev/null
+++ b/packages/Keyguard/res/values/dimens.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/dimens.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources>
+ <!-- Default height of a key in the password keyboard for alpha (used by keyguard) -->
+ <dimen name="password_keyboard_key_height_alpha">56dip</dimen>
+ <!-- Default height of a key in the password keyboard for numeric (used by keyguard) -->
+ <dimen name="password_keyboard_key_height_numeric">56dip</dimen>
+ <!-- Default correction for the space key in the password keyboard (used by keyguard) -->
+ <dimen name="password_keyboard_spacebar_vertical_correction">4dip</dimen>
+ <!-- Default horizontal gap between keys in the password keyboard (used by keyguard) -->
+ <dimen name="password_keyboard_horizontalGap">3dip</dimen>
+ <!-- Default vertical gap between keys in the password keyboard (used by keyguard) -->
+ <dimen name="password_keyboard_verticalGap">9dip</dimen>
+
+ <!-- Size of lockscreen outerring on unsecure unlock LockScreen -->
+ <dimen name="keyguard_lockscreen_outerring_diameter">270dp</dimen>
+
+ <!-- Default target placement radius for GlowPadView. Should be 1/2 of outerring diameter. -->
+ <dimen name="glowpadview_target_placement_radius">135dip</dimen>
+
+ <!-- Default glow radius for GlowPadView -->
+ <dimen name="glowpadview_glow_radius">75dip</dimen>
+
+ <!-- Default distance beyond which GlowPadView snaps to the matching target -->
+ <dimen name="glowpadview_snap_margin">40dip</dimen>
+
+ <!-- Default distance from each snap target that GlowPadView considers a "hit" -->
+ <dimen name="glowpadview_inner_radius">15dip</dimen>
+
+ <!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
+ <dimen name="keyguard_lockscreen_clock_font_size">80dip</dimen>
+
+ <!-- Size of status line font on Unsecure unlock LockScreen. -->
+ <dimen name="keyguard_lockscreen_status_line_font_size">14dip</dimen>
+
+ <!-- Size of right margin on Unsecure unlock LockScreen -->
+ <dimen name="keyguard_lockscreen_status_line_font_right_margin">42dip</dimen>
+
+ <!-- Size of top margin on Clock font to edge on unlock LockScreen -->
+ <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">22dip</dimen>
+
+ <!-- Size of top margin on Clock font to edge on unlock LockScreen -->
+ <dimen name="keyguard_lockscreen_status_line_clockfont_bottom_margin">12dip</dimen>
+
+ <!-- Padding on left margin of PIN text entry field to center it when del button is showing -->
+ <dimen name="keyguard_lockscreen_pin_margin_left">40dip</dimen>
+
+ <!-- Height of FaceUnlock view in keyguard -->
+ <dimen name="face_unlock_height">330dip</dimen>
+
+ <!-- Keyguard dimensions -->
+ <!-- TEMP -->
+ <dimen name="kg_security_panel_height">600dp</dimen>
+
+ <!-- Height of security view in keyguard. -->
+ <dimen name="kg_security_view_height">480dp</dimen>
+
+ <!-- Width of widget view in keyguard. -->
+ <dimen name="kg_widget_view_width">0dp</dimen>
+
+ <!-- Height of widget view in keyguard. -->
+ <dimen name="kg_widget_view_height">0dp</dimen>
+
+ <!-- Size of the clock font in keyguard's status view -->
+ <dimen name="kg_status_clock_font_size">75dp</dimen>
+
+ <!-- Size of the date font in keyguard's status view -->
+ <dimen name="kg_status_date_font_size">15dp</dimen>
+
+ <!-- Size of the generic status lines keyguard's status view -->
+ <dimen name="kg_status_line_font_size">13dp</dimen>
+
+ <!-- Size of margin on the right of keyguard's status view -->
+ <dimen name="kg_status_line_font_right_margin">16dp</dimen>
+
+ <!-- Top margin for the clock view -->
+ <dimen name="kg_clock_top_margin">-16dp</dimen>
+
+ <!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
+ <dimen name="kg_key_horizontal_gap">0dp</dimen>
+
+ <!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
+ <dimen name="kg_key_vertical_gap">0dp</dimen>
+
+ <!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
+ <dimen name="kg_pin_key_height">60dp</dimen>
+
+ <!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
+ <dimen name="kg_secure_padding_height">46dp</dimen>
+
+ <!-- The height of the runway lights strip -->
+ <dimen name="kg_runway_lights_height">7dp</dimen>
+
+ <!-- The height of the runway lights strip -->
+ <dimen name="kg_runway_lights_vertical_padding">2dp</dimen>
+
+ <!-- Horizontal padding for the widget pager -->
+ <dimen name="kg_widget_pager_horizontal_padding">16dp</dimen>
+
+ <!-- Top padding for the widget pager -->
+ <dimen name="kg_widget_pager_top_padding">0dp</dimen>
+
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">64dp</dimen>
+
+ <!-- Top margin for the runway lights. We add a negative margin in large
+ devices to account for the widget pager padding -->
+ <dimen name="kg_runway_lights_top_margin">0dp</dimen>
+
+ <!-- Touch slop for the global toggle accessibility gesture -->
+ <dimen name="accessibility_touch_slop">80dip</dimen>
+
+ <!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
+ <dimen name="keyguard_security_width">320dp</dimen>
+
+ <!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
+ <dimen name="keyguard_security_height">400dp</dimen>
+
+ <!-- Margin around the various security views -->
+ <dimen name="keyguard_security_view_margin">8dp</dimen>
+
+ <!-- Margin around the various security views -->
+ <dimen name="keyguard_muliuser_selector_margin">8dp</dimen>
+
+ <!-- Stroke width of the frame for the circular avatars. -->
+ <dimen name="keyguard_avatar_frame_stroke_width">2dp</dimen>
+
+ <!-- Shadow radius under the frame for the circular avatars. -->
+ <dimen name="keyguard_avatar_frame_shadow_radius">1dp</dimen>
+
+ <!-- Size of the avator on hte multiuser lockscreen. -->
+ <dimen name="keyguard_avatar_size">66dp</dimen>
+
+ <!-- Size of the text under the avator on the multiuser lockscreen. -->
+ <dimen name="keyguard_avatar_name_size">10sp</dimen>
+
+ <!-- Size of the region along the edge of the screen that will accept
+ swipes to scroll the widget area. -->
+ <dimen name="kg_edge_swipe_region_size">24dp</dimen>
+
+ <!-- If the height if keyguard drops below this threshold (most likely
+ due to the appearance of the IME), then drop the multiuser selector. -->
+ <dimen name="kg_squashed_layout_threshold">600dp</dimen>
+
+ <!-- The height of widgets which do not support vertical resizing. This is only
+ used on tablets; on phones, this size is determined by the space left by the
+ security mode. -->
+ <dimen name="kg_small_widget_height">160dp</dimen>
+
+</resources>
diff --git a/core/res/res/values-port/alias.xml b/packages/Keyguard/res/values/integers.xml
similarity index 74%
rename from core/res/res/values-port/alias.xml
rename to packages/Keyguard/res/values/integers.xml
index bf3eecb..053fc85 100644
--- a/core/res/res/values-port/alias.xml
+++ b/packages/Keyguard/res/values/integers.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/* //device/apps/common/assets/res/any/colors.xml
-**
+/*
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +17,8 @@
*/
-->
<resources>
- <!-- Alias used to reference one of two possible layouts in keyguard. -->
- <item type="layout" name="keyguard_eca">@android:layout/keyguard_emergency_carrier_area</item>
+ <integer name="kg_carousel_angle">75</integer>
+ <integer name="kg_security_flip_duration">100</integer>
+ <integer name="kg_security_fade_duration">100</integer>
+ <integer name="kg_glowpad_rotation_offset">0</integer>
</resources>
diff --git a/packages/Keyguard/res/values/strings.xml b/packages/Keyguard/res/values/strings.xml
new file mode 100644
index 0000000..5cf05f8
--- /dev/null
+++ b/packages/Keyguard/res/values/strings.xml
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Instructions telling the user to enter their SIM PIN to unlock the keyguard.
+ Displayed in one line in a large font. -->
+ <string name="keyguard_password_enter_pin_code">Type PIN code</string>
+
+ <!-- Instructions telling the user to enter their SIM PUK to unlock the keyguard.
+ Displayed in one line in a large font. -->
+ <string name="keyguard_password_enter_puk_code">Type PUK and new PIN code</string>
+
+ <!-- Prompt to enter SIM PUK in Edit Text Box in unlock screen -->
+ <string name="keyguard_password_enter_puk_prompt">PUK code</string>
+ <!-- Prompt to enter New SIM PIN in Edit Text Box in unlock screen -->
+ <string name="keyguard_password_enter_pin_prompt">New PIN code</string>
+
+ <!-- Displayed as hint in passwordEntry EditText on PasswordUnlockScreen [CHAR LIMIT=30]-->
+ <string name="keyguard_password_entry_touch_hint"><font size="17">Touch to type password</font></string>
+
+ <!-- Instructions telling the user to enter their text password to unlock the keyguard.
+ Displayed in one line in a large font. -->
+ <string name="keyguard_password_enter_password_code">Type password to unlock</string>
+
+ <!-- Instructions telling the user to enter their PIN password to unlock the keyguard.
+ Displayed in one line in a large font. -->
+ <string name="keyguard_password_enter_pin_password_code">Type PIN to unlock</string>
+
+ <!-- Instructions telling the user that they entered the wrong pin while trying
+ to unlock the keyguard. Displayed in one line in a large font. -->
+ <string name="keyguard_password_wrong_pin_code">Incorrect PIN code.</string>
+
+ <!-- Instructions telling the user how to unlock the phone. -->
+ <string name="keyguard_label_text">To unlock, press Menu then 0.</string>
+
+ <!-- Shown when face unlock failed multiple times so we're just using the backup -->
+ <string name="faceunlock_multiple_failures">Maximum Face Unlock attempts exceeded</string>
+
+ <!-- When the lock screen is showing, the phone is plugged in and the battery is fully
+ charged, say that it is charged. -->
+ <string name="keyguard_charged">Charged</string>
+
+ <!-- When the lock screen is showing and the phone plugged in, and the battery
+ is not fully charged, show the current charge %. -->
+ <string name="keyguard_plugged_in">Charging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string>
+
+ <!-- When the lock screen is showing and the battery is low, warn user to plug
+ in the phone soon. -->
+ <string name="keyguard_low_battery">Connect your charger.</string>
+
+ <!-- On the keyguard screen, when pattern lock is disabled, only tell them to press menu to unlock. This is shown in small font at the bottom. -->
+ <string name="keyguard_instructions_when_pattern_disabled">Press Menu to unlock.</string>
+
+ <!-- SIM messages --><skip />
+ <!-- When the user inserts a sim card from an unsupported network, it becomes network locked -->
+ <string name="keyguard_network_locked_message">Network locked</string>
+ <!-- Shown when there is no SIM card. -->
+ <string name="keyguard_missing_sim_message_short">No SIM card</string>
+ <!-- Shown when there is no SIM card. -->
+ <string name="keyguard_missing_sim_message" product="tablet">No SIM card in tablet.</string>
+ <!-- Shown when there is no SIM card. -->
+ <string name="keyguard_missing_sim_message" product="default">No SIM card in phone.</string>
+ <!-- Shown to ask the user to insert a SIM card. -->
+ <string name="keyguard_missing_sim_instructions">Insert a SIM card.</string>
+ <!-- Shown to ask the user to insert a SIM card when sim is missing or not readable. -->
+ <string name="keyguard_missing_sim_instructions_long">The SIM card is missing or not readable. Insert a SIM card.</string>
+ <!-- Shown when SIM card is permanently disabled. -->
+ <string name="keyguard_permanent_disabled_sim_message_short">Unusable SIM card.</string>
+ <!-- Shown to inform the user to SIM card is permanently disabled. -->
+ <string name="keyguard_permanent_disabled_sim_instructions">Your SIM card has been permanently disabled.\n
+ Contact your wireless service provider for another SIM card.</string>
+ <!-- Shown to tell the user that their SIM is locked and they must unlock it. -->
+ <string name="keyguard_sim_locked_message">SIM card is locked.</string>
+ <!-- When the user enters a wrong sim pin too many times, it becomes PUK locked (Pin Unlock Kode) -->
+ <string name="keyguard_sim_puk_locked_message">SIM card is PUK-locked.</string>
+ <!-- For the unlock screen, When the user enters a sim unlock code, it takes a little while to check
+ whether it is valid, and to unlock the sim if it is valid. we display a
+ progress dialog in the meantime. this is the emssage. -->
+ <string name="keyguard_sim_unlock_progress_dialog_message">Unlocking SIM card\u2026</string>
+
+
+ <!-- Accessibility description sent when user changes the current lock screen widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_changed">%1$s. Widget %2$d of %3$d.</string>
+ <!-- Accessibility description of the add widget button. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_add_widget">Add widget.</string>
+ <!-- Accessibility description of the empty sidget slot (place holder for a new widget). [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_empty_slot">Empty</string>
+ <!-- Accessibility description of the event of expanding an unlock area. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_unlock_area_expanded">Unlock area expanded.</string>
+ <!-- Accessibility description of the event of collapsing an unlock area. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_unlock_area_collapsed">Unlock area collapsed.</string>
+ <!-- Accessibility description of a lock screen widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget"><xliff:g id="widget_index">%1$s</xliff:g> widget.</string>
+ <!-- Accessibility description of the lock screen user selector widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_user_selector">User selector</string>
+ <!-- Accessibility description of the lock screen status widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_status">Status</string>
+ <!-- Accessibility description of the camera widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_camera">Camera</string>
+ <!-- Accessibility description of the lock media control widget. [CHAR_LIMIT=none] -->
+ <string name="keygaurd_accessibility_media_controls">Media controls</string>
+ <!-- Accessibility description of widget reordering start. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_reorder_start">Widget reordering started.</string>
+ <!-- Accessibility description of widget reordering end. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_reorder_end">Widget reordering ended.</string>
+ <!-- Accessibility description of the a widget deletion event. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_deleted">Widget <xliff:g id="widget_index">%1$s</xliff:g> deleted.</string>
+ <!-- Accessibility description of the button to expand the lock area. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_expand_lock_area">Expand unlock area.</string>
+ <!-- Accessibility description of the slide unlock. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_slide_unlock">Slide unlock.</string>
+ <!-- Accessibility description of the pattern unlock. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_pattern_unlock">Pattern unlock.</string>
+ <!-- Accessibility description of the face unlock. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_face_unlock">Face unlock.</string>
+ <!-- Accessibility description of the pin lock. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_pin_unlock">Pin unlock.</string>
+ <!-- Accessibility description of the password lock. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_password_unlock">Password unlock.</string>
+ <!-- Accessibility description of the unlock pattern area. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_pattern_area">Pattern area.</string>
+ <!-- Accessibility description of the unlock slide area. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_slide_area">Slide area.</string>
+
+ <!-- Shown on transport control of lockscreen. Pressing button goes to previous track. -->
+ <string name="keyguard_accessibility_transport_prev_description">Previous track button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button goes to next track. -->
+ <string name="keyguard_accessibility_transport_next_description">Next track button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_accessibility_transport_pause_description">Pause button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_accessibility_transport_play_description">Play button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_accessibility_transport_stop_description">Stop button</string>
+
+ <!-- Password keyboard strings. Used by LockScreen and Settings --><skip />
+ <!-- Label for "switch to symbols" key. Must be short to fit on key! -->
+ <string name="password_keyboard_label_symbol_key">\?123</string>
+ <!-- Label for "switch to alphabetic" key. Must be short to fit on key! -->
+ <string name="password_keyboard_label_alpha_key">ABC</string>
+ <!-- Label for ALT modifier key. Must be short to fit on key! -->
+ <string name="password_keyboard_label_alt_key">ALT</string>
+
+ <!-- KeyboardView - accessibility support --><skip />
+ <!-- Description of the Alt button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_alt">Alt</string>
+ <!-- Description of the Cancel button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_cancel">Cancel</string>
+ <!-- Description of the Delete button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_delete">Delete</string>
+ <!-- Description of the Done button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_done">Done</string>
+ <!-- Description of the Mode change button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_mode_change">Mode change</string>
+ <!-- Description of the Shift button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_shift">Shift</string>
+ <!-- Description of the Enter button in a KeyboardView. [CHAR LIMIT=NONE] -->
+ <string name="keyboardview_keycode_enter">Enter</string>
+
+ <!-- Description of the unlock target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_target_unlock">Unlock</string>
+ <!-- Description of the camera target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_target_camera">Camera</string>
+ <!-- Description of the silent target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_target_silent">Silent</string>
+ <!-- Description of the sound on target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_target_soundon">Sound on</string>
+ <!-- Description of the unlock target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_target_search">Search</string>
+
+ <!-- Description of the up direction in which one can to slide the handle in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_direction_up">Slide up for <xliff:g id="target_description" example="Unlock">%s</xliff:g>.</string>
+ <!-- Description of the down direction in which one can to slide the handle in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_direction_down">Slide down for <xliff:g id="target_description" example="Unlock">%s</xliff:g>.</string>
+ <!-- Description of the left direction in which one can to slide the handle in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_direction_left">"Slide left for <xliff:g id="target_description" example="Unlock">%s</xliff:g>.</string>
+ <!-- Description of the right direction in which one can to slide the handle in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+ <string name="description_direction_right">Slide right for <xliff:g id="target_description" example="Unlock">%s</xliff:g>.</string>
+
+ <!-- Text spoken when the current user is switched if accessibility is enabled. [CHAR LIMIT=none] -->
+ <string name="user_switched">Current user <xliff:g id="name" example="Bob">%1$s</xliff:g>.</string>
+
+ <!-- Label shown on emergency call button in keyguard -->
+ <string name="kg_emergency_call_label">Emergency call</string>
+ <!-- Message shown in pattern unlock after some number of unsuccessful attempts -->
+ <string name="kg_forgot_pattern_button_text">Forgot Pattern</string>
+ <!-- Message shown when user enters wrong pattern -->
+ <string name="kg_wrong_pattern">Wrong Pattern</string>
+ <!-- Message shown when user enters wrong password -->
+ <string name="kg_wrong_password">Wrong Password</string>
+ <!-- Message shown when user enters wrong PIN -->
+ <string name="kg_wrong_pin">Wrong PIN</string>
+ <!-- Countdown message shown after too many failed unlock attempts -->
+ <string name="kg_too_many_failed_attempts_countdown">Try again in <xliff:g id="number">%d</xliff:g> seconds.</string>
+ <!-- Instructions for using the pattern unlock screen -->
+ <string name="kg_pattern_instructions">Draw your pattern</string>
+ <!-- Instructions for using the SIM PIN unlock screen -->
+ <string name="kg_sim_pin_instructions">Enter SIM PIN</string>
+ <!-- Instructions for using the PIN unlock screen -->
+ <string name="kg_pin_instructions">Enter PIN</string>
+ <!-- Instructions for using the password unlock screen -->
+ <string name="kg_password_instructions">Enter Password</string>
+ <!-- Hint shown in the PUK screen that asks the user to enter the PUK code given to them by their provider -->
+ <string name="kg_puk_enter_puk_hint">SIM is now disabled. Enter PUK code to continue. Contact carrier for details.</string>
+ <!-- Hint shown in the PUK unlock screen PIN TextView -->
+ <string name="kg_puk_enter_pin_hint">Enter desired PIN code</string>
+ <!-- Message shown when the user needs to confirm the PIN they just entered in the PUK screen -->
+ <string name="kg_enter_confirm_pin_hint">Confirm desired PIN code</string>
+ <!-- Message shown in dialog while the device is unlocking the SIM card -->
+ <string name="kg_sim_unlock_progress_dialog_message">Unlocking SIM card\u2026</string>
+ <!-- Message shown when the user enters the wrong PIN code -->
+ <string name="kg_password_wrong_pin_code">Incorrect PIN code.</string>
+ <!-- Message shown when the user enters an invalid SIM pin password in PUK screen -->
+ <string name="kg_invalid_sim_pin_hint">Type a PIN that is 4 to 8 numbers.</string>
+ <!-- Message shown when the user enters an invalid PUK code in the PUK screen -->
+ <string name="kg_invalid_sim_puk_hint">PUK code should be 8 numbers or more.</string>
+ <!-- Message shown when the user enters an invalid PUK code -->
+ <string name="kg_invalid_puk">Re-enter the correct PUK code. Repeated attempts will permanently disable the SIM.</string>
+ <!-- String shown in PUK screen when PIN codes don't match -->
+ <string name="kg_invalid_confirm_pin_hint" product="default">PIN codes does not match</string>
+ <!-- Message shown when the user exceeds the maximum number of pattern attempts -->
+ <string name="kg_login_too_many_attempts">Too many pattern attempts</string>
+ <!-- Instructions show in account unlock screen allowing user to enter their email password -->
+ <string name="kg_login_instructions">To unlock, sign in with your Google account.</string>
+ <!-- Hint shown in TextView in account unlock screen of keyguard -->
+ <string name="kg_login_username_hint">Username (email)</string>
+ <!-- Hint shown in TextView in account unlock screen of keyguard -->
+ <string name="kg_login_password_hint">Password</string>
+ <!-- Label shown on sign in button on account unlock screen of keyguard -->
+ <string name="kg_login_submit_button">Sign in</string>
+ <!-- Message shown when the user enters an invalid username/password combination in account unlock screen of keyguard -->
+ <string name="kg_login_invalid_input">Invalid username or password.</string>
+ <!-- Hint text shown when user has too many failed password attempts in account unlock screen of keyguard -->
+ <string name="kg_login_account_recovery_hint">Forgot your username or password\?\nVisit <b>google.com/accounts/recovery</b>.</string>
+ <!-- Message shown while device checks username/password in account unlock screen of keyguard -->
+ <string name="kg_login_checking_password">Checking account\u2026</string>
+ <!-- Message shown in dialog when max number of attempts are reached for PIN screen of keyguard -->
+ <string name="kg_too_many_failed_pin_attempts_dialog_message">
+ You have incorrectly typed your PIN <xliff:g id="number">%d</xliff:g> times.
+ \n\nTry again in <xliff:g id="number">%d</xliff:g> seconds.
+ </string>
+ <!-- Message shown in dialog when max number of attempts are reached for password screen of keyguard -->
+ <string name="kg_too_many_failed_password_attempts_dialog_message">
+ You have incorrectly typed your password <xliff:g id="number">%d</xliff:g> times.
+ \n\nTry again in <xliff:g id="number">%d</xliff:g> seconds.
+ </string>
+ <string name="kg_too_many_failed_pattern_attempts_dialog_message">
+ You have incorrectly drawn your unlock pattern <xliff:g id="number">%d</xliff:g> times.
+ \n\nTry again in <xliff:g id="number">%d</xliff:g> seconds.
+ </string>
+ <!-- Message shown when user is almost at the limit of password attempts where the device will be wiped. -->
+ <string name="kg_failed_attempts_almost_at_wipe" product="tablet">
+ You have incorrectly attempted to unlock the tablet <xliff:g id="number">%d</xliff:g> times.
+ After <xliff:g id="number">%d</xliff:g> more unsuccessful attempts,
+ the tablet will be reset to factory default and all user data will be lost.
+ </string>
+ <!-- Message shown when user is almost at the limit of password attempts where the device will be wiped. -->
+ <string name="kg_failed_attempts_almost_at_wipe" product="default">
+ You have incorrectly attempted to unlock the phone <xliff:g id="number">%d</xliff:g> times.
+ After <xliff:g id="number">%d</xliff:g> more unsuccessful attempts,
+ the phone will be reset to factory default and all user data will be lost.
+ </string>
+ <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
+ <string name="kg_failed_attempts_now_wiping" product="tablet">
+ You have incorrectly attempted to unlock the tablet <xliff:g id="number">%d</xliff:g> times.
+ The tablet will now be reset to factory default.
+ </string>
+ <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
+ <string name="kg_failed_attempts_now_wiping" product="default">
+ You have incorrectly attempted to unlock the phone <xliff:g id="number">%d</xliff:g> times.
+ The phone will now be reset to factory default.
+ </string>
+ <!-- Message shown in dialog when user is almost at the limit where they will be
+ locked out and may have to enter an alternate username/password to unlock the phone -->
+ <string name="kg_failed_attempts_almost_at_login" product="tablet">
+ You have incorrectly drawn your unlock pattern <xliff:g id="number">%d</xliff:g> times.
+ After <xliff:g id="number">%d</xliff:g> more unsuccessful attempts,
+ you will be asked to unlock your tablet using an email account.\n\n
+ Try again in <xliff:g id="number">%d</xliff:g> seconds.
+ </string>
+ <!-- Message shown in dialog when user is almost at the limit where they will be
+ locked out and may have to enter an alternate username/password to unlock the phone -->
+ <string name="kg_failed_attempts_almost_at_login" product="default">
+ You have incorrectly drawn your unlock pattern <xliff:g id="number">%d</xliff:g> times.
+ After <xliff:g id="number">%d</xliff:g> more unsuccessful attempts,
+ you will be asked to unlock your phone using an email account.\n\n
+ Try again in <xliff:g id="number">%d</xliff:g> seconds.
+ </string>
+ <!-- Sequence of characters used to separate message strings in keyguard. Typically just em-dash
+ with spaces on either side. [CHAR LIMIT=3] -->
+ <string name="kg_text_message_separator" product="default">" \u2014 "</string>
+ <!-- The delete-widget drop target button text -->
+ <string name="kg_reordering_delete_drop_target_text">Remove</string>
+
+ <!-- Transport control strings -->
+ <!-- Shown on transport control of lockscreen. Pressing button goes to previous track. -->
+ <string name="keyguard_transport_prev_description">Previous track button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button goes to next track. -->
+ <string name="keyguard_transport_next_description">Next track button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_transport_pause_description">Pause button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_transport_play_description">Play button</string>
+ <!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
+ <string name="keyguard_transport_stop_description">Stop button</string>
+
+ <!-- On the keyguard screen, it shows the carrier the phone is connected to.
+ This is displayed if the phone is not connected to a carrier.-->
+ <string name="keyguard_carrier_default">No service.</string>
+
+</resources>
diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml
new file mode 100644
index 0000000..16a3f3f
--- /dev/null
+++ b/packages/Keyguard/res/values/styles.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2012, 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.
+*/
+-->
+
+<resources>
+ <!-- Keyguard PIN pad styles -->
+ <style name="Widget.Button.NumPadKey"
+ parent="@android:style/Widget.Button">
+ <item name="android:singleLine">true</item>
+ <item name="android:padding">6dip</item>
+ <item name="android:gravity">left|center_vertical</item>
+ <item name="android:background">?android:attr/selectableItemBackground</item>
+ <item name="android:textSize">34dp</item>
+ <item name="android:fontFamily">sans-serif</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">#ffffff</item>
+ <item name="android:paddingBottom">10dp</item>
+ <item name="android:paddingLeft">20dp</item>
+ </style>
+ <style name="TextAppearance.NumPadKey"
+ parent="@android:style/TextAppearance">
+ <item name="android:textSize">34dp</item>
+ <item name="android:fontFamily">sans-serif</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">#ffffff</item>
+ </style>
+ <style name="TextAppearance.NumPadKey.Klondike">
+ <item name="android:textSize">20dp</item>
+ <item name="android:fontFamily">sans-serif-condensed</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">#80ffffff</item>
+ </style>
+
+ <!-- Standard animations for a non-full-screen window or activity. -->
+ <style name="Animation.LockScreen" parent="@android:style/Animation">
+ <item name="android:windowEnterAnimation">@anim/lock_screen_enter</item>
+ <item name="android:windowExitAnimation">@anim/lock_screen_exit</item>
+ </style>
+
+</resources>
diff --git a/packages/Keyguard/scripts/copy_profile_icons.sh b/packages/Keyguard/scripts/copy_profile_icons.sh
new file mode 100755
index 0000000..5416101
--- /dev/null
+++ b/packages/Keyguard/scripts/copy_profile_icons.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+for user in `adb $* shell ls /data/system/users | grep -v xml`
+do
+ user=${user/$'\r'/}
+ adb shell mkdir /data/user/${user}/users
+ for photo in `adb $* shell ls /data/system/users | grep -v xml`
+ do
+ photo=${photo/$'\r'/}
+ adb shell mkdir /data/user/${user}/users/${photo}
+ adb pull /data/system/users/${photo}/photo.png
+ adb push photo.png /data/user/${user}/users/${photo}
+ done
+done
diff --git a/packages/Keyguard/scripts/new_merge.py b/packages/Keyguard/scripts/new_merge.py
new file mode 100755
index 0000000..70fafec
--- /dev/null
+++ b/packages/Keyguard/scripts/new_merge.py
@@ -0,0 +1,165 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import difflib
+import filecmp
+import tempfile
+from optparse import OptionParser
+from subprocess import call
+from subprocess import Popen
+from subprocess import PIPE
+
+def which(program):
+ def executable(path):
+ return os.path.isfile(path) and os.access(path, os.X_OK)
+
+ path, file = os.path.split(program)
+ if path and executable(program):
+ return program
+ else:
+ for path in os.environ["PATH"].split(os.pathsep):
+ exe = os.path.join(path, program)
+ if executable(exe):
+ return exe
+ return ""
+
+DIFF_TOOLS=["meld", "kdiff3", "xdiff", "diffmerge.sh", "diff"]
+
+PROTO_SRC="./src/com/android/keyguard/"
+PROTO_RES="./res/"
+
+TEMP_FILE1="/tmp/tempFile1.txt"
+TEMP_FILE2="/tmp/tempFile2.txt"
+
+FW_SRC="../../../../frameworks/base/policy/src/com/android/internal/policy/impl/keyguard/"
+FW_RES="../../../../frameworks/base/core/res/res/"
+
+FW_PKG="com.android.internal.policy.impl.keyguard"
+PROTO_PKG="com.android.keyguard"
+
+FW_RES_IMPORT="import com.android.internal.R;"
+
+# Find a differ
+DIFF_TOOL=""
+if ("DIFF_TOOL" in os.environ and len(os.environ["DIFF_TOOL"]) > 0):
+ DIFF_TOOL=which(os.environ["DIFF_TOOL"])
+if len(DIFF_TOOL) == 0:
+ for differ in DIFF_TOOLS:
+ DIFF_TOOL=which(differ)
+ if len(DIFF_TOOL) > 0:
+ break
+
+print "Using differ", DIFF_TOOL
+
+#Anything file which contains any string in this list as a substring will be ommitted
+IGNORE=["LockHotnessActivity.java", "unified_lock_activity.xml", "optionmenu.xml"]
+WATCH=[]
+
+def dirCompare(sourceDir, destDir, ext, run_in_reverse):
+ sourceFiles = getFileList(sourceDir, ext)
+ destFiles = getFileList(destDir, ext)
+ for file in sourceFiles:
+ print file
+ destFile = destDir + file
+ sourceFile = sourceDir + file
+ if (file in destFiles):
+ if run_in_reverse:
+ prepareFileForCompare(sourceFile, TEMP_FILE1, FW_RES_IMPORT, FW_PKG, PROTO_PKG)
+ prepareFileForCompare(destFile, TEMP_FILE2, FW_RES_IMPORT,)
+ else:
+ prepareFileForCompare(destFile, TEMP_FILE1, FW_RES_IMPORT, FW_PKG, PROTO_PKG)
+ prepareFileForCompare(sourceFile, TEMP_FILE2, FW_RES_IMPORT,)
+ if (filecmp.cmp(TEMP_FILE1, TEMP_FILE2)):
+ print "File %s is the same in proto and framework" %(file)
+ else:
+ print "Running diff for: %s" %(file)
+ diff(sourceFile, destFile)
+ else:
+ print "File %s does not exist in framework" %(file)
+ if not run_in_reverse:
+ diff(sourceFile, destFile)
+
+def main(argv):
+ run_in_reverse = False
+ if len(argv) > 1:
+ if argv[1] == '--help' or argv[1] == '-h':
+ print ('Usage: %s [<commit>]' % argv[0])
+ print ('\tdiff to framework, ' +
+ 'optionally restricting to files in <commit>')
+ sys.exit(0)
+ elif argv[1] == '--reverse':
+ print "Running in reverse"
+ run_in_reverse = True
+ else:
+ print ("**** Pulling file list from: %s" % argv[1])
+ pipe = Popen(['git', 'diff', '--name-only', argv[1]], stdout=PIPE).stdout
+ for line in iter(pipe.readline,''):
+ path = line.rstrip()
+ file = path[path.rfind('/') + 1:]
+ print '**** watching: %s' % file
+ WATCH.append(file);
+ pipe.close()
+
+ if run_in_reverse:
+ #dirCompare(FW_RES, PROTO_RES, ".xml", run_in_reverse)
+ print ("**** Source files:")
+ dirCompare(FW_SRC, PROTO_SRC, ".java", run_in_reverse)
+ else:
+ #dirCompare(PROTO_RES, FW_RES, ".xml", run_in_reverse)
+ print ("**** Source files:")
+ dirCompare(PROTO_SRC, FW_SRC, ".java", run_in_reverse)
+
+ if (os.path.exists(TEMP_FILE1)):
+ os.remove(TEMP_FILE1)
+
+ if (os.path.exists(TEMP_FILE2)):
+ os.remove(TEMP_FILE2)
+
+def getFileList(rootdir, extension):
+ fileList = []
+
+ for root, subFolders, files in os.walk(rootdir):
+ for file in files:
+ f = os.path.join(root,file)
+ if (os.path.splitext(f)[1] == extension and (not inIgnore(f))):
+ fileList.append(f[len(rootdir):])
+ return fileList
+
+
+def prepareFileForCompare(inFile, outFile, skip="", replace="", withText=""):
+ # Delete the outfile, so we're starting with a new file
+ if (os.path.exists(outFile)):
+ os.remove(outFile)
+
+ fin = open(inFile)
+ fout = open(outFile, "w")
+ for line in fin:
+ # Ignore any lines containing the ignore string ("import com.android.internal.R;) and
+ # ignore any lines containing only whitespace.
+ if (line.find(skip) < 0 and len(line.strip(' \t\n\r')) > 0):
+ # For comparison, for framework files, we replace the fw package with the
+ # proto package, since these aren't relevant.
+ if len(replace) > 0:
+ fout.write(line.replace(replace, withText))
+ else:
+ fout.write(line)
+ fin.close()
+ fout.close()
+
+def diff(file1, file2):
+ call([DIFF_TOOL, file1, file2])
+
+def inIgnore(file):
+ for ignore in IGNORE:
+ if file.find(ignore) >= 0:
+ return True
+ if len(WATCH) > 0:
+ for watch in WATCH:
+ if file.find(watch) >= 0:
+ return False
+ return True
+ return False
+
+if __name__=="__main__":
+ main(sys.argv)
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/BiometricSensorUnlock.java b/packages/Keyguard/src/com/android/keyguard/BiometricSensorUnlock.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/BiometricSensorUnlock.java
rename to packages/Keyguard/src/com/android/keyguard/BiometricSensorUnlock.java
index e65a716f..230ef81 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/BiometricSensorUnlock.java
+++ b/packages/Keyguard/src/com/android/keyguard/BiometricSensorUnlock.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.view.View;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java
rename to packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
index 762711d..146c092 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java
+++ b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -33,8 +33,7 @@
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
-import com.android.internal.R;
-import com.android.internal.policy.impl.keyguard.KeyguardActivityLauncher.CameraWidgetInfo;
+import com.android.keyguard.KeyguardActivityLauncher.CameraWidgetInfo;
public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnClickListener {
private static final String TAG = CameraWidgetFrame.class.getSimpleName();
@@ -204,7 +203,7 @@
private static View inflateGenericWidgetView(Context context) {
if (DEBUG) Log.d(TAG, "inflateGenericWidgetView");
ImageView iv = new ImageView(context);
- iv.setImageResource(com.android.internal.R.drawable.ic_lockscreen_camera);
+ iv.setImageResource(R.drawable.ic_lockscreen_camera);
iv.setScaleType(ScaleType.CENTER);
iv.setBackgroundColor(Color.argb(127, 0, 0, 0));
return iv;
@@ -423,7 +422,7 @@
if (!(lp instanceof WindowManager.LayoutParams))
return;
WindowManager.LayoutParams wlp = (WindowManager.LayoutParams) lp;
- int newWindowAnimations = isEnabled ? com.android.internal.R.style.Animation_LockScreen : 0;
+ int newWindowAnimations = isEnabled ? R.style.Animation_LockScreen : 0;
if (newWindowAnimations != wlp.windowAnimations) {
if (DEBUG) Log.d(TAG, "setting windowAnimations to: " + newWindowAnimations
+ " at " + SystemClock.uptimeMillis());
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java
similarity index 89%
rename from policy/src/com/android/internal/policy/impl/keyguard/CarrierText.java
rename to packages/Keyguard/src/com/android/keyguard/CarrierText.java
index a38e86d..9f0a042 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/CarrierText.java
+++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java
@@ -14,14 +14,13 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;
-import com.android.internal.R;
import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.widget.LockPatternUtils;
@@ -124,7 +123,7 @@
case NetworkLocked:
carrierText = makeCarrierStringOnEmergencyCapable(
- mContext.getText(R.string.lockscreen_network_locked_message), plmn);
+ mContext.getText(R.string.keyguard_network_locked_message), plmn);
break;
case SimMissing:
@@ -133,30 +132,30 @@
// has some connectivity. Otherwise, it should be null or empty and just show
// "No SIM card"
carrierText = makeCarrierStringOnEmergencyCapable(
- getContext().getText(R.string.lockscreen_missing_sim_message_short),
+ getContext().getText(R.string.keyguard_missing_sim_message_short),
plmn);
break;
case SimPermDisabled:
carrierText = getContext().getText(
- R.string.lockscreen_permanent_disabled_sim_message_short);
+ R.string.keyguard_permanent_disabled_sim_message_short);
break;
case SimMissingLocked:
carrierText = makeCarrierStringOnEmergencyCapable(
- getContext().getText(R.string.lockscreen_missing_sim_message_short),
+ getContext().getText(R.string.keyguard_missing_sim_message_short),
plmn);
break;
case SimLocked:
carrierText = makeCarrierStringOnEmergencyCapable(
- getContext().getText(R.string.lockscreen_sim_locked_message),
+ getContext().getText(R.string.keyguard_sim_locked_message),
plmn);
break;
case SimPukLocked:
carrierText = makeCarrierStringOnEmergencyCapable(
- getContext().getText(R.string.lockscreen_sim_puk_locked_message),
+ getContext().getText(R.string.keyguard_sim_puk_locked_message),
plmn);
break;
}
@@ -232,19 +231,19 @@
StatusMode status = getStatusForIccState(simState);
switch (status) {
case NetworkLocked:
- carrierHelpTextId = R.string.lockscreen_instructions_when_pattern_disabled;
+ carrierHelpTextId = R.string.keyguard_instructions_when_pattern_disabled;
break;
case SimMissing:
- carrierHelpTextId = R.string.lockscreen_missing_sim_instructions_long;
+ carrierHelpTextId = R.string.keyguard_missing_sim_instructions_long;
break;
case SimPermDisabled:
- carrierHelpTextId = R.string.lockscreen_permanent_disabled_sim_instructions;
+ carrierHelpTextId = R.string.keyguard_permanent_disabled_sim_instructions;
break;
case SimMissingLocked:
- carrierHelpTextId = R.string.lockscreen_missing_sim_instructions;
+ carrierHelpTextId = R.string.keyguard_missing_sim_instructions;
break;
case Normal:
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/ChallengeLayout.java b/packages/Keyguard/src/com/android/keyguard/ChallengeLayout.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/ChallengeLayout.java
rename to packages/Keyguard/src/com/android/keyguard/ChallengeLayout.java
index 8ece559..677f1f1 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/ChallengeLayout.java
+++ b/packages/Keyguard/src/com/android/keyguard/ChallengeLayout.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
/**
* Interface implemented by ViewGroup-derived layouts that implement
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/CheckLongPressHelper.java b/packages/Keyguard/src/com/android/keyguard/CheckLongPressHelper.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/CheckLongPressHelper.java
rename to packages/Keyguard/src/com/android/keyguard/CheckLongPressHelper.java
index 4825e23..52e7cd5 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/CheckLongPressHelper.java
+++ b/packages/Keyguard/src/com/android/keyguard/CheckLongPressHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.view.MotionEvent;
import android.view.View;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java b/packages/Keyguard/src/com/android/keyguard/ClockView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/ClockView.java
rename to packages/Keyguard/src/com/android/keyguard/ClockView.java
index 6c701c7..c2930cb 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java
+++ b/packages/Keyguard/src/com/android/keyguard/ClockView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -34,7 +34,6 @@
import java.lang.ref.WeakReference;
import java.text.DateFormatSymbols;
import java.util.Calendar;
-import com.android.internal.R;
/**
* Displays the time
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/EmergencyButton.java b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/EmergencyButton.java
rename to packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
index cd7324c..3871cea 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/EmergencyButton.java
+++ b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.content.Intent;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java b/packages/Keyguard/src/com/android/keyguard/FaceUnlock.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java
rename to packages/Keyguard/src/com/android/keyguard/FaceUnlock.java
index e58eb5b..689366b 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java
+++ b/packages/Keyguard/src/com/android/keyguard/FaceUnlock.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import com.android.internal.policy.IFaceLockCallback;
import com.android.internal.policy.IFaceLockInterface;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index cc520dc..fb2eeda 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.graphics.Rect;
@@ -32,7 +32,6 @@
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
-import com.android.internal.R;
import com.android.internal.widget.LockPatternUtils;
/**
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAccountView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardAccountView.java
index e0e7128..6b8be69 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAccountView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.accounts.Account;
import android.accounts.AccountManager;
@@ -41,7 +41,6 @@
import android.widget.LinearLayout;
import com.android.internal.widget.LockPatternUtils;
-import com.android.internal.R;
import java.io.IOException;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java b/packages/Keyguard/src/com/android/keyguard/KeyguardActivityLauncher.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardActivityLauncher.java
index 6539db3..9a1aa5b 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardActivityLauncher.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardActivityLauncher.java
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
+
+import com.android.internal.widget.LockPatternUtils;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
@@ -35,8 +37,7 @@
import android.util.Log;
import android.view.WindowManager;
-import com.android.internal.policy.impl.keyguard.KeyguardHostView.OnDismissAction;
-import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardHostView.OnDismissAction;
import java.util.List;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardCircleFramedDrawable.java b/packages/Keyguard/src/com/android/keyguard/KeyguardCircleFramedDrawable.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardCircleFramedDrawable.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardCircleFramedDrawable.java
index 79b66f4..ed3faea 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardCircleFramedDrawable.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardCircleFramedDrawable.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.graphics.Bitmap;
import android.graphics.Canvas;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java
index 4df434c..041f7f2 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -25,8 +25,6 @@
import android.widget.ImageButton;
import android.widget.LinearLayout;
-import com.android.internal.R;
-
import com.android.internal.widget.LockPatternUtils;
public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecurityView {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardGlowStripView.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardGlowStripView.java
index e1c95f0..98a44a6 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardGlowStripView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -29,8 +29,6 @@
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;
-import com.android.internal.R;
-
/**
* A layout which animates a strip of horizontal, pulsing dots on request. This is used
* to indicate the presence of pages to the left / right.
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
index 06f06b5..e2bc54b 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import android.app.Activity;
import android.app.ActivityManager;
@@ -53,10 +56,6 @@
import android.view.animation.AnimationUtils;
import android.widget.RemoteViews.OnClickHandler;
-import com.android.internal.R;
-import com.android.internal.policy.impl.keyguard.KeyguardSecurityModel.SecurityMode;
-import com.android.internal.widget.LockPatternUtils;
-
import java.io.File;
import java.util.List;
@@ -141,6 +140,16 @@
// In other words, mUserId should never change - hence it's marked final.
mUserId = mLockPatternUtils.getCurrentUser();
+ DevicePolicyManager dpm =
+ (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
+ if (dpm != null) {
+ mDisabledFeatures = getDisabledFeatures(dpm);
+ mCameraDisabled = dpm.getCameraDisabled(null);
+ }
+
+ mSafeModeEnabled = LockPatternUtils.isSafeModeEnabled();
+
+ // These need to be created with the user context...
Context userContext = null;
try {
final String packageName = "system";
@@ -153,29 +162,13 @@
userContext = context;
}
- // These need to be created with the user context...
mAppWidgetHost = new AppWidgetHost(userContext, APPWIDGET_HOST_ID, mOnClickHandler,
Looper.myLooper());
+
+ cleanupAppWidgetIds();
+
mAppWidgetManager = AppWidgetManager.getInstance(userContext);
- cleanupAppWidgetIds();
-
- mSecurityModel = new KeyguardSecurityModel(context);
-
- mViewStateManager = new KeyguardViewStateManager(this);
-
- DevicePolicyManager dpm =
- (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
- if (dpm != null) {
- mDisabledFeatures = getDisabledFeatures(dpm);
- mCameraDisabled = dpm.getCameraDisabled(null);
- }
-
- mSafeModeEnabled = LockPatternUtils.isSafeModeEnabled();
-
- cleanupAppWidgetIds();
-
- mAppWidgetManager = AppWidgetManager.getInstance(mContext);
mSecurityModel = new KeyguardSecurityModel(context);
mViewStateManager = new KeyguardViewStateManager(this);
@@ -512,7 +505,7 @@
final AlertDialog dialog = new AlertDialog.Builder(mContext)
.setTitle(title)
.setMessage(message)
- .setNeutralButton(com.android.internal.R.string.ok, null)
+ .setNeutralButton(R.string.ok, null)
.create();
if (!(mContext instanceof Activity)) {
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
@@ -863,8 +856,7 @@
KeyguardSecurityView newView = getSecurityView(securityMode);
// Enter full screen mode if we're in SIM or Account screen
- boolean fullScreenEnabled = getResources().getBoolean(
- com.android.internal.R.bool.kg_sim_puk_account_full_screen);
+ boolean fullScreenEnabled = getResources().getBoolean(R.bool.kg_sim_puk_account_full_screen);
boolean isSimOrAccount = securityMode == SecurityMode.SimPin
|| securityMode == SecurityMode.SimPuk
|| securityMode == SecurityMode.Account;
@@ -1551,19 +1543,12 @@
private static final String ENABLE_MENU_KEY_FILE = "/data/local/enable_menu_key";
private boolean shouldEnableMenuKey() {
final Resources res = getResources();
- final boolean configDisabled = res.getBoolean(
- com.android.internal.R.bool.config_disableMenuKeyInLockScreen);
+ final boolean configDisabled = res.getBoolean(R.bool.config_disableMenuKeyInLockScreen);
final boolean isTestHarness = ActivityManager.isRunningInTestHarness();
final boolean fileOverride = (new File(ENABLE_MENU_KEY_FILE)).exists();
return !configDisabled || isTestHarness || fileOverride;
}
-
-
- public void goToUserSwitcher() {
- mAppWidgetContainer.setCurrentPage(getWidgetPosition(R.id.keyguard_multi_user_selector));
- }
-
public void goToWidget(int appWidgetId) {
mAppWidgetToShow = appWidgetId;
mSwitchPageRunnable.run();
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardLinearLayout.java b/packages/Keyguard/src/com/android/keyguard/KeyguardLinearLayout.java
similarity index 95%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardLinearLayout.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardLinearLayout.java
index 0fc54cd..343fdcb 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardLinearLayout.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardLinearLayout.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.util.AttributeSet;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java b/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
similarity index 95%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
index 77359ff..194162a 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -35,9 +35,6 @@
import libcore.util.MutableInt;
import java.lang.ref.WeakReference;
-
-import com.android.internal.R;
-
/***
* Manages a number of views inside of the given layout. See below for a list of widgets.
*/
@@ -242,13 +239,12 @@
if (mCharging) {
// Charging, charged or waiting to charge.
string = getContext().getString(mBatteryCharged
- ? com.android.internal.R.string.lockscreen_charged
- : com.android.internal.R.string.lockscreen_plugged_in, mBatteryLevel);
+ ? R.string.keyguard_charged
+ : R.string.keyguard_plugged_in, mBatteryLevel);
icon.value = CHARGING_ICON;
} else if (mBatteryIsLow) {
// Battery is low
- string = getContext().getString(
- com.android.internal.R.string.lockscreen_low_battery);
+ string = getContext().getString(R.string.keyguard_low_battery);
icon.value = BATTERY_LOW_ICON;
}
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserAvatar.java b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserAvatar.java
similarity index 93%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserAvatar.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserAvatar.java
index 9d1f041..7ef5b26 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserAvatar.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserAvatar.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -26,6 +26,7 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
+import android.os.UserManager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
@@ -34,8 +35,6 @@
import android.widget.ImageView;
import android.widget.TextView;
-import com.android.internal.R;
-
class KeyguardMultiUserAvatar extends FrameLayout {
private static final String TAG = KeyguardMultiUserAvatar.class.getSimpleName();
private static final boolean DEBUG = KeyguardHostView.DEBUG;
@@ -70,6 +69,7 @@
private KeyguardMultiUserSelectorView mUserSelector;
private KeyguardCircleFramedDrawable mFramed;
private boolean mPressLock;
+ private UserManager mUserManager;
public static KeyguardMultiUserAvatar fromXml(int resId, Context context,
KeyguardMultiUserSelectorView userSelector, UserInfo info) {
@@ -104,6 +104,7 @@
mActiveScale = ACTIVE_SCALE;
mActiveAlpha = ACTIVE_ALPHA;
mInactiveAlpha = INACTIVE_ALPHA;
+ mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
mTouched = false;
@@ -111,9 +112,6 @@
}
protected String rewriteIconPath(String path) {
- if (!this.getClass().getName().contains("internal")) {
- return path.replace("system", "data");
- }
return path;
}
@@ -124,16 +122,12 @@
mUserImage = (ImageView) findViewById(R.id.keyguard_user_avatar);
mUserName = (TextView) findViewById(R.id.keyguard_user_name);
- Bitmap icon = null;
- try {
- icon = BitmapFactory.decodeFile(rewriteIconPath(user.iconPath));
- } catch (Exception e) {
- if (DEBUG) Log.d(TAG, "failed to open profile icon " + user.iconPath, e);
- }
+ Bitmap icon = mUserManager.getUserIcon(user.id);
if (icon == null) {
+ if (DEBUG) Log.w(TAG, "Couldn't get user icon for user id " + user.id);
icon = BitmapFactory.decodeResource(mContext.getResources(),
- com.android.internal.R.drawable.ic_contact_picture);
+ R.drawable.ic_contact_picture);
}
mFramed = new KeyguardCircleFramedDrawable(icon, (int) mIconSize, mFrameColor, mStroke,
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserSelectorView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java
similarity index 89%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserSelectorView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java
index f9ea5bb..7975d8e 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserSelectorView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.ActivityManagerNative;
import android.content.Context;
@@ -27,8 +27,6 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import com.android.internal.R;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -154,15 +152,11 @@
@Override
public void run() {
mActiveUserAvatar = avatar;
- if (this.getClass().getName().contains("internal")) {
- try {
- ActivityManagerNative.getDefault()
- .switchUser(avatar.getUserInfo().id);
- } catch (RemoteException re) {
- Log.e(TAG, "Couldn't switch user " + re);
- }
- } else {
- setAllClickable(true);
+ try {
+ ActivityManagerNative.getDefault()
+ .switchUser(avatar.getUserInfo().id);
+ } catch (RemoteException re) {
+ Log.e(TAG, "Couldn't switch user " + re);
}
}
});
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
index fa80352..3d1c3f3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.text.Editable;
@@ -25,8 +25,6 @@
import android.view.View;
import android.widget.TextView.OnEditorActionListener;
-import com.android.internal.R;
-
/**
* Displays a PIN pad for unlocking.
*/
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
index d52c993..4e3568b 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
@@ -31,7 +31,6 @@
import android.view.inputmethod.InputMethodSubtype;
import android.widget.TextView.OnEditorActionListener;
-import com.android.internal.R;
import com.android.internal.widget.PasswordEntryKeyboardHelper;
import com.android.internal.widget.PasswordEntryKeyboardView;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
index e114b78..e7f1259 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.accounts.Account;
import android.accounts.AccountManager;
@@ -37,7 +37,6 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternView;
-import com.android.internal.R;
import java.io.IOException;
import java.util.List;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
similarity index 93%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityCallback.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
index 7e6c108..4f139ad 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityCallback.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
-import com.android.internal.policy.impl.keyguard.KeyguardHostView.OnDismissAction;
+import com.android.keyguard.KeyguardHostView.OnDismissAction;
public interface KeyguardSecurityCallback {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
similarity index 93%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
index 375a96a..9d03c6a 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityContainer.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -1,12 +1,10 @@
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
-import com.android.internal.R;
-
public class KeyguardSecurityContainer extends FrameLayout {
public KeyguardSecurityContainer(Context context, AttributeSet attrs) {
this(context, attrs, 0);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
index 7a69586..4129e33 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityModel.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityView.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityView.java
index a3ac39c..dfeacf3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import com.android.internal.widget.LockPatternUtils;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
index aa31b00..70a0e44 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
@@ -14,10 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
-
-import com.android.internal.R;
-import com.android.internal.widget.LockPatternUtils;
+package com.android.keyguard;
import android.content.Context;
import android.content.res.TypedArray;
@@ -32,6 +29,8 @@
import android.widget.FrameLayout;
import android.widget.ViewFlipper;
+import com.android.internal.widget.LockPatternUtils;
+
/**
* Subclass of the current view flipper that allows us to overload dispatchTouchEvent() so
* we can emulate {@link WindowManager.LayoutParams#FLAG_SLIPPERY} within a view hierarchy.
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewHelper.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewHelper.java
index 3d59f8d..67a6f52 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewHelper.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
similarity index 89%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
index 6859042..4d891be 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.ObjectAnimator;
import android.app.SearchManager;
@@ -34,7 +34,6 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.multiwaveview.GlowPadView;
import com.android.internal.widget.multiwaveview.GlowPadView.OnTriggerListener;
-import com.android.internal.R;
public class KeyguardSelectorView extends LinearLayout implements KeyguardSecurityView {
private static final boolean DEBUG = KeyguardHostView.DEBUG;
@@ -58,7 +57,7 @@
public void onTrigger(View v, int target) {
final int resId = mGlowPadView.getResourceIdForTarget(target);
switch (resId) {
- case com.android.internal.R.drawable.ic_action_assist_generic:
+ case R.drawable.ic_action_assist_generic:
Intent assistIntent =
((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE))
.getAssistIntent(mContext, true, UserHandle.USER_CURRENT);
@@ -70,13 +69,13 @@
mCallback.userActivity(0);
break;
- case com.android.internal.R.drawable.ic_lockscreen_camera:
+ case R.drawable.ic_lockscreen_camera:
mActivityLauncher.launchCamera(null, null);
mCallback.userActivity(0);
break;
- case com.android.internal.R.drawable.ic_lockscreen_unlock_phantom:
- case com.android.internal.R.drawable.ic_lockscreen_unlock:
+ case R.drawable.ic_lockscreen_unlock_phantom:
+ case R.drawable.ic_lockscreen_unlock:
mCallback.userActivity(0);
mCallback.dismiss(false);
break;
@@ -179,9 +178,9 @@
final KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(getContext());
boolean disabledBySimState = monitor.isSimLocked();
boolean cameraTargetPresent =
- isTargetPresent(com.android.internal.R.drawable.ic_lockscreen_camera);
+ isTargetPresent(R.drawable.ic_lockscreen_camera);
boolean searchTargetPresent =
- isTargetPresent(com.android.internal.R.drawable.ic_action_assist_generic);
+ isTargetPresent(R.drawable.ic_action_assist_generic);
if (cameraDisabledByAdmin) {
Log.v(TAG, "Camera disabled by Device Policy");
@@ -214,21 +213,17 @@
// DON'T USE IT!
ComponentName component = intent.getComponent();
boolean replaced = mGlowPadView.replaceTargetDrawablesIfPresent(component,
- ASSIST_ICON_METADATA_NAME + "_google",
- com.android.internal.R.drawable.ic_action_assist_generic);
+ ASSIST_ICON_METADATA_NAME + "_google", R.drawable.ic_action_assist_generic);
if (!replaced && !mGlowPadView.replaceTargetDrawablesIfPresent(component,
- ASSIST_ICON_METADATA_NAME,
- com.android.internal.R.drawable.ic_action_assist_generic)) {
+ ASSIST_ICON_METADATA_NAME, R.drawable.ic_action_assist_generic)) {
Slog.w(TAG, "Couldn't grab icon from package " + component);
}
}
}
- mGlowPadView.setEnableTarget(com.android.internal.R.drawable
- .ic_lockscreen_camera, !mCameraDisabled);
- mGlowPadView.setEnableTarget(com.android.internal.R.drawable
- .ic_action_assist_generic, !mSearchDisabled);
+ mGlowPadView.setEnableTarget(R.drawable.ic_lockscreen_camera, !mCameraDisabled);
+ mGlowPadView.setEnableTarget(R.drawable.ic_action_assist_generic, !mSearchDisabled);
}
void doTransition(View view, float to) {
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardService.java b/packages/Keyguard/src/com/android/keyguard/KeyguardService.java
new file mode 100644
index 0000000..e697948
--- /dev/null
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardService.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2010 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.keyguard;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.util.Log;
+import android.view.accessibility.AccessibilityManager;
+
+import com.android.internal.policy.IKeyguardService;
+import com.android.internal.policy.IKeyguardResult;
+import com.android.internal.widget.LockPatternUtils;
+
+public class KeyguardService extends Service {
+ static final String TAG = "KeyguardService";
+ private KeyguardViewMediator mKeyguardViewMediator;
+
+ @Override
+ public void onCreate() {
+ if (mKeyguardViewMediator == null) {
+ mKeyguardViewMediator = new KeyguardViewMediator(
+ KeyguardService.this, new LockPatternUtils(KeyguardService.this));
+ }
+ Log.v(TAG, "onCreate()");
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+ @Override
+ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ // TODO
+ }
+
+ private final IKeyguardService.Stub mBinder = new IKeyguardService.Stub() {
+ public boolean isShowing() {
+ return mKeyguardViewMediator.isShowing();
+ }
+ public boolean isSecure() {
+ return mKeyguardViewMediator.isSecure();
+ }
+ public boolean isShowingAndNotHidden() {
+ return mKeyguardViewMediator.isShowingAndNotHidden();
+ }
+ public boolean isInputRestricted() {
+ return mKeyguardViewMediator.isInputRestricted();
+ }
+ public void userActivity() {
+ mKeyguardViewMediator.userActivity();
+ }
+ public void verifyUnlock(IKeyguardResult result) {
+ mKeyguardViewMediator.verifyUnlock(result);
+ }
+ public void keyguardDone(boolean authenticated, boolean wakeup) {
+ mKeyguardViewMediator.keyguardDone(authenticated, wakeup);
+ }
+ public void setHidden(boolean isHidden) {
+ mKeyguardViewMediator.setHidden(isHidden);
+ }
+ public void dismiss() {
+ mKeyguardViewMediator.dismiss();
+ }
+ public void onWakeKeyWhenKeyguardShowingTq(int keyCode) {
+ mKeyguardViewMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
+ }
+ public void onWakeMotionWhenKeyguardShowingTq() {
+ mKeyguardViewMediator.onWakeMotionWhenKeyguardShowingTq();
+ }
+ public void onDreamingStarted() {
+ mKeyguardViewMediator.onDreamingStarted();
+ }
+ public void onDreamingStopped() {
+ mKeyguardViewMediator.onDreamingStopped();
+ }
+ public void onScreenTurnedOff(int reason) {
+ mKeyguardViewMediator.onScreenTurnedOff(reason);
+ }
+ public void onScreenTurnedOn(IKeyguardResult result) {
+ mKeyguardViewMediator.onScreenTurnedOn(result);
+ }
+ public void setKeyguardEnabled(boolean enabled) {
+ mKeyguardViewMediator.setKeyguardEnabled(enabled);
+ }
+ public boolean isDismissable() {
+ return mKeyguardViewMediator.isDismissable();
+ }
+ public void onSystemReady() {
+ mKeyguardViewMediator.onSystemReady();
+ }
+ public void doKeyguardTimeout(Bundle options) {
+ mKeyguardViewMediator.doKeyguardTimeout(options);
+ }
+ public void setCurrentUser(int userId) {
+ mKeyguardViewMediator.setCurrentUser(userId);
+ }
+ public void showAssistant() {
+ mKeyguardViewMediator.showAssistant();
+ }
+ };
+
+}
+
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
index ab364ee..865a7c4 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import com.android.internal.telephony.ITelephony;
@@ -33,8 +33,6 @@
import android.view.WindowManager;
import android.widget.TextView.OnEditorActionListener;
-import com.android.internal.R;
-
/**
* Displays a PIN pad for unlocking.
*/
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
index e5b4b73..7424fab 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
@@ -13,12 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
+
+import com.android.internal.telephony.ITelephony;
+
+import android.content.Context;
import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
-import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.text.Editable;
@@ -30,10 +33,6 @@
import android.view.WindowManager;
import android.widget.TextView.OnEditorActionListener;
-import com.android.internal.telephony.ITelephony;
-
-import com.android.internal.R;
-
/**
* Displays a PIN pad for entering a PUK (Pin Unlock Kode) provided by a carrier.
*/
@@ -72,8 +71,7 @@
} else if (state == CONFIRM_PIN) {
if (confirmPin()) {
state = DONE;
- msg =
- com.android.internal.R.string.lockscreen_sim_unlock_progress_dialog_message;
+ msg = R.string.keyguard_sim_unlock_progress_dialog_message;
updateSim();
} else {
state = ENTER_PIN; // try again?
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
similarity index 94%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
index d938cec..29f76f3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardStatusView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.content.res.Resources;
@@ -26,7 +26,6 @@
import android.widget.GridLayout;
import android.widget.TextView;
-import com.android.internal.R;
import com.android.internal.widget.LockPatternUtils;
import java.text.SimpleDateFormat;
@@ -40,7 +39,7 @@
private static final String TAG = "KeyguardStatusView";
public static final int LOCK_ICON = 0; // R.drawable.ic_lock_idle_lock;
- public static final int ALARM_ICON = com.android.internal.R.drawable.ic_lock_idle_alarm;
+ public static final int ALARM_ICON = R.drawable.ic_lock_idle_alarm;
public static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging;
public static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery;
@@ -84,8 +83,7 @@
super.onFinishInflate();
Resources res = getContext().getResources();
final Locale locale = Locale.getDefault();
- final String datePattern =
- res.getString(com.android.internal.R.string.system_ui_date_pattern);
+ final String datePattern = res.getString(R.string.system_ui_date_pattern);
final String bestFormat = ICU.getBestDateTimePattern(datePattern, locale.toString());
mDateFormat = new SimpleDateFormat(bestFormat, locale);
mDateView = (TextView) findViewById(R.id.date);
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusViewManager.java
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusViewManager.java
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardTestActivity.java b/packages/Keyguard/src/com/android/keyguard/KeyguardTestActivity.java
new file mode 100644
index 0000000..3deaeed
--- /dev/null
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardTestActivity.java
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2012 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.keyguard;
+
+import com.android.internal.policy.IKeyguardResult;
+import com.android.internal.policy.IKeyguardService;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.admin.DevicePolicyManager;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.WindowManagerPolicy;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.internal.widget.LockPatternView.Cell;
+
+import java.util.List;
+
+public class KeyguardTestActivity extends Activity implements OnClickListener {
+ private static final String KEYGUARD_PACKAGE = "com.android.keyguard";
+ private static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService";
+ private static final String TAG = "LockScreenTestActivity";
+ private static final int MODE_NONE = 0;
+ private static final int MODE_PIN = 1;
+ private static final int MODE_PASSWORD = 2;
+ private static final int MODE_PATTERN = 3;
+ private static final int MODE_SIM_PIN = 4;
+ private static final int MODE_SIM_PUK = 5;
+ private static final String SECURITY_MODE = "security_mode";
+
+ IKeyguardService mService = null;
+
+ KeyguardResult mKeyguardResult = new KeyguardResult();
+ RemoteServiceConnection mConnection;
+ private boolean mSentSystemReady;
+
+ class KeyguardResult extends IKeyguardResult.Stub {
+
+ @Override
+ public void onShown(IBinder windowToken) throws RemoteException {
+ Log.v(TAG, "Keyguard is shown, windowToken = " + windowToken);
+ }
+
+ @Override
+ public void onKeyguardExitResult(boolean success) throws RemoteException {
+ new AlertDialog.Builder(KeyguardTestActivity.this)
+ .setMessage("Result: " + success)
+ .setPositiveButton("OK", null)
+ .show();
+ }
+
+ };
+
+ private class RemoteServiceConnection implements ServiceConnection {
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ Log.v(TAG, "onServiceConnected()");
+ mService = IKeyguardService.Stub.asInterface(service);
+ try {
+ mService.asBinder().linkToDeath(new IBinder.DeathRecipient() {
+ @Override
+ public void binderDied() {
+ new AlertDialog.Builder(KeyguardTestActivity.this)
+ .setMessage("Oops! Keygued died")
+ .setPositiveButton("OK", null)
+ .show();
+ }
+ }, 0);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Couldn't linkToDeath");
+ e.printStackTrace();
+ }
+// try {
+// mService.onSystemReady();
+// } catch (RemoteException e) {
+// Log.v(TAG, "Remote service died trying to call onSystemReady");
+// e.printStackTrace();
+// }
+ }
+
+ public void onServiceDisconnected(ComponentName className) {
+ Log.v(TAG, "onServiceDisconnected()");
+ mService = null;
+ }
+ };
+
+ private void bindService() {
+ if (mConnection == null) {
+ mConnection = new RemoteServiceConnection();
+ Intent intent = new Intent();
+ intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
+ Log.v(TAG, "BINDING SERVICE: " + KEYGUARD_CLASS);
+ if (!bindService(intent, mConnection, Context.BIND_AUTO_CREATE)) {
+ Log.v(TAG, "FAILED TO BIND TO KEYGUARD!");
+ }
+ } else {
+ Log.v(TAG, "Service already bound");
+ }
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.keyguard_test_activity);
+ final int[] buttons = {
+ R.id.on_screen_turned_off, R.id.on_screen_turned_on,
+ R.id.do_keyguard, R.id.verify_unlock
+ };
+ for (int i = 0; i < buttons.length; i++) {
+ findViewById(buttons[i]).setOnClickListener(this);
+ }
+ Log.v(TAG, "Binding service...");
+ bindService();
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(SECURITY_MODE, mSecurityMode);
+ }
+
+ @Override
+ protected void onRestoreInstanceState(Bundle savedInstanceState) {
+ super.onRestoreInstanceState(savedInstanceState);
+ setMode(savedInstanceState.getInt(SECURITY_MODE));
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.optionmenu, menu);
+ return true;
+ }
+
+ private void setMode(int mode) {
+ mTestSimPin = false;
+ mTestSimPuk = false;
+ mLockPasswordEnabled = false;
+ mLockPatternEnabled = false;
+ switch(mode) {
+ case MODE_NONE:
+ mSecurityModeMock = DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
+ break;
+ case MODE_PIN:
+ mSecurityModeMock = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
+ mLockPasswordEnabled = true;
+ break;
+ case MODE_PASSWORD:
+ mSecurityModeMock = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
+ mLockPasswordEnabled = true;
+ break;
+ case MODE_PATTERN:
+ mSecurityModeMock = DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
+ mLockPatternEnabled = true;
+ break;
+ case MODE_SIM_PIN:
+ mTestSimPin = true;
+ break;
+ case MODE_SIM_PUK:
+ mTestSimPuk = true;
+ break;
+ }
+ mSecurityMode = mode;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle item selection
+ switch (item.getItemId()) {
+ case R.id.none_menu_item:
+ setMode(MODE_NONE);
+ break;
+ case R.id.pin_menu_item:
+ setMode(MODE_PIN);
+ break;
+ case R.id.password_menu_item:
+ setMode(MODE_PASSWORD);
+ break;
+ case R.id.pattern_menu_item:
+ setMode(MODE_PATTERN);
+ break;
+ case R.id.sim_pin_menu_item:
+ setMode(MODE_SIM_PIN);
+ break;
+ case R.id.sim_puk_menu_item:
+ setMode(MODE_SIM_PUK);
+ break;
+ case R.id.add_widget_item:
+ startWidgetPicker();
+ break;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ try {
+ mService.doKeyguardTimeout(null);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Remote service died");
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ private void startWidgetPicker() {
+ startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS));
+ }
+
+ @Override
+ public void onClick(View v) {
+ try {
+ switch (v.getId()) {
+ case R.id.on_screen_turned_on:
+ mService.onScreenTurnedOn(mKeyguardResult);
+ break;
+ case R.id.on_screen_turned_off:
+ mService.onScreenTurnedOff(WindowManagerPolicy.OFF_BECAUSE_OF_USER);
+ break;
+ case R.id.do_keyguard:
+ if (!mSentSystemReady) {
+ mSentSystemReady = true;
+ mService.onSystemReady();
+ }
+ mService.doKeyguardTimeout(null);
+ break;
+ case R.id.verify_unlock:
+ mService.verifyUnlock(mKeyguardResult);
+ break;
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Remote service died");
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ try {
+ if (mService != null) {
+ mService.setHidden(true);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Remote service died");
+ e.printStackTrace();
+ }
+ }
+
+ protected void onResume() {
+ super.onResume();
+ try {
+ if (mService != null) {
+ mService.setHidden(false);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Remote service died");
+ e.printStackTrace();
+ }
+ }
+
+ public int mSecurityModeMock;
+ private boolean mTestSimPin;
+ private boolean mTestSimPuk;
+ private boolean mLockPasswordEnabled;
+ public boolean mLockPatternEnabled;
+ private int mSecurityMode;
+
+ class LockPatternUtilsMock extends LockPatternUtils {
+ private long mDeadline;
+ public LockPatternUtilsMock(Context context) {
+ super(context);
+ }
+
+ @Override
+ public boolean checkPattern(List<Cell> pattern) {
+ return pattern.size() > 4;
+ }
+
+ @Override
+ public boolean checkPassword(String password) {
+ return password.length() > 4;
+ }
+ @Override
+ public long setLockoutAttemptDeadline() {
+ final long deadline = SystemClock.elapsedRealtime() + FAILED_ATTEMPT_TIMEOUT_MS;
+ mDeadline = deadline;
+ return deadline;
+ }
+ @Override
+ public boolean isLockScreenDisabled() {
+ return false;
+ }
+ @Override
+ public long getLockoutAttemptDeadline() {
+ return mDeadline;
+ }
+ @Override
+ public void reportFailedPasswordAttempt() {
+ // Ignored
+ }
+ @Override
+ public void reportSuccessfulPasswordAttempt() {
+ // Ignored
+ }
+ @Override
+ public boolean isLockPatternEnabled() {
+ return mLockPatternEnabled;
+ }
+
+ @Override
+ public boolean isLockPasswordEnabled() {
+ return mLockPasswordEnabled;
+ }
+
+ @Override
+ public int getKeyguardStoredPasswordQuality() {
+ return mSecurityModeMock;
+ }
+
+ public boolean isSecure() {
+ return mLockPatternEnabled || mLockPasswordEnabled || mTestSimPin || mTestSimPuk;
+ }
+
+ }
+}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardTransportControlView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
similarity index 95%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardTransportControlView.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
index ffa88d5..07be2cc 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardTransportControlView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
@@ -44,8 +44,6 @@
import android.widget.ImageView;
import android.widget.TextView;
-import com.android.internal.R;
-
import java.lang.ref.WeakReference;
/**
* This is the widget responsible for showing music controls in keyguard.
@@ -356,26 +354,26 @@
final int imageDescId;
switch (state) {
case RemoteControlClient.PLAYSTATE_ERROR:
- imageResId = com.android.internal.R.drawable.stat_sys_warning;
+ imageResId = R.drawable.stat_sys_warning;
// TODO use more specific image description string for warning, but here the "play"
// message is still valid because this button triggers a play command.
- imageDescId = com.android.internal.R.string.lockscreen_transport_play_description;
+ imageDescId = R.string.keyguard_transport_play_description;
break;
case RemoteControlClient.PLAYSTATE_PLAYING:
- imageResId = com.android.internal.R.drawable.ic_media_pause;
- imageDescId = com.android.internal.R.string.lockscreen_transport_pause_description;
+ imageResId = R.drawable.ic_media_pause;
+ imageDescId = R.string.keyguard_transport_pause_description;
break;
case RemoteControlClient.PLAYSTATE_BUFFERING:
- imageResId = com.android.internal.R.drawable.ic_media_stop;
- imageDescId = com.android.internal.R.string.lockscreen_transport_stop_description;
+ imageResId = R.drawable.ic_media_stop;
+ imageDescId = R.string.keyguard_transport_stop_description;
break;
case RemoteControlClient.PLAYSTATE_PAUSED:
default:
- imageResId = com.android.internal.R.drawable.ic_media_play;
- imageDescId = com.android.internal.R.string.lockscreen_transport_play_description;
+ imageResId = R.drawable.ic_media_play;
+ imageDescId = R.string.keyguard_transport_play_description;
break;
}
mBtnPlay.setImageResource(imageResId);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index c9bffbe..ff0dee7 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.ActivityManagerNative;
import android.app.IUserSwitchObserver;
@@ -37,7 +37,6 @@
import android.os.IRemoteCallback;
import android.os.Message;
import android.os.RemoteException;
-import android.os.UserHandle;
import android.provider.Settings;
import com.android.internal.telephony.IccCardConstants;
@@ -45,7 +44,6 @@
import android.telephony.TelephonyManager;
import android.util.Log;
-import com.android.internal.R;
import com.google.android.collect.Lists;
import java.lang.ref.WeakReference;
@@ -466,7 +464,7 @@
}
/**
- * We need to store this state in the KeyguardUpdateMonitor since this class will not be
+ * We need to store this state in the KeyguardUpdateMonitor since this class will not be
* destroyed.
*/
public boolean hasBootCompleted() {
@@ -675,7 +673,7 @@
* @return The default plmn (no service)
*/
private CharSequence getDefaultPlmn() {
- return mContext.getResources().getText(R.string.lockscreen_carrier_default);
+ return mContext.getResources().getText(R.string.keyguard_carrier_default);
}
/**
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitorCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitorCallback.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
index 2126f06..12ffcc3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitorCallback.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.admin.DevicePolicyManager;
import android.media.AudioManager;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewBase.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewBase.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
index 6fcacd3..200fb3c 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewBase.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.app.Activity;
import android.content.Context;
@@ -260,5 +260,4 @@
KeyguardViewMediator.ViewMediatorCallback viewMediatorCallback) {
mViewMediatorCallback = viewMediatorCallback;
}
-
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
similarity index 92%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
index 8562f0c..dac52ad 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
+
+import com.android.internal.policy.IKeyguardResult;
+import com.android.internal.widget.LockPatternUtils;
import android.app.Activity;
import android.app.ActivityManager;
@@ -28,6 +31,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcelable;
+import android.os.RemoteException;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Slog;
@@ -40,9 +44,6 @@
import android.view.WindowManager;
import android.widget.FrameLayout;
-import com.android.internal.R;
-import com.android.internal.widget.LockPatternUtils;
-
/**
* Manages creating, showing, hiding and resetting the keyguard. Calls back
* via {@link KeyguardViewMediator.ViewMediatorCallback} to poke
@@ -119,7 +120,7 @@
private boolean shouldEnableScreenRotation() {
Resources res = mContext.getResources();
return SystemProperties.getBoolean("lockscreen.rot_override",false)
- || res.getBoolean(com.android.internal.R.bool.config_enableLockScreenRotation);
+ || res.getBoolean(R.bool.config_enableLockScreenRotation);
}
class ViewManagerHost extends FrameLayout {
@@ -194,12 +195,11 @@
}
final int stretch = ViewGroup.LayoutParams.MATCH_PARENT;
- final int type = isActivity ? WindowManager.LayoutParams.TYPE_APPLICATION
- : WindowManager.LayoutParams.TYPE_KEYGUARD;
+ final int type = WindowManager.LayoutParams.TYPE_KEYGUARD;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
stretch, stretch, type, flags, PixelFormat.TRANSLUCENT);
lp.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
- lp.windowAnimations = com.android.internal.R.style.Animation_LockScreen;
+ lp.windowAnimations = R.style.Animation_LockScreen;
if (ActivityManager.isHighEndGfx()) {
lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
lp.privateFlags |=
@@ -331,8 +331,7 @@
}
}
- public synchronized void onScreenTurnedOn(
- final KeyguardViewManager.ShowListener showListener) {
+ public synchronized void onScreenTurnedOn(final IKeyguardResult result) {
if (DEBUG) Log.d(TAG, "onScreenTurnedOn()");
mScreenOn = true;
if (mKeyguardView != null) {
@@ -340,26 +339,41 @@
// Caller should wait for this window to be shown before turning
// on the screen.
- if (showListener != null) {
+ if (result != null) {
if (mKeyguardHost.getVisibility() == View.VISIBLE) {
// Keyguard may be in the process of being shown, but not yet
// updated with the window manager... give it a chance to do so.
mKeyguardHost.post(new Runnable() {
@Override
public void run() {
+ IBinder token = null;
if (mKeyguardHost.getVisibility() == View.VISIBLE) {
- showListener.onShown(mKeyguardHost.getWindowToken());
- } else {
- showListener.onShown(null);
+ token = mKeyguardHost.getWindowToken();
+ }
+ try {
+ result.onShown(token);
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
}
});
} else {
- showListener.onShown(null);
+ try {
+ result.onShown(null);
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}
- } else if (showListener != null) {
- showListener.onShown(null);
+ } else if (result != null) {
+ try {
+ result.onShown(null);
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
similarity index 94%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
index 8e10528..f8fbddf 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
+import com.android.internal.policy.IKeyguardResult;
import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
import android.app.Activity;
@@ -219,7 +220,7 @@
* how we'll ultimately let them know whether it was successful. We use this
* var being non-null as an indicator that there is an in progress request.
*/
- private WindowManagerPolicy.OnKeyguardExitResult mExitSecureCallback;
+ private IKeyguardResult mExitSecureCallback;
// the properties of the keyguard
@@ -347,7 +348,7 @@
// flicker while turning back on the screen and disabling the keyguard again).
if (DEBUG) Log.d(TAG, "screen is off and call ended, let's make sure the "
+ "keyguard is showing");
- doKeyguardLocked();
+ doKeyguardLocked(null);
}
}
};
@@ -377,7 +378,7 @@
if (DEBUG) Log.d(TAG, "ICC_ABSENT isn't showing,"
+ " we need to show the keyguard since the "
+ "device isn't provisioned yet.");
- doKeyguardLocked();
+ doKeyguardLocked(null);
} else {
resetStateLocked(null);
}
@@ -390,7 +391,7 @@
if (!isShowing()) {
if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_LOCKED and keygaurd isn't "
+ "showing; need to show keyguard so user can enter sim pin");
- doKeyguardLocked();
+ doKeyguardLocked(null);
} else {
resetStateLocked(null);
}
@@ -401,7 +402,7 @@
if (!isShowing()) {
if (DEBUG) Log.d(TAG, "PERM_DISABLED and "
+ "keygaurd isn't showing.");
- doKeyguardLocked();
+ doKeyguardLocked(null);
} else {
if (DEBUG) Log.d(TAG, "PERM_DISABLED, resetStateLocked to"
+ "show permanently disabled message in lockscreen.");
@@ -558,7 +559,7 @@
mUpdateMonitor.setAlternateUnlockEnabled(true);
}
- doKeyguardLocked();
+ doKeyguardLocked(null);
}
// Most services aren't available until the system reaches the ready state, so we
// send it here when the device first boots.
@@ -586,7 +587,11 @@
if (mExitSecureCallback != null) {
if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled");
- mExitSecureCallback.onKeyguardExitResult(false);
+ try {
+ mExitSecureCallback.onKeyguardExitResult(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
mExitSecureCallback = null;
if (!mExternallyEnabled) {
hideLocked();
@@ -600,7 +605,7 @@
} else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR) {
// Do not enable the keyguard if the prox sensor forced the screen off.
} else {
- doKeyguardLocked();
+ doKeyguardLocked(null);
}
}
}
@@ -638,7 +643,7 @@
if (timeout <= 0) {
// Lock now
mSuppressNextLockSound = true;
- doKeyguardLocked();
+ doKeyguardLocked(null);
} else {
// Lock in the future
long when = SystemClock.elapsedRealtime() + timeout;
@@ -659,13 +664,13 @@
/**
* Let's us know the screen was turned on.
*/
- public void onScreenTurnedOn(KeyguardViewManager.ShowListener showListener) {
+ public void onScreenTurnedOn(IKeyguardResult result) {
synchronized (this) {
mScreenOn = true;
cancelDoKeyguardLaterLocked();
if (DEBUG) Log.d(TAG, "onScreenTurnedOn, seq = " + mDelayedShowingSequence);
- if (showListener != null) {
- notifyScreenOnLocked(showListener);
+ if (result != null) {
+ notifyScreenOnLocked(result);
}
}
maybeSendUserPresentBroadcast();
@@ -736,7 +741,11 @@
if (mExitSecureCallback != null) {
if (DEBUG) Log.d(TAG, "onKeyguardExitResult(false), resetting");
- mExitSecureCallback.onKeyguardExitResult(false);
+ try {
+ mExitSecureCallback.onKeyguardExitResult(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
mExitSecureCallback = null;
resetStateLocked(null);
} else {
@@ -764,24 +773,36 @@
/**
* @see android.app.KeyguardManager#exitKeyguardSecurely
*/
- public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback) {
+ public void verifyUnlock(IKeyguardResult result) {
synchronized (this) {
if (DEBUG) Log.d(TAG, "verifyUnlock");
if (!mUpdateMonitor.isDeviceProvisioned()) {
// don't allow this api when the device isn't provisioned
if (DEBUG) Log.d(TAG, "ignoring because device isn't provisioned");
- callback.onKeyguardExitResult(false);
+ try {
+ result.onKeyguardExitResult(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
} else if (mExternallyEnabled) {
// this only applies when the user has externally disabled the
// keyguard. this is unexpected and means the user is not
// using the api properly.
Log.w(TAG, "verifyUnlock called when not externally disabled");
- callback.onKeyguardExitResult(false);
+ try {
+ result.onKeyguardExitResult(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
} else if (mExitSecureCallback != null) {
// already in progress with someone else
- callback.onKeyguardExitResult(false);
+ try {
+ result.onKeyguardExitResult(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
} else {
- mExitSecureCallback = callback;
+ mExitSecureCallback = result;
verifyUnlockLocked();
}
}
@@ -844,10 +865,6 @@
return mShowing || mNeedToReshowWhenReenabled || !mUpdateMonitor.isDeviceProvisioned();
}
- private void doKeyguardLocked() {
- doKeyguardLocked(null);
- }
-
/**
* Enable the keyguard if the settings are appropriate.
*/
@@ -945,9 +962,9 @@
* @see #onScreenTurnedOn()
* @see #handleNotifyScreenOn
*/
- private void notifyScreenOnLocked(KeyguardViewManager.ShowListener showListener) {
+ private void notifyScreenOnLocked(IKeyguardResult result) {
if (DEBUG) Log.d(TAG, "notifyScreenOnLocked");
- Message msg = mHandler.obtainMessage(NOTIFY_SCREEN_ON, showListener);
+ Message msg = mHandler.obtainMessage(NOTIFY_SCREEN_ON, result);
mHandler.sendMessage(msg);
}
@@ -1020,7 +1037,7 @@
if (mDelayedShowingSequence == sequence) {
// Don't play lockscreen SFX if the screen went off due to timeout.
mSuppressNextLockSound = true;
- doKeyguardLocked();
+ doKeyguardLocked(null);
}
}
}
@@ -1080,7 +1097,12 @@
}
if (mExitSecureCallback != null) {
- mExitSecureCallback.onKeyguardExitResult(authenticated);
+ try {
+ mExitSecureCallback.onKeyguardExitResult(authenticated);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
mExitSecureCallback = null;
if (authenticated) {
@@ -1120,7 +1142,7 @@
handleNotifyScreenOff();
return;
case NOTIFY_SCREEN_ON:
- handleNotifyScreenOn((KeyguardViewManager.ShowListener)msg.obj);
+ handleNotifyScreenOn((IKeyguardResult) msg.obj);
return;
case WAKE_WHEN_READY:
handleWakeWhenReady(msg.arg1);
@@ -1164,10 +1186,11 @@
}
private void sendUserPresentBroadcast() {
- if (!(mContext instanceof Activity)) {
- final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
- mContext.sendBroadcastAsUser(mUserPresentIntent, currentUser);
- }
+ // TODO
+// if (!(mContext instanceof Activity)) {
+// final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
+// mContext.sendBroadcastAsUser(mUserPresentIntent, currentUser);
+// }
}
/**
@@ -1176,7 +1199,7 @@
*/
private void handleKeyguardDoneDrawing() {
synchronized(this) {
- if (false) Log.d(TAG, "handleKeyguardDoneDrawing");
+ if (DEBUG) Log.d(TAG, "handleKeyguardDoneDrawing");
if (mWaitingUntilKeyguardVisible) {
if (DEBUG) Log.d(TAG, "handleKeyguardDoneDrawing: notifying mWaitingUntilKeyguardVisible");
mWaitingUntilKeyguardVisible = false;
@@ -1232,8 +1255,12 @@
*/
private void handleShow(Bundle options) {
synchronized (KeyguardViewMediator.this) {
- if (DEBUG) Log.d(TAG, "handleShow");
- if (!mSystemReady) return;
+ if (!mSystemReady) {
+ if (DEBUG) Log.d(TAG, "ignoring handleShow because system is not ready.");
+ return;
+ } else {
+ if (DEBUG) Log.d(TAG, "handleShow");
+ }
mKeyguardViewManager.show(options);
mShowing = true;
@@ -1406,10 +1433,10 @@
* Handle message sent by {@link #notifyScreenOnLocked()}
* @see #NOTIFY_SCREEN_ON
*/
- private void handleNotifyScreenOn(KeyguardViewManager.ShowListener showListener) {
+ private void handleNotifyScreenOn(IKeyguardResult result) {
synchronized (KeyguardViewMediator.this) {
if (DEBUG) Log.d(TAG, "handleNotifyScreenOn");
- mKeyguardViewManager.onScreenTurnedOn(showListener);
+ mKeyguardViewManager.onScreenTurnedOn(result);
}
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
index 0a166e1..880fddd 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.appwidget.AppWidgetManager;
import android.os.Handler;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetCarousel.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardWidgetCarousel.java
index 257fd27..98b31b7 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetCarousel.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -26,8 +26,6 @@
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
-import com.android.internal.R;
-
import java.util.ArrayList;
public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
index babb9cb..81f6221 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.ObjectAnimator;
@@ -37,8 +37,6 @@
import android.view.View;
import android.widget.FrameLayout;
-import com.android.internal.R;
-
public class KeyguardWidgetFrame extends FrameLayout {
private final static PorterDuffXfermode sAddBlendMode =
new PorterDuffXfermode(PorterDuff.Mode.ADD);
@@ -114,9 +112,9 @@
// This will be overriden on phones based on the current security mode, however on tablets
// we need to specify a height.
mSmallWidgetHeight =
- res.getDimensionPixelSize(com.android.internal.R.dimen.kg_small_widget_height);
+ res.getDimensionPixelSize(R.dimen.kg_small_widget_height);
mBackgroundDrawable = res.getDrawable(R.drawable.kg_widget_bg_padded);
- mGradientColor = res.getColor(com.android.internal.R.color.kg_widget_pager_gradient);
+ mGradientColor = res.getColor(R.color.kg_widget_pager_gradient);
mGradientPaint.setXfermode(sAddBlendMode);
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
rename to packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
index ad5e257..0d92e11 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -350,7 +350,7 @@
View content = (widget == frame) ? frame.getContent() : widget;
if (content != null) {
String contentDescription = mContext.getString(
- com.android.internal.R.string.keyguard_accessibility_widget,
+ R.string.keyguard_accessibility_widget,
content.getContentDescription());
frame.setContentDescription(contentDescription);
}
@@ -846,7 +846,7 @@
setCurrentPage(mCurrentPage + 1);
mAddWidgetView = null;
} else if (mAddWidgetView == null && !enabled) {
- View addWidget = findViewById(com.android.internal.R.id.keyguard_add_widget);
+ View addWidget = findViewById(R.id.keyguard_add_widget);
if (addWidget != null) {
mAddWidgetView = addWidget;
removeView(addWidget);
@@ -856,7 +856,7 @@
boolean isAddPage(int pageIndex) {
View v = getChildAt(pageIndex);
- return v != null && v.getId() == com.android.internal.R.id.keyguard_add_widget;
+ return v != null && v.getId() == R.id.keyguard_add_widget;
}
boolean isCameraPage(int pageIndex) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/LiftToActivateListener.java b/packages/Keyguard/src/com/android/keyguard/LiftToActivateListener.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/LiftToActivateListener.java
rename to packages/Keyguard/src/com/android/keyguard/LiftToActivateListener.java
index 818108c..e59602b 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/LiftToActivateListener.java
+++ b/packages/Keyguard/src/com/android/keyguard/LiftToActivateListener.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.view.MotionEvent;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/MultiPaneChallengeLayout.java b/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/MultiPaneChallengeLayout.java
rename to packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java
index 0ca46c3..8fd39c0 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/MultiPaneChallengeLayout.java
+++ b/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
-
-import com.android.internal.R;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -72,7 +70,7 @@
final TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.MultiPaneChallengeLayout, defStyleAttr, 0);
- mOrientation = a.getInt(R.styleable.MultiPaneChallengeLayout_orientation,
+ mOrientation = a.getInt(R.styleable.MultiPaneChallengeLayout_android_orientation,
HORIZONTAL);
a.recycle();
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/NumPadKey.java b/packages/Keyguard/src/com/android/keyguard/NumPadKey.java
similarity index 97%
rename from policy/src/com/android/internal/policy/impl/keyguard/NumPadKey.java
rename to packages/Keyguard/src/com/android/keyguard/NumPadKey.java
index a0038bc..532670f 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/NumPadKey.java
+++ b/packages/Keyguard/src/com/android/keyguard/NumPadKey.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.Context;
import android.content.res.TypedArray;
@@ -26,7 +26,6 @@
import android.widget.Button;
import android.widget.TextView;
-import com.android.internal.R;
import com.android.internal.widget.LockPatternUtils;
public class NumPadKey extends Button {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/ObscureSpeechDelegate.java b/packages/Keyguard/src/com/android/keyguard/ObscureSpeechDelegate.java
similarity index 98%
rename from policy/src/com/android/internal/policy/impl/keyguard/ObscureSpeechDelegate.java
rename to packages/Keyguard/src/com/android/keyguard/ObscureSpeechDelegate.java
index af043ab..573122a 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/ObscureSpeechDelegate.java
+++ b/packages/Keyguard/src/com/android/keyguard/ObscureSpeechDelegate.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.content.ContentResolver;
import android.content.Context;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java b/packages/Keyguard/src/com/android/keyguard/PagedView.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
rename to packages/Keyguard/src/com/android/keyguard/PagedView.java
index 539ec1a..5c2413a 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
+++ b/packages/Keyguard/src/com/android/keyguard/PagedView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -53,8 +53,6 @@
import android.view.animation.LinearInterpolator;
import android.widget.Scroller;
-import com.android.internal.R;
-
import java.util.ArrayList;
/**
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java b/packages/Keyguard/src/com/android/keyguard/SecurityMessageDisplay.java
similarity index 94%
rename from policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java
rename to packages/Keyguard/src/com/android/keyguard/SecurityMessageDisplay.java
index 7760279..e2f91e3 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/SecurityMessageDisplay.java
+++ b/packages/Keyguard/src/com/android/keyguard/SecurityMessageDisplay.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
+package com.android.keyguard;
public interface SecurityMessageDisplay {
public void setMessage(CharSequence msg, boolean important);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java b/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java
similarity index 99%
rename from policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java
rename to packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java
index 073225f..05b35a1 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java
+++ b/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.policy.impl.keyguard;
-
-import com.android.internal.R;
+package com.android.keyguard;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 66080f3..4bb44af 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
package="com.android.systemui"
+ android:sharedUserId="android.uid.systemui"
coreApp="true">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
@@ -71,6 +72,7 @@
android:hardwareAccelerated="true"
android:label="@string/app_label"
android:icon="@*android:drawable/platlogo"
+ android:process="com.android.systemui"
android:supportsRtl="true">
<!-- Broadcast receiver that gets the broadcast at boot time and starts
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index c40e26d..48edc73 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -189,7 +189,7 @@
<string name="quick_settings_location_label" msgid="3292451598267467545">"الموقع المستخدم"</string>
<string name="quick_settings_media_device_label" msgid="1302906836372603762">"جهاز الوسائط"</string>
<string name="quick_settings_rssi_label" msgid="7725671335550695589">"RSSI"</string>
- <string name="quick_settings_rssi_emergency_only" msgid="2713774041672886750">"مكالمات الطوارئ فقط"</string>
+ <string name="quick_settings_rssi_emergency_only" msgid="2713774041672886750">"مكالمات طوارئ فقط"</string>
<string name="quick_settings_settings_label" msgid="5326556592578065401">"الإعدادات"</string>
<string name="quick_settings_time_label" msgid="4635969182239736408">"الوقت"</string>
<string name="quick_settings_user_label" msgid="5238995632130897840">"أنا"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 8c2dd8e..580bfe7 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -147,7 +147,7 @@
<string name="accessibility_ringer_silent" msgid="9061243307939135383">"Mode silenci."</string>
<string name="accessibility_recents_item_dismissed" msgid="6803574935084867070">"S\'ha omès <xliff:g id="APP">%s</xliff:g>."</string>
<string name="accessibility_notification_dismissed" msgid="854211387186306927">"Notificació omesa."</string>
- <string name="accessibility_desc_notification_shade" msgid="4690274844447504208">"Capa de notificació."</string>
+ <string name="accessibility_desc_notification_shade" msgid="4690274844447504208">"Àrea de notificacions"</string>
<string name="accessibility_desc_quick_settings" msgid="6186378411582437046">"Configuració ràpida."</string>
<string name="accessibility_desc_recent_apps" msgid="9014032916410590027">"Aplicacions recents."</string>
<string name="accessibility_quick_settings_user" msgid="1104846699869476855">"Usuari <xliff:g id="USER">%s</xliff:g>."</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index d619de1..0789b29 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -133,7 +133,7 @@
<string name="accessibility_data_connection_wifi" msgid="2324496756590645221">"Wi-Fi"</string>
<string name="accessibility_no_sim" msgid="8274017118472455155">"No hay tarjeta SIM."</string>
<string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Conexión mediante Bluetooth"</string>
- <string name="accessibility_airplane_mode" msgid="834748999790763092">"Modo de avión"</string>
+ <string name="accessibility_airplane_mode" msgid="834748999790763092">"Modo avión"</string>
<!-- String.format failed for translation -->
<!-- no translation found for accessibility_battery_level (7451474187113371965) -->
<skip />
@@ -154,7 +154,7 @@
<string name="accessibility_quick_settings_wifi" msgid="6099781031669728709">"<xliff:g id="SIGNAL">%1$s</xliff:g>. <xliff:g id="NETWORK">%2$s</xliff:g>"</string>
<string name="accessibility_quick_settings_mobile" msgid="4876806564086241341">"Móvil <xliff:g id="SIGNAL">%1$s</xliff:g>. <xliff:g id="TYPE">%2$s</xliff:g>. <xliff:g id="NETWORK">%3$s</xliff:g>."</string>
<string name="accessibility_quick_settings_battery" msgid="1480931583381408972">"Batería <xliff:g id="STATE">%s</xliff:g>"</string>
- <string name="accessibility_quick_settings_airplane" msgid="4196876722090224753">"Modo de avión <xliff:g id="STATE">%s</xliff:g>"</string>
+ <string name="accessibility_quick_settings_airplane" msgid="4196876722090224753">"Modo avión <xliff:g id="STATE">%s</xliff:g>"</string>
<string name="accessibility_quick_settings_bluetooth" msgid="5749054971341882340">"Bluetooth <xliff:g id="STATE">%s</xliff:g>"</string>
<string name="accessibility_quick_settings_alarm" msgid="3959908972897295660">"Alarma: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="data_usage_disabled_dialog_3g_title" msgid="5257833881698644687">"Datos de 2G-3G inhabilitados"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index c454bb1..fff1aa0 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -157,14 +157,14 @@
<string name="accessibility_quick_settings_alarm" msgid="3959908972897295660">"Alarm ustawiony na <xliff:g id="TIME">%s</xliff:g>."</string>
<string name="data_usage_disabled_dialog_3g_title" msgid="5257833881698644687">"Wyłączono transmisję danych 2G/3G"</string>
<string name="data_usage_disabled_dialog_4g_title" msgid="4789143363492682629">"Wyłączono transmisję danych 4G"</string>
- <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Wyłączono komórkową transmisję danych"</string>
+ <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Transmisja danych została wyłączona"</string>
<string name="data_usage_disabled_dialog_title" msgid="2086815304858964954">"Wyłączono transmisję danych"</string>
- <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Osiągnięto określony limit wykorzystania transmisji danych."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć opłaty."</string>
+ <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Ustawiony limit transmisji danych został osiągnięty."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć dodatkowe opłaty."</string>
<string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Włącz transmisję danych"</string>
<string name="status_bar_settings_signal_meter_disconnected" msgid="1940231521274147771">"Brak internetu"</string>
<string name="status_bar_settings_signal_meter_wifi_nossid" msgid="6557486452774597820">"Wi-Fi: połączono"</string>
<string name="gps_notification_searching_text" msgid="8574247005642736060">"Wyszukiwanie sygnału GPS"</string>
- <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja ustawiona według GPS"</string>
+ <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja z GPSa"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Usuń wszystkie powiadomienia."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"O aplikacji"</string>
<string name="close_universe" msgid="3736513750241754348">"Zamknij"</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index ccf4fd48..3d0ddd4 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -77,7 +77,7 @@
<string name="use_ptp_button_title" msgid="7517127540301625751">"Установить как камеру (PTP)"</string>
<string name="installer_cd_button_title" msgid="2312667578562201583">"Установить приложение"</string>
<string name="accessibility_back" msgid="567011538994429120">"Назад"</string>
- <string name="accessibility_home" msgid="8217216074895377641">"Главная страница"</string>
+ <string name="accessibility_home" msgid="8217216074895377641">"Домой"</string>
<string name="accessibility_menu" msgid="316839303324695949">"Меню"</string>
<string name="accessibility_recent" msgid="8571350598987952883">"Недавние приложения"</string>
<string name="accessibility_ime_switch_button" msgid="5032926134740456424">"Кнопка переключения способа ввода."</string>
@@ -118,8 +118,8 @@
<string name="accessibility_two_bars" msgid="6437363648385206679">"два деления"</string>
<string name="accessibility_three_bars" msgid="2648241415119396648">"три деления"</string>
<string name="accessibility_signal_full" msgid="9122922886519676839">"надежный сигнал"</string>
- <string name="accessibility_desc_on" msgid="2385254693624345265">"ВКЛ"</string>
- <string name="accessibility_desc_off" msgid="6475508157786853157">"ВЫКЛ"</string>
+ <string name="accessibility_desc_on" msgid="2385254693624345265">"Вкл."</string>
+ <string name="accessibility_desc_off" msgid="6475508157786853157">"Выкл."</string>
<string name="accessibility_desc_connected" msgid="8366256693719499665">"Подключено"</string>
<string name="accessibility_data_connection_gprs" msgid="1606477224486747751">"GPRS"</string>
<string name="accessibility_data_connection_1x" msgid="994133468120244018">"1 X"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 91214d1..a58c9a0 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -181,7 +181,7 @@
<string name="quick_settings_battery_charged_label" msgid="8865413079414246081">"Laddat"</string>
<string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string>
<string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g> enheter)"</string>
- <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth inaktivt"</string>
+ <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth av"</string>
<string name="quick_settings_brightness_label" msgid="6968372297018755815">"Ljusstyrka"</string>
<string name="quick_settings_rotation_unlocked_label" msgid="336054930362580584">"Rotera automatiskt"</string>
<string name="quick_settings_rotation_locked_label" msgid="8058646447242565486">"Rotationen har låsts"</string>
@@ -196,9 +196,9 @@
<string name="quick_settings_wifi_label" msgid="9135344704899546041">"Wi-Fi"</string>
<string name="quick_settings_wifi_not_connected" msgid="7171904845345573431">"Ej ansluten"</string>
<string name="quick_settings_wifi_no_network" msgid="2221993077220856376">"Inget nätverk"</string>
- <string name="quick_settings_wifi_off_label" msgid="7558778100843885864">"Wi-Fi är inaktiverat"</string>
- <string name="quick_settings_wifi_display_label" msgid="6893592964463624333">"Wi-Fi visas"</string>
- <string name="quick_settings_wifi_display_no_connection_label" msgid="2355298740765736918">"Trådlös visning"</string>
+ <string name="quick_settings_wifi_off_label" msgid="7558778100843885864">"Wi-Fi av"</string>
+ <string name="quick_settings_wifi_display_label" msgid="6893592964463624333">"Trådlös skärm"</string>
+ <string name="quick_settings_wifi_display_no_connection_label" msgid="2355298740765736918">"Trådlös skärm"</string>
<string name="quick_settings_brightness_dialog_title" msgid="8599674057673605368">"Ljusstyrka"</string>
<string name="quick_settings_brightness_dialog_auto_brightness_label" msgid="5064982743784071218">"AUTO"</string>
<string name="status_bar_help_title" msgid="1199237744086469217">"Meddelanden visas här"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 7750e77..f43eabe 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -35,10 +35,10 @@
<string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Поточні"</string>
<string name="status_bar_latest_events_title" msgid="6594767438577593172">"Сповіщення"</string>
<string name="battery_low_title" msgid="2783104807551211639">"Підключіть зарядний пристрій"</string>
- <string name="battery_low_subtitle" msgid="1752040062087829196">"Батарея виснажується."</string>
+ <string name="battery_low_subtitle" msgid="1752040062087829196">"Акумулятор розряджається."</string>
<string name="battery_low_percent_format" msgid="1077244949318261761">"Залишилося <xliff:g id="NUMBER">%d%%</xliff:g>"</string>
<string name="invalid_charger" msgid="4549105996740522523">"Заряджання USB не підтримується."\n"Використовуйте лише наданий у комплекті зарядний пристрій."</string>
- <string name="battery_low_why" msgid="7279169609518386372">"Викор. батареї"</string>
+ <string name="battery_low_why" msgid="7279169609518386372">"Використання акумулятора"</string>
<string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Налаштування"</string>
<string name="status_bar_settings_wifi_button" msgid="1733928151698311923">"Wi-Fi"</string>
<string name="status_bar_settings_airplane" msgid="4879879698500955300">"Режим польоту"</string>
@@ -85,11 +85,11 @@
<string name="accessibility_compatibility_zoom_example" msgid="4220687294564945780">"Збільшення екрана."</string>
<string name="accessibility_bluetooth_connected" msgid="2707027633242983370">"Bluetooth під’єднано."</string>
<string name="accessibility_bluetooth_disconnected" msgid="7416648669976870175">"Bluetooth від’єднано."</string>
- <string name="accessibility_no_battery" msgid="358343022352820946">"Немає заряду батареї."</string>
- <string name="accessibility_battery_one_bar" msgid="7774887721891057523">"Одна смужка заряду батареї."</string>
- <string name="accessibility_battery_two_bars" msgid="8500650438735009973">"Дві смужки заряду батареї."</string>
- <string name="accessibility_battery_three_bars" msgid="2302983330865040446">"Три смужки заряду батареї."</string>
- <string name="accessibility_battery_full" msgid="8909122401720158582">"Повний заряд батареї"</string>
+ <string name="accessibility_no_battery" msgid="358343022352820946">"Акумулятор розряджений."</string>
+ <string name="accessibility_battery_one_bar" msgid="7774887721891057523">"Заряд акумулятора: одна смужка."</string>
+ <string name="accessibility_battery_two_bars" msgid="8500650438735009973">"Заряд акумулятора: дві смужки."</string>
+ <string name="accessibility_battery_three_bars" msgid="2302983330865040446">"Заряд акумулятора: три смужки."</string>
+ <string name="accessibility_battery_full" msgid="8909122401720158582">"Акумулятор заряджений."</string>
<string name="accessibility_no_phone" msgid="4894708937052611281">"Немає сигналу телефону."</string>
<string name="accessibility_phone_one_bar" msgid="687699278132664115">"Одна смужка сигналу телефону."</string>
<string name="accessibility_phone_two_bars" msgid="8384905382804815201">"Дві смужки сигналу телефону."</string>
@@ -134,7 +134,7 @@
<string name="accessibility_no_sim" msgid="8274017118472455155">"Немає SIM-карти."</string>
<string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Прив’язка Bluetooth."</string>
<string name="accessibility_airplane_mode" msgid="834748999790763092">"Режим польоту."</string>
- <string name="accessibility_battery_level" msgid="7451474187113371965">"Відсотків батареї: <xliff:g id="NUMBER">%d</xliff:g>."</string>
+ <string name="accessibility_battery_level" msgid="7451474187113371965">"Заряд акумулятора: <xliff:g id="NUMBER">%d</xliff:g>."</string>
<string name="accessibility_settings_button" msgid="799583911231893380">"Налаштування системи."</string>
<string name="accessibility_notifications_button" msgid="4498000369779421892">"Сповіщення."</string>
<string name="accessibility_remove_notification" msgid="3603099514902182350">"Очистити сповіщення."</string>
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java b/policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java
new file mode 100644
index 0000000..b87acfd
--- /dev/null
+++ b/policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2013 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.internal.policy.impl;
+
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.RemoteException;
+
+import com.android.internal.policy.IKeyguardResult;
+import com.android.internal.policy.IKeyguardService;
+
+/**
+ * A wrapper class for KeyguardService. It implements IKeyguardService to ensure the interface
+ * remains consistent.
+ *
+ */
+public class KeyguardServiceWrapper implements IKeyguardService {
+ private IKeyguardService mService;
+
+ public KeyguardServiceWrapper(IKeyguardService service) {
+ mService = service;
+ }
+
+ public boolean isShowing() {
+ try {
+ return mService.isShowing();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ public boolean isSecure() {
+ try {
+ return mService.isSecure();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false; // TODO cache state
+ }
+
+ public boolean isShowingAndNotHidden() {
+ try {
+ return mService.isShowingAndNotHidden();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false; // TODO cache state
+ }
+
+ public boolean isInputRestricted() {
+ try {
+ return mService.isInputRestricted();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false; // TODO cache state
+ }
+
+ public boolean isDismissable() {
+ try {
+ return mService.isDismissable();
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return true; // TODO cache state
+ }
+
+ public void userActivity() {
+ try {
+ mService.userActivity();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void verifyUnlock(IKeyguardResult result) {
+ try {
+ mService.verifyUnlock(result);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void keyguardDone(boolean authenticated, boolean wakeup) {
+ try {
+ mService.keyguardDone(authenticated, wakeup);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void setHidden(boolean isHidden) {
+ try {
+ mService.setHidden(isHidden);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void dismiss() {
+ try {
+ mService.dismiss();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onWakeKeyWhenKeyguardShowingTq(int keyCode) {
+ try {
+ mService.onWakeKeyWhenKeyguardShowingTq(keyCode);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onWakeMotionWhenKeyguardShowingTq() {
+ try {
+ mService.onWakeMotionWhenKeyguardShowingTq();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onDreamingStarted() {
+ try {
+ mService.onDreamingStarted();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onDreamingStopped() {
+ try {
+ mService.onDreamingStopped();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onScreenTurnedOff(int reason) {
+ try {
+ mService.onScreenTurnedOff(reason);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onScreenTurnedOn(IKeyguardResult result) {
+ try {
+ mService.onScreenTurnedOn(result);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void setKeyguardEnabled(boolean enabled) {
+ try {
+ mService.setKeyguardEnabled(enabled);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onSystemReady() {
+ try {
+ mService.onSystemReady();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void doKeyguardTimeout(Bundle options) {
+ try {
+ mService.doKeyguardTimeout(options);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void setCurrentUser(int userId) {
+ try {
+ mService.setCurrentUser(userId);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void showAssistant() {
+ try {
+ mService.showAssistant();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public IBinder asBinder() {
+ return mService.asBinder();
+ }
+
+}
\ No newline at end of file
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index bb05325..6b2637f 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -85,13 +85,13 @@
import android.view.WindowManagerGlobal;
import android.view.WindowManagerPolicy;
import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.android.internal.R;
import com.android.internal.policy.PolicyManager;
-import com.android.internal.policy.impl.keyguard.KeyguardViewManager;
-import com.android.internal.policy.impl.keyguard.KeyguardViewMediator;
+import com.android.internal.policy.impl.keyguard.KeyguardServiceDelegate;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.telephony.ITelephony;
import com.android.internal.widget.PointerLocationView;
@@ -151,6 +151,11 @@
static final int SYSTEM_UI_CHANGING_LAYOUT =
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
+ /**
+ * Keyguard stuff
+ */
+ private WindowState mKeyguardScrim;
+
/* Table of Application Launch keys. Maps from key codes to intent categories.
*
* These are special keys that are used to launch particular kinds of applications,
@@ -222,7 +227,7 @@
int[] mNavigationBarWidthForRotation = new int[4];
WindowState mKeyguard = null;
- KeyguardViewMediator mKeyguardMediator;
+ KeyguardServiceDelegate mKeyguardDelegate;
GlobalActions mGlobalActions;
volatile boolean mPowerKeyHandled; // accessed from input reader and handler thread
boolean mPendingPowerKeyUpCanceled;
@@ -436,6 +441,9 @@
private boolean mPowerKeyTriggered;
private long mPowerKeyTime;
+ /* The number of steps between min and max brightness */
+ private static final int BRIGHTNESS_STEPS = 10;
+
SettingsObserver mSettingsObserver;
ShortcutManager mShortcutManager;
PowerManager.WakeLock mBroadcastWakeLock;
@@ -656,7 +664,7 @@
}
private long getScreenshotChordLongPressDelay() {
- if (mKeyguardMediator.isShowing()) {
+ if (mKeyguardDelegate.isShowing()) {
// Double the time it takes to take a screenshot from the keyguard
return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
ViewConfiguration.getGlobalActionKeyTimeout());
@@ -719,7 +727,7 @@
if (keyguardShowing) {
// since it took two seconds of long press to bring this up,
// poke the wake lock so they have some time to see the dialog.
- mKeyguardMediator.userActivity();
+ mKeyguardDelegate.userActivity();
}
}
@@ -813,10 +821,6 @@
mWindowManager = windowManager;
mWindowManagerFuncs = windowManagerFuncs;
mHeadless = "1".equals(SystemProperties.get("ro.config.headless", "0"));
- if (!mHeadless) {
- // don't create KeyguardViewMediator if headless
- mKeyguardMediator = new KeyguardViewMediator(context, null);
- }
mHandler = new PolicyHandler();
mOrientationListener = new MyOrientationListener(mContext, mHandler);
try {
@@ -1228,6 +1232,7 @@
case TYPE_DISPLAY_OVERLAY:
case TYPE_HIDDEN_NAV_CONSUMER:
case TYPE_KEYGUARD:
+ case TYPE_KEYGUARD_SCRIM:
case TYPE_KEYGUARD_DIALOG:
case TYPE_MAGNIFICATION_OVERLAY:
case TYPE_NAVIGATION_BAR:
@@ -1344,54 +1349,57 @@
case TYPE_INPUT_METHOD_DIALOG:
// on-screen keyboards and other such input method user interfaces go here.
return 11;
+ case TYPE_KEYGUARD_SCRIM:
+ // the safety window that shows behind keyguard while keyguard is starting
+ return 12;
case TYPE_KEYGUARD:
// the keyguard; nothing on top of these can take focus, since they are
// responsible for power management when displayed.
- return 12;
- case TYPE_KEYGUARD_DIALOG:
return 13;
- case TYPE_STATUS_BAR_SUB_PANEL:
+ case TYPE_KEYGUARD_DIALOG:
return 14;
- case TYPE_STATUS_BAR:
+ case TYPE_STATUS_BAR_SUB_PANEL:
return 15;
- case TYPE_STATUS_BAR_PANEL:
+ case TYPE_STATUS_BAR:
return 16;
+ case TYPE_STATUS_BAR_PANEL:
+ return 17;
case TYPE_VOLUME_OVERLAY:
// the on-screen volume indicator and controller shown when the user
// changes the device volume
- return 17;
+ return 18;
case TYPE_SYSTEM_OVERLAY:
// the on-screen volume indicator and controller shown when the user
// changes the device volume
- return 18;
+ return 19;
case TYPE_NAVIGATION_BAR:
// the navigation bar, if available, shows atop most things
- return 19;
+ return 20;
case TYPE_NAVIGATION_BAR_PANEL:
// some panels (e.g. search) need to show on top of the navigation bar
- return 20;
+ return 21;
case TYPE_SYSTEM_ERROR:
// system-level error dialogs
- return 21;
+ return 22;
case TYPE_MAGNIFICATION_OVERLAY:
// used to highlight the magnified portion of a display
- return 22;
+ return 23;
case TYPE_DISPLAY_OVERLAY:
// used to simulate secondary display devices
- return 23;
+ return 24;
case TYPE_DRAG:
// the drag layer: input for drag-and-drop is associated with this window,
// which sits above all other focusable windows
- return 24;
- case TYPE_SECURE_SYSTEM_OVERLAY:
return 25;
- case TYPE_BOOT_PROGRESS:
+ case TYPE_SECURE_SYSTEM_OVERLAY:
return 26;
+ case TYPE_BOOT_PROGRESS:
+ return 27;
case TYPE_POINTER:
// the (mouse) pointer layer
- return 27;
- case TYPE_HIDDEN_NAV_CONSUMER:
return 28;
+ case TYPE_HIDDEN_NAV_CONSUMER:
+ return 29;
}
Log.e(TAG, "Unknown window type: " + type);
return 2;
@@ -1482,6 +1490,7 @@
case TYPE_DREAM:
case TYPE_UNIVERSE_BACKGROUND:
case TYPE_KEYGUARD:
+ case TYPE_KEYGUARD_SCRIM:
return false;
default:
return true;
@@ -1677,7 +1686,16 @@
return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON;
}
mKeyguard = win;
+ hideKeyguardScrim();
break;
+ case TYPE_KEYGUARD_SCRIM:
+ // TODO: put this back when done testing
+// if (mKeyguardScrim != null) {
+// return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON;
+// }
+ mKeyguardScrim = win;
+ break;
+
}
return WindowManagerGlobal.ADD_OKAY;
}
@@ -1687,12 +1705,25 @@
if (mStatusBar == win) {
mStatusBar = null;
} else if (mKeyguard == win) {
+ Log.v(TAG, "Removing keyguard window (Did it crash?)");
mKeyguard = null;
- } else if (mNavigationBar == win) {
+ showKeyguardScrimLw();
+ } else if (mKeyguardScrim == win) {
+ Log.v(TAG, "Removing keyguard scrim");
+ mKeyguardScrim = null;
+ } if (mNavigationBar == win) {
mNavigationBar = null;
}
}
+ private void showKeyguardScrimLw() {
+ Log.v(TAG, "*** SHOWING KEYGUARD SCRIM ***");
+ }
+
+ private void hideKeyguardScrim() {
+ Log.v(TAG, "*** HIDING KEYGUARD SCRIM ***");
+ }
+
static final boolean PRINT_ANIM = false;
/** {@inheritDoc} */
@@ -1916,6 +1947,7 @@
if (attrs != null) {
final int type = attrs.type;
if (type == WindowManager.LayoutParams.TYPE_KEYGUARD
+ || type == WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM
|| type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG) {
// the "app" is keyguard, so give it the key
return 0;
@@ -2034,6 +2066,43 @@
mHandler.post(mScreenshotRunnable);
}
return -1;
+ } else if (keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP
+ || keyCode == KeyEvent.KEYCODE_BRIGHTNESS_DOWN) {
+ if (down) {
+ int direction = keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP ? 1 : -1;
+
+ // Disable autobrightness if it's on
+ int auto = Settings.System.getIntForUser(
+ mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE,
+ Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
+ UserHandle.USER_CURRENT_OR_SELF);
+ if (auto != 0) {
+ Settings.System.putIntForUser(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE,
+ Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
+ UserHandle.USER_CURRENT_OR_SELF);
+ }
+
+ int min = mPowerManager.getMinimumScreenBrightnessSetting();
+ int max = mPowerManager.getMaximumScreenBrightnessSetting();
+ int step = (max - min + BRIGHTNESS_STEPS - 1) / BRIGHTNESS_STEPS * direction;
+ int brightness = Settings.System.getIntForUser(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS,
+ mPowerManager.getDefaultScreenBrightnessSetting(),
+ UserHandle.USER_CURRENT_OR_SELF);
+ brightness += step;
+ // Make sure we don't go beyond the limits.
+ brightness = Math.min(max, brightness);
+ brightness = Math.max(min, brightness);
+
+ Settings.System.putIntForUser(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS, brightness,
+ UserHandle.USER_CURRENT_OR_SELF);
+ Intent intent = new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG);
+ mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT_OR_SELF);
+ }
+ return -1;
}
// Shortcuts are invoked through Search+key, so intercept those here
@@ -2272,12 +2341,12 @@
* given the situation with the keyguard.
*/
void launchHomeFromHotKey() {
- if (mKeyguardMediator != null && mKeyguardMediator.isShowingAndNotHidden()) {
+ if (mKeyguardDelegate != null && mKeyguardDelegate.isShowingAndNotHidden()) {
// don't launch home if keyguard showing
- } else if (!mHideLockScreen && mKeyguardMediator.isInputRestricted()) {
+ } else if (!mHideLockScreen && mKeyguardDelegate.isInputRestricted()) {
// when in keyguard restricted mode, must first verify unlock
// before launching home
- mKeyguardMediator.verifyUnlock(new OnKeyguardExitResult() {
+ mKeyguardDelegate.verifyUnlock(new OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
try {
@@ -3259,17 +3328,17 @@
if (mKeyguard != null) {
if (localLOGV) Log.v(TAG, "finishPostLayoutPolicyLw: mHideKeyguard="
+ mHideLockScreen);
- if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !mKeyguardMediator.isSecure()) {
+ if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !mKeyguardDelegate.isSecure()) {
if (mKeyguard.hideLw(true)) {
changes |= FINISH_LAYOUT_REDO_LAYOUT
| FINISH_LAYOUT_REDO_CONFIG
| FINISH_LAYOUT_REDO_WALLPAPER;
}
- if (mKeyguardMediator.isShowing()) {
+ if (mKeyguardDelegate.isShowing()) {
mHandler.post(new Runnable() {
@Override
public void run() {
- mKeyguardMediator.keyguardDone(false, false);
+ mKeyguardDelegate.keyguardDone(false, false);
}
});
}
@@ -3279,7 +3348,7 @@
| FINISH_LAYOUT_REDO_CONFIG
| FINISH_LAYOUT_REDO_WALLPAPER;
}
- mKeyguardMediator.setHidden(true);
+ mKeyguardDelegate.setHidden(true);
} else if (mDismissKeyguard != DISMISS_KEYGUARD_NONE) {
// This is the case of keyguard isSecure() and not mHideLockScreen.
if (mDismissKeyguard == DISMISS_KEYGUARD_START) {
@@ -3289,11 +3358,11 @@
| FINISH_LAYOUT_REDO_CONFIG
| FINISH_LAYOUT_REDO_WALLPAPER;
}
- mKeyguardMediator.setHidden(false);
+ mKeyguardDelegate.setHidden(false);
mHandler.post(new Runnable() {
@Override
public void run() {
- mKeyguardMediator.dismiss();
+ mKeyguardDelegate.dismiss();
}
});
}
@@ -3304,7 +3373,7 @@
| FINISH_LAYOUT_REDO_CONFIG
| FINISH_LAYOUT_REDO_WALLPAPER;
}
- mKeyguardMediator.setHidden(false);
+ mKeyguardDelegate.setHidden(false);
}
}
@@ -3355,7 +3424,7 @@
if (lidOpen) {
if (keyguardIsShowingTq()) {
- mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(KeyEvent.KEYCODE_POWER);
+ mKeyguardDelegate.onWakeKeyWhenKeyguardShowingTq(KeyEvent.KEYCODE_POWER);
} else {
mPowerManager.wakeUp(SystemClock.uptimeMillis());
}
@@ -3535,10 +3604,10 @@
// the same as if it were open and in front.
// This will prevent any keys other than the power button from waking the screen
// when the keyguard is hidden by another activity.
- final boolean keyguardActive = (mKeyguardMediator == null ? false :
+ final boolean keyguardActive = (mKeyguardDelegate == null ? false :
(isScreenOn ?
- mKeyguardMediator.isShowingAndNotHidden() :
- mKeyguardMediator.isShowing()));
+ mKeyguardDelegate.isShowingAndNotHidden() :
+ mKeyguardDelegate.isShowing()));
if (keyCode == KeyEvent.KEYCODE_POWER) {
policyFlags |= WindowManagerPolicy.FLAG_WAKE;
@@ -3577,7 +3646,7 @@
if (down && isWakeKey && isWakeKeyWhenScreenOff(keyCode)) {
if (keyguardActive) {
// If the keyguard is showing, let it wake the device when ready.
- mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
+ mKeyguardDelegate.onWakeKeyWhenKeyguardShowingTq(keyCode);
} else {
// Otherwise, wake the device ourselves.
result |= ACTION_WAKE_UP;
@@ -3841,9 +3910,9 @@
final boolean isWakeMotion = (policyFlags
& (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
if (isWakeMotion) {
- if (mKeyguardMediator != null && mKeyguardMediator.isShowing()) {
+ if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) {
// If the keyguard is showing, let it decide what to do with the wake motion.
- mKeyguardMediator.onWakeMotionWhenKeyguardShowingTq();
+ mKeyguardDelegate.onWakeMotionWhenKeyguardShowingTq();
} else {
// Otherwise, wake the device ourselves.
result |= ACTION_WAKE_UP;
@@ -3926,12 +3995,12 @@
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_DREAMING_STARTED.equals(intent.getAction())) {
- if (mKeyguardMediator != null) {
- mKeyguardMediator.onDreamingStarted();
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.onDreamingStarted();
}
} else if (Intent.ACTION_DREAMING_STOPPED.equals(intent.getAction())) {
- if (mKeyguardMediator != null) {
- mKeyguardMediator.onDreamingStopped();
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.onDreamingStopped();
}
}
}
@@ -3965,8 +4034,8 @@
mScreenOnEarly = false;
mScreenOnFully = false;
}
- if (mKeyguardMediator != null) {
- mKeyguardMediator.onScreenTurnedOff(why);
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.onScreenTurnedOff(why);
}
synchronized (mLock) {
updateOrientationListenerLp();
@@ -3993,9 +4062,9 @@
}
private void waitForKeyguard(final ScreenOnListener screenOnListener) {
- if (mKeyguardMediator != null) {
+ if (mKeyguardDelegate != null) {
if (screenOnListener != null) {
- mKeyguardMediator.onScreenTurnedOn(new KeyguardViewManager.ShowListener() {
+ mKeyguardDelegate.onScreenTurnedOn(new KeyguardServiceDelegate.ShowListener() {
@Override
public void onShown(IBinder windowToken) {
waitForKeyguardWindowDrawn(windowToken, screenOnListener);
@@ -4003,10 +4072,10 @@
});
return;
} else {
- mKeyguardMediator.onScreenTurnedOn(null);
+ mKeyguardDelegate.onScreenTurnedOn(null);
}
} else {
- Slog.i(TAG, "No keyguard mediator!");
+ Slog.i(TAG, "No keyguard interface!");
}
finishScreenTurningOn(screenOnListener);
}
@@ -4061,21 +4130,21 @@
/** {@inheritDoc} */
public void enableKeyguard(boolean enabled) {
- if (mKeyguardMediator != null) {
- mKeyguardMediator.setKeyguardEnabled(enabled);
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.setKeyguardEnabled(enabled);
}
}
/** {@inheritDoc} */
public void exitKeyguardSecurely(OnKeyguardExitResult callback) {
- if (mKeyguardMediator != null) {
- mKeyguardMediator.verifyUnlock(callback);
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.verifyUnlock(callback);
}
}
private boolean keyguardIsShowingTq() {
- if (mKeyguardMediator == null) return false;
- return mKeyguardMediator.isShowingAndNotHidden();
+ if (mKeyguardDelegate == null) return false;
+ return mKeyguardDelegate.isShowingAndNotHidden();
}
@@ -4086,26 +4155,26 @@
/** {@inheritDoc} */
public boolean isKeyguardSecure() {
- if (mKeyguardMediator == null) return false;
- return mKeyguardMediator.isSecure();
+ if (mKeyguardDelegate == null) return false;
+ return mKeyguardDelegate.isSecure();
}
/** {@inheritDoc} */
public boolean inKeyguardRestrictedKeyInputMode() {
- if (mKeyguardMediator == null) return false;
- return mKeyguardMediator.isInputRestricted();
+ if (mKeyguardDelegate == null) return false;
+ return mKeyguardDelegate.isInputRestricted();
}
public void dismissKeyguardLw() {
- if (mKeyguardMediator.isShowing()) {
+ if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) {
mHandler.post(new Runnable() {
public void run() {
- if (mKeyguardMediator.isDismissable()) {
+ if (mKeyguardDelegate.isDismissable()) {
// Can we just finish the keyguard straight away?
- mKeyguardMediator.keyguardDone(false, true);
+ mKeyguardDelegate.keyguardDone(false, true);
} else {
// ask the keyguard to prompt the user to authenticate if necessary
- mKeyguardMediator.dismiss();
+ mKeyguardDelegate.dismiss();
}
}
});
@@ -4346,9 +4415,9 @@
/** {@inheritDoc} */
public void systemReady() {
- if (mKeyguardMediator != null) {
- // tell the keyguard
- mKeyguardMediator.onSystemReady();
+ if (!mHeadless) {
+ mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null);
+ mKeyguardDelegate.onSystemReady();
}
synchronized (mLock) {
updateOrientationListenerLp();
@@ -4460,8 +4529,8 @@
public void run() {
synchronized (this) {
if (localLOGV) Log.v(TAG, "mScreenLockTimeout activating keyguard");
- if (mKeyguardMediator != null) {
- mKeyguardMediator.doKeyguardTimeout(options);
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.doKeyguardTimeout(options);
}
mLockScreenTimerActive = false;
options = null;
@@ -4489,7 +4558,7 @@
private void updateLockScreenTimeout() {
synchronized (mScreenLockTimeout) {
boolean enable = (mAllowLockscreenWhenOn && mScreenOnEarly &&
- mKeyguardMediator != null && mKeyguardMediator.isSecure());
+ mKeyguardDelegate != null && mKeyguardDelegate.isSecure());
if (mLockScreenTimerActive != enable) {
if (enable) {
if (localLOGV) Log.v(TAG, "setting lockscreen timer");
@@ -4613,7 +4682,7 @@
}
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
- if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {
+ if (!always && (hapticsDisabled || mKeyguardDelegate.isShowingAndNotHidden())) {
return false;
}
long[] pattern = null;
@@ -4661,7 +4730,7 @@
@Override
public void keepScreenOnStoppedLw() {
- if (mKeyguardMediator != null && !mKeyguardMediator.isShowingAndNotHidden()) {
+ if (mKeyguardDelegate != null && !mKeyguardDelegate.isShowingAndNotHidden()) {
long curTime = SystemClock.uptimeMillis();
mPowerManager.userActivity(curTime, false);
}
@@ -4729,8 +4798,8 @@
@Override
public void setCurrentUserLw(int newUserId) {
- if (mKeyguardMediator != null) {
- mKeyguardMediator.setCurrentUser(newUserId);
+ if (mKeyguardDelegate != null) {
+ mKeyguardDelegate.setCurrentUser(newUserId);
}
if (mStatusBarService != null) {
try {
@@ -4744,7 +4813,7 @@
@Override
public void showAssistant() {
- mKeyguardMediator.showAssistant();
+ mKeyguardDelegate.showAssistant();
}
@Override
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java
new file mode 100644
index 0000000..0dd41e5
--- /dev/null
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java
@@ -0,0 +1,272 @@
+package com.android.internal.policy.impl.keyguard;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.UserHandle;
+import android.util.Log;
+import android.util.Slog;
+import android.view.WindowManagerPolicy.OnKeyguardExitResult;
+
+import com.android.internal.policy.IKeyguardResult;
+import com.android.internal.policy.IKeyguardService;
+import com.android.internal.widget.LockPatternUtils;
+import com.android.internal.policy.impl.KeyguardServiceWrapper;
+import com.android.internal.policy.impl.keyguard.KeyguardServiceDelegate.ShowListener;
+
+/**
+ * A local class that keeps a cache of keyguard state that can be restored in the event
+ * keyguard crashes. It currently also allows runtime-selectable
+ * local or remote instances of keyguard.
+ */
+public class KeyguardServiceDelegate {
+ private static final String KEYGUARD_PACKAGE = "com.android.keyguard";
+ private static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService";
+ private static final String TAG = "KeyguardServiceDelegate";
+ private final static boolean DEBUG = true;
+ private ServiceConnection mKeyguardConnection;
+ protected KeyguardServiceWrapper mKeyguardService;
+ private KeyguardState mKeyguardState = new KeyguardState();
+
+ /* package */ class KeyguardState {
+ boolean showing;
+ boolean showingAndNotHidden;
+ boolean inputRestricted;
+ boolean hidden;
+ boolean secure;
+ boolean dreaming;
+ boolean systemIsReady;
+ public boolean enabled;
+ public boolean dismissable;
+ public int offReason;
+ public int currentUser;
+ public boolean screenIsOn;
+ public boolean restoreStateWhenConnected;
+ public ShowListener showListener;
+ };
+
+ public interface ShowListener {
+ public void onShown(IBinder windowToken);
+ }
+
+ private class KeyguardResult extends IKeyguardResult.Stub {
+ private ShowListener mShowListener;
+ private OnKeyguardExitResult mOnKeyguardExitResult;
+
+ KeyguardResult(ShowListener showListener, OnKeyguardExitResult onKeyguardExitResult) {
+ mShowListener = showListener;
+ mOnKeyguardExitResult = onKeyguardExitResult;
+ }
+
+ @Override
+ public IBinder asBinder() {
+ if (DEBUG) Log.v(TAG, "asBinder() called for KeyguardResult, "
+ + "mShowListener = " + mShowListener
+ + ", mOnKeyguardExitResult = " + mOnKeyguardExitResult);
+ return super.asBinder();
+ }
+
+ @Override
+ public void onShown(IBinder windowToken) throws RemoteException {
+ if (DEBUG) Log.v(TAG, "**** SHOWN CALLED ****");
+ if (mShowListener != null) {
+ mShowListener.onShown(windowToken);
+ }
+ }
+
+ @Override
+ public void onKeyguardExitResult(boolean success) throws RemoteException {
+ if (DEBUG) Log.v(TAG, "**** onKeyguardExitResult(" + success +") CALLED ****");
+ if (mOnKeyguardExitResult != null) {
+ mOnKeyguardExitResult.onKeyguardExitResult(success);
+ }
+ }
+ };
+
+ public KeyguardServiceDelegate(Context context, LockPatternUtils lockPatternUtils) {
+ mKeyguardConnection = createServiceConnection();
+ Intent intent = new Intent();
+ intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
+ if (!context.bindServiceAsUser(intent, mKeyguardConnection,
+ Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
+ if (DEBUG) Log.v(TAG, "*** Keyguard: can't bind to " + KEYGUARD_CLASS);
+ } else {
+ if (DEBUG) Log.v(TAG, "*** Keyguard started");
+ }
+ }
+
+ private ServiceConnection createServiceConnection() {
+ return new ServiceConnection() {
+
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ if (DEBUG) Log.v(TAG, "*** Keyguard connected (yay!)");
+ mKeyguardService = new KeyguardServiceWrapper(
+ IKeyguardService.Stub.asInterface(service));
+ if (mKeyguardState.systemIsReady) {
+ mKeyguardService.onSystemReady();
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ if (DEBUG) Log.v(TAG, "*** Keyguard disconnected (boo!)");
+ mKeyguardService = null;
+ }
+
+ };
+ }
+
+ public boolean isShowing() {
+ if (mKeyguardService != null) {
+ mKeyguardState.showing = mKeyguardService.isShowing();
+ }
+ return mKeyguardState.showing;
+ }
+
+ public boolean isShowingAndNotHidden() {
+ if (mKeyguardService != null) {
+ mKeyguardState.showingAndNotHidden = mKeyguardService.isShowingAndNotHidden();
+ }
+ return mKeyguardState.showingAndNotHidden;
+ }
+
+ public boolean isInputRestricted() {
+ if (mKeyguardService != null) {
+ mKeyguardState.inputRestricted = mKeyguardService.isInputRestricted();
+ }
+ return mKeyguardState.inputRestricted;
+ }
+
+ public void verifyUnlock(final OnKeyguardExitResult onKeyguardExitResult) {
+ if (mKeyguardService != null) {
+ mKeyguardService.verifyUnlock(new KeyguardResult(null, onKeyguardExitResult));
+ }
+ }
+
+ public void keyguardDone(boolean authenticated, boolean wakeup) {
+ if (mKeyguardService != null) {
+ mKeyguardService.keyguardDone(authenticated, wakeup);
+ }
+ }
+
+ public void setHidden(boolean isHidden) {
+ if (mKeyguardService != null) {
+ mKeyguardService.setHidden(isHidden);
+ }
+ mKeyguardState.hidden = isHidden;
+ }
+
+ public void dismiss() {
+ if (mKeyguardService != null) {
+ mKeyguardService.dismiss();
+ }
+ }
+
+ public boolean isSecure() {
+ if (mKeyguardService != null) {
+ mKeyguardState.secure = mKeyguardService.isSecure();
+ }
+ return mKeyguardState.secure;
+ }
+
+ public void onWakeKeyWhenKeyguardShowingTq(int keycodePower) {
+ if (mKeyguardService != null) {
+ mKeyguardService.onWakeKeyWhenKeyguardShowingTq(keycodePower);
+ }
+ }
+
+ public void onWakeMotionWhenKeyguardShowingTq() {
+ if (mKeyguardService != null) {
+ mKeyguardService.onWakeMotionWhenKeyguardShowingTq();
+ }
+ }
+
+ public void onDreamingStarted() {
+ if (mKeyguardService != null) {
+ mKeyguardService.onDreamingStarted();
+ }
+ mKeyguardState.dreaming = true;
+ }
+
+ public void onDreamingStopped() {
+ if (mKeyguardService != null) {
+ mKeyguardService.onDreamingStopped();
+ }
+ mKeyguardState.dreaming = false;
+ }
+
+ public void onScreenTurnedOn(final ShowListener showListener) {
+ if (mKeyguardService != null) {
+ if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + showListener + ")");
+ mKeyguardService.onScreenTurnedOn(new KeyguardResult(showListener, null));
+ } else {
+ // try again when we establish a connection
+ if (DEBUG) Log.w(TAG, "onScreenTurnedOn(): no keyguard service!");
+ mKeyguardState.showListener = showListener;
+ mKeyguardState.restoreStateWhenConnected = true;
+ }
+ mKeyguardState.screenIsOn = true;
+ }
+
+ public void onScreenTurnedOff(int why) {
+ if (mKeyguardService != null) {
+ mKeyguardService.onScreenTurnedOff(why);
+ }
+ mKeyguardState.offReason = why;
+ mKeyguardState.screenIsOn = false;
+ }
+
+ public void setKeyguardEnabled(boolean enabled) {
+ if (mKeyguardService != null) {
+ mKeyguardService.setKeyguardEnabled(enabled);
+ }
+ mKeyguardState.enabled = enabled;
+ }
+
+ public boolean isDismissable() {
+ if (mKeyguardService != null) {
+ mKeyguardState.dismissable = mKeyguardService.isDismissable();
+ }
+ return mKeyguardState.dismissable;
+ }
+
+ public void onSystemReady() {
+ if (mKeyguardService != null) {
+ mKeyguardService.onSystemReady();
+ } else {
+ if (DEBUG) Log.v(TAG, "onSystemReady() called before keyguard service was ready");
+ mKeyguardState.systemIsReady = true;
+ }
+ }
+
+ public void doKeyguardTimeout(Bundle options) {
+ if (mKeyguardService != null) {
+ mKeyguardService.doKeyguardTimeout(options);
+ }
+ }
+
+ public void showAssistant() {
+ if (mKeyguardService != null) {
+ mKeyguardService.showAssistant();
+ }
+ }
+
+ public void setCurrentUser(int newUserId) {
+ if (mKeyguardService != null) {
+ mKeyguardService.setCurrentUser(newUserId);
+ }
+ mKeyguardState.currentUser = newUserId;
+ }
+
+ public void userActivity() {
+ if (mKeyguardService != null) {
+ mKeyguardService.userActivity();
+ }
+ }
+
+}
diff --git a/services/java/com/android/server/LockSettingsService.java b/services/java/com/android/server/LockSettingsService.java
index e20a21f..f8e9ff7 100644
--- a/services/java/com/android/server/LockSettingsService.java
+++ b/services/java/com/android/server/LockSettingsService.java
@@ -49,6 +49,7 @@
*/
public class LockSettingsService extends ILockSettings.Stub {
+ private static final String PERMISSION = "android.permission.ACCESS_KEYGUARD_SECURE_STORAGE";
private final DatabaseHelper mOpenHelper;
private static final String TAG = "LockSettingsService";
@@ -99,29 +100,12 @@
}
}
- private static final void checkWritePermission(int userId) {
- final int callingUid = Binder.getCallingUid();
- if (UserHandle.getAppId(callingUid) != android.os.Process.SYSTEM_UID) {
- throw new SecurityException("uid=" + callingUid
- + " not authorized to write lock settings");
- }
+ private final void checkWritePermission(int userId) {
+ mContext.checkCallingOrSelfPermission(PERMISSION);
}
- private static final void checkPasswordReadPermission(int userId) {
- final int callingUid = Binder.getCallingUid();
- if (UserHandle.getAppId(callingUid) != android.os.Process.SYSTEM_UID) {
- throw new SecurityException("uid=" + callingUid
- + " not authorized to read lock password");
- }
- }
-
- private static final void checkReadPermission(int userId) {
- final int callingUid = Binder.getCallingUid();
- if (UserHandle.getAppId(callingUid) != android.os.Process.SYSTEM_UID
- && UserHandle.getUserId(callingUid) != userId) {
- throw new SecurityException("uid=" + callingUid
- + " not authorized to read settings of user " + userId);
- }
+ private final void checkPasswordReadPermission(int userId) {
+ mContext.checkCallingOrSelfPermission(PERMISSION);
}
@Override
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 8ef247e..3070edc 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -725,7 +725,7 @@
} catch (Throwable e) {
reportWtf("starting CertBlacklister", e);
}
-
+
if (context.getResources().getBoolean(
com.android.internal.R.bool.config_dreamsSupported)) {
try {
@@ -862,7 +862,9 @@
public void run() {
Slog.i(TAG, "Making services ready");
- if (!headless) startSystemUi(contextF);
+ if (!headless) {
+ startSystemUi(contextF);
+ }
try {
if (mountServiceF != null) mountServiceF.systemReady();
} catch (Throwable e) {
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java
index 2a62c17..26c6ccb 100644
--- a/services/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/java/com/android/server/accounts/AccountManagerService.java
@@ -1325,7 +1325,10 @@
int userId) {
// Only allow the system process to read accounts of other users
if (userId != UserHandle.getCallingUserId()
- && Binder.getCallingUid() != android.os.Process.myUid()) {
+ && Binder.getCallingUid() != android.os.Process.myUid()
+ && mContext.checkCallingOrSelfPermission(
+ android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
+ != PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("User " + UserHandle.getCallingUserId()
+ " trying to confirm account credentials for " + userId);
}
@@ -1583,7 +1586,10 @@
public Account[] getAccountsAsUser(String type, int userId) {
// Only allow the system process to read accounts of other users
if (userId != UserHandle.getCallingUserId()
- && Binder.getCallingUid() != android.os.Process.myUid()) {
+ && Binder.getCallingUid() != android.os.Process.myUid()
+ && mContext.checkCallingOrSelfPermission(
+ android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
+ != PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("User " + UserHandle.getCallingUserId()
+ " trying to get account for " + userId);
}
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index a766bad..8076fd0 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -37,6 +37,7 @@
import android.app.Activity;
import android.app.ActivityManager;
+import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.ActivityThread;
@@ -196,7 +197,7 @@
static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
static final boolean DEBUG_MU = localLOGV || false;
static final boolean DEBUG_IMMERSIVE = localLOGV || false;
- static final boolean VALIDATE_TOKENS = false;
+ static final boolean VALIDATE_TOKENS = true;
static final boolean SHOW_ACTIVITY_START_TIME = true;
// Control over CPU and battery monitoring.
@@ -328,7 +329,7 @@
/**
* List of intents that were used to start the most recent tasks.
*/
- final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
+ private final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
public class PendingActivityExtras extends Binder implements Runnable {
public final ActivityRecord activity;
@@ -596,13 +597,8 @@
* List of PendingThumbnailsRecord objects of clients who are still
* waiting to receive all of the thumbnails for a task.
*/
- final ArrayList mPendingThumbnails = new ArrayList();
-
- /**
- * List of HistoryRecord objects that have been finished and must
- * still report back to a pending thumbnail receiver.
- */
- final ArrayList mCancelledThumbnails = new ArrayList();
+ final ArrayList<PendingThumbnailsRecord> mPendingThumbnails =
+ new ArrayList<PendingThumbnailsRecord>();
final ProviderMap mProviderMap;
@@ -2842,11 +2838,8 @@
for (int i=0; i<activities.size(); i++) {
ActivityRecord r = activities.get(i);
if (!r.finishing) {
- int index = mMainStack.indexOfTokenLocked(r.appToken);
- if (index >= 0) {
- mMainStack.finishActivityLocked(r, index, Activity.RESULT_CANCELED,
- null, "finish-heavy", true);
- }
+ mMainStack.finishActivityLocked(r, Activity.RESULT_CANCELED,
+ null, "finish-heavy", true);
}
}
@@ -2932,22 +2925,13 @@
}
}
+ @Override
public boolean willActivityBeVisible(IBinder token) {
synchronized(this) {
- int i;
- for (i=mMainStack.mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if (r.appToken == token) {
- return true;
- }
- if (r.fullscreen && !r.finishing) {
- return false;
- }
- }
- return true;
+ return mMainStack.willActivityBeVisibleLocked(token);
}
}
-
+
public void overridePendingTransition(IBinder token, String packageName,
int enterAnim, int exitAnim) {
synchronized(this) {
@@ -3717,13 +3701,7 @@
}
mWindowManager.closeSystemDialogs(reason);
- for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
- r.stack.finishActivityLocked(r, i,
- Activity.RESULT_CANCELED, null, "close-sys", true);
- }
- }
+ mMainStack.closeSystemDialogsLocked();
broadcastIntentLocked(null, null, intent, null,
null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, -1,
@@ -3930,37 +3908,12 @@
boolean didSomething = killPackageProcessesLocked(name, appId, userId,
-100, callerWillRestart, true, doit, evenPersistent,
name == null ? ("force stop user " + userId) : ("force stop " + name));
-
- TaskRecord lastTask = null;
- for (i=0; i<mMainStack.mHistory.size(); i++) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- final boolean samePackage = r.packageName.equals(name)
- || (name == null && r.userId == userId);
- if ((userId == UserHandle.USER_ALL || r.userId == userId)
- && (samePackage || r.task == lastTask)
- && (r.app == null || evenPersistent || !r.app.persistent)) {
- if (!doit) {
- if (r.finishing) {
- // If this activity is just finishing, then it is not
- // interesting as far as something to stop.
- continue;
- }
- return true;
- }
- didSomething = true;
- Slog.i(TAG, " Force finishing activity " + r);
- if (samePackage) {
- if (r.app != null) {
- r.app.removed = true;
- }
- r.app = null;
- }
- lastTask = r.task;
- if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "force-stop", true)) {
- i--;
- }
+
+ if (mMainStack.forceStopPackageLocked(name, doit, evenPersistent, userId)) {
+ if (!doit) {
+ return true;
}
+ didSomething = true;
}
if (mServices.forceStopLocked(name, userId, evenPersistent, doit)) {
@@ -5670,12 +5623,12 @@
// TASK MANAGEMENT
// =========================================================
- public List getTasks(int maxNum, int flags,
+ @Override
+ public List<RunningTaskInfo> getTasks(int maxNum, int flags,
IThumbnailReceiver receiver) {
- ArrayList list = new ArrayList();
+ ArrayList<RunningTaskInfo> list = new ArrayList<RunningTaskInfo>();
- PendingThumbnailsRecord pending = null;
- IApplicationThread topThumbnail = null;
+ PendingThumbnailsRecord pending = new PendingThumbnailsRecord(receiver);
ActivityRecord topRecord = null;
synchronized(this) {
@@ -5701,88 +5654,19 @@
throw new SecurityException(msg);
}
- int pos = mMainStack.mHistory.size()-1;
- ActivityRecord next =
- pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
- ActivityRecord top = null;
- TaskRecord curTask = null;
- int numActivities = 0;
- int numRunning = 0;
- while (pos >= 0 && maxNum > 0) {
- final ActivityRecord r = next;
- pos--;
- next = pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
+ topRecord = mMainStack.getTasksLocked(maxNum, receiver, pending, list);
- // Initialize state for next task if needed.
- if (top == null ||
- (top.state == ActivityState.INITIALIZING
- && top.task == r.task)) {
- top = r;
- curTask = r.task;
- numActivities = numRunning = 0;
- }
-
- // Add 'r' into the current task.
- numActivities++;
- if (r.app != null && r.app.thread != null) {
- numRunning++;
- }
-
- if (localLOGV) Slog.v(
- TAG, r.intent.getComponent().flattenToShortString()
- + ": task=" + r.task);
-
- // If the next one is a different task, generate a new
- // TaskInfo entry for what we have.
- if (next == null || next.task != curTask) {
- ActivityManager.RunningTaskInfo ci
- = new ActivityManager.RunningTaskInfo();
- ci.id = curTask.taskId;
- ci.baseActivity = r.intent.getComponent();
- ci.topActivity = top.intent.getComponent();
- if (top.thumbHolder != null) {
- ci.description = top.thumbHolder.lastDescription;
- }
- ci.numActivities = numActivities;
- ci.numRunning = numRunning;
- //System.out.println(
- // "#" + maxNum + ": " + " descr=" + ci.description);
- if (ci.thumbnail == null && receiver != null) {
- if (localLOGV) Slog.v(
- TAG, "State=" + top.state + "Idle=" + top.idle
- + " app=" + top.app
- + " thr=" + (top.app != null ? top.app.thread : null));
- if (top.state == ActivityState.RESUMED
- || top.state == ActivityState.PAUSING) {
- if (top.idle && top.app != null
- && top.app.thread != null) {
- topRecord = top;
- topThumbnail = top.app.thread;
- } else {
- top.thumbnailNeeded = true;
- }
- }
- if (pending == null) {
- pending = new PendingThumbnailsRecord(receiver);
- }
- pending.pendingRecords.add(top);
- }
- list.add(ci);
- maxNum--;
- top = null;
- }
- }
-
- if (pending != null) {
+ if (!pending.pendingRecords.isEmpty()) {
mPendingThumbnails.add(pending);
}
}
if (localLOGV) Slog.v(TAG, "We have pending thumbnails: " + pending);
- if (topThumbnail != null) {
+ if (topRecord != null) {
if (localLOGV) Slog.v(TAG, "Requesting top thumbnail");
try {
+ IApplicationThread topThumbnail = topRecord.app.thread;
topThumbnail.requestThumbnail(topRecord.appToken);
} catch (Exception e) {
Slog.w(TAG, "Exception thrown when requesting thumbnail", e);
@@ -6017,43 +5901,6 @@
return false;
}
- private final int findAffinityTaskTopLocked(int startIndex, String affinity) {
- int j;
- TaskRecord startTask = ((ActivityRecord)mMainStack.mHistory.get(startIndex)).task;
- TaskRecord jt = startTask;
-
- // First look backwards
- for (j=startIndex-1; j>=0; j--) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
- if (r.task != jt) {
- jt = r.task;
- if (affinity.equals(jt.affinity)) {
- return j;
- }
- }
- }
-
- // Now look forwards
- final int N = mMainStack.mHistory.size();
- jt = startTask;
- for (j=startIndex+1; j<N; j++) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
- if (r.task != jt) {
- if (affinity.equals(jt.affinity)) {
- return j;
- }
- jt = r.task;
- }
- }
-
- // Might it be at the top?
- if (affinity.equals(((ActivityRecord)mMainStack.mHistory.get(N-1)).task.affinity)) {
- return N-1;
- }
-
- return -1;
- }
-
/**
* TODO: Add mController hook
*/
@@ -6082,20 +5929,8 @@
mMainStack.moveTaskToFrontLocked(tr, null, options);
return;
}
- for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
- ActivityRecord hr = (ActivityRecord)mMainStack.mHistory.get(i);
- if (hr.task.taskId == task) {
- if ((flags&ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
- mMainStack.mUserLeaving = true;
- }
- if ((flags&ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
- // Caller wants the home activity moved with it. To accomplish this,
- // we'll just move the home task to the top first.
- mMainStack.moveHomeToFrontLocked();
- }
- mMainStack.moveTaskToFrontLocked(hr.task, null, options);
- return;
- }
+ if (mMainStack.findTaskToMoveToFrontLocked(task, flags, options)) {
+ return;
}
} finally {
Binder.restoreCallingIdentity(origId);
@@ -6135,7 +5970,7 @@
enforceNotIsolatedCaller("moveActivityTaskToBack");
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
- int taskId = getTaskForActivityLocked(token, !nonRoot);
+ int taskId = mMainStack.getTaskForActivityLocked(token, !nonRoot);
if (taskId >= 0) {
return mMainStack.moveTaskToBackLocked(taskId, null);
}
@@ -6165,27 +6000,10 @@
public int getTaskForActivity(IBinder token, boolean onlyRoot) {
synchronized(this) {
- return getTaskForActivityLocked(token, onlyRoot);
+ return mMainStack.getTaskForActivityLocked(token, onlyRoot);
}
}
- int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
- final int N = mMainStack.mHistory.size();
- TaskRecord lastTask = null;
- for (int i=0; i<N; i++) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if (r.appToken == token) {
- if (!onlyRoot || lastTask != r.task) {
- return r.task.taskId;
- }
- return -1;
- }
- lastTask = r.task;
- }
-
- return -1;
- }
-
// =========================================================
// THUMBNAILS
// =========================================================
@@ -7091,13 +6909,10 @@
"unhandledBack()");
synchronized(this) {
- int count = mMainStack.mHistory.size();
- if (DEBUG_SWITCH) Slog.d(
- TAG, "Performing unhandledBack(): stack size = " + count);
- if (count > 1) {
- final long origId = Binder.clearCallingIdentity();
- mMainStack.finishActivityLocked((ActivityRecord)mMainStack.mHistory.get(count-1),
- count-1, Activity.RESULT_CANCELED, null, "unhandled-back", true);
+ final long origId = Binder.clearCallingIdentity();
+ try {
+ mMainStack.unhandledBackLocked();
+ } finally {
Binder.restoreCallingIdentity(origId);
}
}
@@ -8165,15 +7980,7 @@
+ " has crashed too many times: killing!");
EventLog.writeEvent(EventLogTags.AM_PROCESS_CRASHED_TOO_MUCH,
app.userId, app.info.processName, app.uid);
- for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
- if (r.app == app) {
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "crashed", false);
- }
- }
+ mMainStack.handleAppCrashLocked(app);
if (!app.persistent) {
// We don't want to start this process again until the user
// explicitly does so... but for persistent process, we really
@@ -8198,33 +8005,7 @@
}
mMainStack.resumeTopActivityLocked(null);
} else {
- ActivityRecord r = mMainStack.topRunningActivityLocked(null);
- if (r != null && r.app == app) {
- // If the top running activity is from this crashing
- // process, then terminate it to avoid getting in a loop.
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- int index = mMainStack.indexOfActivityLocked(r);
- r.stack.finishActivityLocked(r, index,
- Activity.RESULT_CANCELED, null, "crashed", false);
- // Also terminate any activities below it that aren't yet
- // stopped, to avoid a situation where one will get
- // re-start our crashing activity once it gets resumed again.
- index--;
- if (index >= 0) {
- r = (ActivityRecord)mMainStack.mHistory.get(index);
- if (r.state == ActivityState.RESUMED
- || r.state == ActivityState.PAUSING
- || r.state == ActivityState.PAUSED) {
- if (!r.isHomeActivity || mHomeProcess != r.app) {
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- r.stack.finishActivityLocked(r, index,
- Activity.RESULT_CANCELED, null, "crashed", false);
- }
- }
- }
- }
+ mMainStack.finishTopRunningActivityLocked(app);
}
// Bump up the crash count of any services currently running in the proc.
@@ -9243,8 +9024,7 @@
int opti, boolean dumpAll, boolean dumpClient, String dumpPackage) {
pw.println("ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)");
pw.println(" Main stack:");
- dumpHistoryList(fd, pw, mMainStack.mHistory, " ", "Hist", true, !dumpAll, dumpClient,
- dumpPackage);
+ mMainStack.dumpActivitiesLocked(fd, pw, dumpAll, dumpClient, dumpPackage);
pw.println(" ");
pw.println(" Running activities (most recent first):");
dumpHistoryList(fd, pw, mMainStack.mLRUActivities, " ", "Run", false, !dumpAll, false,
@@ -9774,32 +9554,10 @@
*/
protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args,
int opti, boolean dumpAll) {
- ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
-
- if ("all".equals(name)) {
- synchronized (this) {
- for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
- activities.add(r1);
- }
- }
- } else if ("top".equals(name)) {
- synchronized (this) {
- final int N = mMainStack.mHistory.size();
- if (N > 0) {
- activities.add((ActivityRecord)mMainStack.mHistory.get(N-1));
- }
- }
- } else {
- ItemMatcher matcher = new ItemMatcher();
- matcher.build(name);
-
- synchronized (this) {
- for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
- if (matcher.match(r1, r1.intent.getComponent())) {
- activities.add(r1);
- }
- }
- }
+ ArrayList<ActivityRecord> activities;
+
+ synchronized (this) {
+ activities = mMainStack.getDumpActivitiesLocked(name);
}
if (activities.size() <= 0) {
@@ -10051,7 +9809,7 @@
return needSep;
}
- private static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
+ static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
String prefix, String label, boolean complete, boolean brief, boolean client,
String dumpPackage) {
TaskRecord lastTask = null;
@@ -12589,95 +12347,14 @@
public boolean navigateUpTo(IBinder token, Intent destIntent, int resultCode,
Intent resultData) {
- ComponentName dest = destIntent.getComponent();
synchronized (this) {
ActivityRecord srec = ActivityRecord.forToken(token);
if (srec == null) {
return false;
}
- ArrayList<ActivityRecord> history = srec.stack.mHistory;
- final int start = history.indexOf(srec);
- if (start < 0) {
- // Current activity is not in history stack; do nothing.
- return false;
- }
- int finishTo = start - 1;
- ActivityRecord parent = null;
- boolean foundParentInTask = false;
- if (dest != null) {
- TaskRecord tr = srec.task;
- for (int i = start - 1; i >= 0; i--) {
- ActivityRecord r = history.get(i);
- if (tr != r.task) {
- // Couldn't find parent in the same task; stop at the one above this.
- // (Root of current task; in-app "home" behavior)
- // Always at least finish the current activity.
- finishTo = Math.min(start - 1, i + 1);
- parent = history.get(finishTo);
- break;
- } else if (r.info.packageName.equals(dest.getPackageName()) &&
- r.info.name.equals(dest.getClassName())) {
- finishTo = i;
- parent = r;
- foundParentInTask = true;
- break;
- }
- }
- }
-
- if (mController != null) {
- ActivityRecord next = mMainStack.topRunningActivityLocked(token, 0);
- if (next != null) {
- // ask watcher if this is allowed
- boolean resumeOK = true;
- try {
- resumeOK = mController.activityResuming(next.packageName);
- } catch (RemoteException e) {
- mController = null;
- }
-
- if (!resumeOK) {
- return false;
- }
- }
- }
- final long origId = Binder.clearCallingIdentity();
- for (int i = start; i > finishTo; i--) {
- ActivityRecord r = history.get(i);
- mMainStack.requestFinishActivityLocked(r.appToken, resultCode, resultData,
- "navigate-up", true);
- // Only return the supplied result for the first activity finished
- resultCode = Activity.RESULT_CANCELED;
- resultData = null;
- }
-
- if (parent != null && foundParentInTask) {
- final int parentLaunchMode = parent.info.launchMode;
- final int destIntentFlags = destIntent.getFlags();
- if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE ||
- parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
- parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
- (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
- parent.deliverNewIntentLocked(srec.info.applicationInfo.uid, destIntent);
- } else {
- try {
- ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
- destIntent.getComponent(), 0, srec.userId);
- int res = mMainStack.startActivityLocked(srec.app.thread, destIntent,
- null, aInfo, parent.appToken, null,
- 0, -1, parent.launchedFromUid, parent.launchedFromPackage,
- 0, null, true, null);
- foundParentInTask = res == ActivityManager.START_SUCCESS;
- } catch (RemoteException e) {
- foundParentInTask = false;
- }
- mMainStack.requestFinishActivityLocked(parent.appToken, resultCode,
- resultData, "navigate-up", true);
- }
- }
- Binder.restoreCallingIdentity(origId);
- return foundParentInTask;
+ ActivityStack stack = srec.stack;
+ return stack.navigateUpToLocked(srec, destIntent, resultCode, resultData);
}
}
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index cde17c9..d8f9e0d 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -22,6 +22,7 @@
import android.app.Activity;
import android.app.ActivityOptions;
+import android.app.ResultInfo;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -95,9 +96,9 @@
ActivityRecord resultTo; // who started this entry, so will get our reply
final String resultWho; // additional identifier for use by resultTo.
final int requestCode; // code given by requester (resultTo)
- ArrayList results; // pending ActivityResult objs we have received
+ ArrayList<ResultInfo> results; // pending ActivityResult objs we have received
HashSet<WeakReference<PendingIntentRecord>> pendingResults; // all pending intents for this act
- ArrayList newIntents; // any pending new intents for single-top mode
+ ArrayList<Intent> newIntents; // any pending new intents for single-top mode
ActivityOptions pendingOptions; // most recently given options
HashSet<ConnectionRecord> connections; // All ConnectionRecord we hold
UriPermissionOwner uriPermissions; // current special URI access perms.
@@ -470,6 +471,8 @@
void setTask(TaskRecord newTask, ThumbnailHolder newThumbHolder, boolean isRoot) {
if (inHistory && !finishing) {
if (task != null) {
+ // TODO: If this is the last ActivityRecord in task, remove from ActivityStack.
+ task.removeActivity(this);
task.numActivities--;
}
if (newTask != null) {
@@ -504,6 +507,7 @@
inHistory = false;
if (task != null && !finishing) {
task.numActivities--;
+ task = null;
}
clearOptionsLocked();
}
@@ -538,7 +542,7 @@
ActivityResult r = new ActivityResult(from, resultWho,
requestCode, resultCode, resultData);
if (results == null) {
- results = new ArrayList();
+ results = new ArrayList<ResultInfo>();
}
results.add(r);
}
@@ -941,10 +945,11 @@
}
}
}
-
+
+ @Override
public String toString() {
if (stringName != null) {
- return stringName;
+ return stringName + " t" + task.taskId + (finishing ? " f}" : "}");
}
StringBuilder sb = new StringBuilder(128);
sb.append("ActivityRecord{");
@@ -953,7 +958,7 @@
sb.append(userId);
sb.append(' ');
sb.append(intent.getComponent().flattenToShortString());
- sb.append('}');
- return stringName = sb.toString();
+ stringName = sb.toString();
+ return toString();
}
}
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 526b24f..d2f3277 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -21,18 +21,24 @@
import com.android.internal.app.HeavyWeightSwitcherActivity;
import com.android.internal.os.BatteryStatsImpl;
+import com.android.internal.util.Objects;
+import com.android.server.am.ActivityManagerService.ItemMatcher;
import com.android.server.am.ActivityManagerService.PendingActivityLaunch;
import com.android.server.wm.AppTransition;
+import com.android.server.wm.TaskGroup;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.AppGlobals;
+import android.app.IActivityController;
import android.app.IActivityManager;
+import android.app.IThumbnailReceiver;
import android.app.IThumbnailRetriever;
import android.app.IApplicationThread;
import android.app.PendingIntent;
import android.app.ResultInfo;
+import android.app.ActivityManager.RunningTaskInfo;
import android.app.IActivityManager.WaitResult;
import android.content.ComponentName;
import android.content.Context;
@@ -49,6 +55,7 @@
import android.graphics.Bitmap.Config;
import android.os.Binder;
import android.os.Bundle;
+import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -61,9 +68,12 @@
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
+import android.util.SparseArray;
import android.view.Display;
+import java.io.FileDescriptor;
import java.io.IOException;
+import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
@@ -84,14 +94,15 @@
static final boolean DEBUG_CONFIGURATION = ActivityManagerService.DEBUG_CONFIGURATION;
static final boolean DEBUG_TASKS = ActivityManagerService.DEBUG_TASKS;
static final boolean DEBUG_CLEANUP = ActivityManagerService.DEBUG_CLEANUP;
-
+
static final boolean DEBUG_STATES = false;
static final boolean DEBUG_ADD_REMOVE = false;
static final boolean DEBUG_SAVED_STATE = false;
static final boolean DEBUG_APP = false;
static final boolean VALIDATE_TOKENS = ActivityManagerService.VALIDATE_TOKENS;
-
+ static final boolean VALIDATE_TASK_REPLACE = true;
+
// How long we wait until giving up on the last activity telling us it
// is idle.
static final int IDLE_TIMEOUT = 10*1000;
@@ -118,19 +129,19 @@
// How long we wait until giving up on an activity telling us it has
// finished destroying itself.
static final int DESTROY_TIMEOUT = 10*1000;
-
+
// How long until we reset a task when the user returns to it. Currently
// disabled.
static final long ACTIVITY_INACTIVE_RESET_TIME = 0;
-
+
// How long between activity launches that we consider safe to not warn
// the user about an unexpected activity being launched on top.
static final long START_WARN_TIME = 5*1000;
-
+
// Set to false to disable the preview that is shown while a new activity
// is being started.
static final boolean SHOW_APP_STARTING_PREVIEW = true;
-
+
enum ActivityState {
INITIALIZING,
RESUMED,
@@ -145,19 +156,30 @@
final ActivityManagerService mService;
final boolean mMainStack;
-
+
final Context mContext;
-
+
/**
* The back history of all previous (and possibly still
- * running) activities. It contains HistoryRecord objects.
+ * running) activities. It contains #ActivityRecord objects.
*/
- final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
+ private final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
+
+ /**
+ * The back history of all previous (and possibly still
+ * running) activities. It contains #TaskRecord objects.
+ */
+ private ArrayList<TaskRecord> mTaskHistory = new ArrayList<TaskRecord>();
+
+ /**
+ * Mapping from taskId to TaskRecord
+ */
+ private SparseArray<TaskRecord> mTaskIdToTaskRecord = new SparseArray<TaskRecord>();
/**
* Used for validating app tokens with window manager.
*/
- final ArrayList<IBinder> mValidateAppTokens = new ArrayList<IBinder>();
+ final ArrayList<TaskGroup> mValidateAppTokens = new ArrayList<TaskGroup>();
/**
* List of running activities, sorted by recent usage.
@@ -202,13 +224,13 @@
*/
final ArrayList<ActivityRecord> mFinishingActivities
= new ArrayList<ActivityRecord>();
-
+
/**
* List of people waiting to find out about the next launched activity.
*/
final ArrayList<IActivityManager.WaitResult> mWaitingActivityLaunched
= new ArrayList<IActivityManager.WaitResult>();
-
+
/**
* List of people waiting to find out about the next visible activity.
*/
@@ -250,14 +272,14 @@
* Current activity that is resumed, or null if there is none.
*/
ActivityRecord mResumedActivity = null;
-
+
/**
* This is the last activity that has been started. It is only used to
* identify when multiple activities are started at once so that the user
* can be warned they may not be in the activity they think they are.
*/
ActivityRecord mLastStartedActivity = null;
-
+
/**
* Set when we know we are going to be calling updateConfiguration()
* soon, so want to skip intermediate config checks.
@@ -269,9 +291,9 @@
* newly launched activity is being brought in front of us.
*/
boolean mUserLeaving = false;
-
+
long mInitialStartTime = 0;
-
+
/**
* Set when we have taken too long waiting to go to sleep.
*/
@@ -289,6 +311,12 @@
private ActivityRecord mLastScreenshotActivity = null;
private Bitmap mLastScreenshotBitmap = null;
+ /**
+ * List of ActivityRecord objects that have been finished and must
+ * still report back to a pending thumbnail receiver.
+ */
+ private final ArrayList<ActivityRecord> mCancelledThumbnails = new ArrayList<ActivityRecord>();
+
int mThumbnailWidth = -1;
int mThumbnailHeight = -1;
@@ -318,6 +346,8 @@
final Handler mHandler;
+ String mLastHistoryModifier;
+
final class ActivityStackHandler extends Handler {
//public Handler() {
// if (localLOGV) Slog.v(TAG, "Handler started!");
@@ -426,6 +456,14 @@
}
}
+ private int numActivities() {
+ int count = 0;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ count += mTaskHistory.get(taskNdx).mActivities.size();
+ }
+ return count;
+ }
+
ActivityStack(ActivityManagerService service, Context context, boolean mainStack, Looper looper) {
mHandler = new ActivityStackHandler(looper);
mService = service;
@@ -444,25 +482,29 @@
}
final ActivityRecord topRunningActivityLocked(ActivityRecord notTop) {
- int i = mHistory.size()-1;
- while (i >= 0) {
- ActivityRecord r = mHistory.get(i);
- if (!r.finishing && r != notTop && okToShow(r)) {
- return r;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final TaskRecord task = mTaskHistory.get(taskNdx);
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
+ if (!r.finishing && r != notTop && okToShow(r)) {
+ return r;
+ }
}
- i--;
}
return null;
}
final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) {
- int i = mHistory.size()-1;
- while (i >= 0) {
- ActivityRecord r = mHistory.get(i);
- if (!r.finishing && !r.delayedResume && r != notTop && okToShow(r)) {
- return r;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final TaskRecord task = mTaskHistory.get(taskNdx);
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
+ if (!r.finishing && !r.delayedResume && r != notTop && okToShow(r)) {
+ return r;
+ }
}
- i--;
}
return null;
}
@@ -470,42 +512,54 @@
/**
* This is a simplified version of topRunningActivityLocked that provides a number of
* optional skip-over modes. It is intended for use with the ActivityController hook only.
- *
+ *
* @param token If non-null, any history records matching this token will be skipped.
* @param taskId If non-zero, we'll attempt to skip over records with the same task ID.
- *
+ *
* @return Returns the HistoryRecord of the next activity on the stack.
*/
final ActivityRecord topRunningActivityLocked(IBinder token, int taskId) {
- int i = mHistory.size()-1;
- while (i >= 0) {
- ActivityRecord r = mHistory.get(i);
- // Note: the taskId check depends on real taskId fields being non-zero
- if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId)
- && okToShow(r)) {
- return r;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ TaskRecord task = mTaskHistory.get(taskNdx);
+ if (task.taskId == taskId) {
+ continue;
}
- i--;
+ ArrayList<ActivityRecord> activities = task.mActivities;
+ for (int i = activities.size() - 1; i >= 0; --i) {
+ final ActivityRecord r = activities.get(i);
+ // Note: the taskId check depends on real taskId fields being non-zero
+ if (!r.finishing && (token != r.appToken) && okToShow(r)) {
+ return r;
+ }
+ }
}
return null;
}
- final int indexOfTokenLocked(IBinder token) {
- return mHistory.indexOf(ActivityRecord.forToken(token));
- }
-
- final int indexOfActivityLocked(ActivityRecord r) {
- return mHistory.indexOf(r);
- }
-
final ActivityRecord isInStackLocked(IBinder token) {
- ActivityRecord r = ActivityRecord.forToken(token);
- if (mHistory.contains(r)) {
- return r;
+ final ActivityRecord r = ActivityRecord.forToken(token);
+ if (r != null) {
+ final TaskRecord task = r.task;
+ if (mTaskHistory.contains(task) && task.mActivities.contains(r)) {
+ return r;
+ }
}
return null;
}
+ int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
+ final ActivityRecord r = ActivityRecord.forToken(token);
+ if (r == null) {
+ return -1;
+ }
+ final TaskRecord task = r.task;
+ switch (task.mActivities.indexOf(r)) {
+ case -1: return -1;
+ case 0: return task.taskId;
+ default: return onlyRoot ? -1 : task.taskId;
+ }
+ }
+
private final boolean updateLRUListLocked(ActivityRecord r) {
final boolean hadit = mLRUActivities.remove(r);
mLRUActivities.add(r);
@@ -521,37 +575,35 @@
if (info.targetActivity != null) {
cls = new ComponentName(info.packageName, info.targetActivity);
}
-
- TaskRecord cp = null;
-
final int userId = UserHandle.getUserId(info.applicationInfo.uid);
- final int N = mHistory.size();
- for (int i=(N-1); i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (!r.finishing && r.task != cp && r.userId == userId
- && r.launchMode != ActivityInfo.LAUNCH_SINGLE_INSTANCE) {
- cp = r.task;
- //Slog.i(TAG, "Comparing existing cls=" + r.task.intent.getComponent().flattenToShortString()
- // + "/aff=" + r.task.affinity + " to new cls="
- // + intent.getComponent().flattenToShortString() + "/aff=" + taskAffinity);
- if (r.task.affinity != null) {
- if (r.task.affinity.equals(info.taskAffinity)) {
- //Slog.i(TAG, "Found matching affinity!");
- return r;
- }
- } else if (r.task.intent != null
- && r.task.intent.getComponent().equals(cls)) {
- //Slog.i(TAG, "Found matching class!");
- //dump();
- //Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
- return r;
- } else if (r.task.affinityIntent != null
- && r.task.affinityIntent.getComponent().equals(cls)) {
- //Slog.i(TAG, "Found matching class!");
- //dump();
- //Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
+
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final TaskRecord task = mTaskHistory.get(taskNdx);
+ final ActivityRecord r = task.getTopActivity();
+ if (r == null || r.finishing || r.userId != userId ||
+ r.launchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE) {
+ continue;
+ }
+
+ //Slog.i(TAG, "Comparing existing cls=" + r.task.intent.getComponent().flattenToShortString()
+ // + "/aff=" + r.task.affinity + " to new cls="
+ // + intent.getComponent().flattenToShortString() + "/aff=" + taskAffinity);
+ if (task.affinity != null) {
+ if (task.affinity.equals(info.taskAffinity)) {
+ //Slog.i(TAG, "Found matching affinity!");
return r;
}
+ } else if (task.intent != null && task.intent.getComponent().equals(cls)) {
+ //Slog.i(TAG, "Found matching class!");
+ //dump();
+ //Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
+ return r;
+ } else if (task.affinityIntent != null
+ && task.affinityIntent.getComponent().equals(cls)) {
+ //Slog.i(TAG, "Found matching class!");
+ //dump();
+ //Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
+ return r;
}
}
@@ -570,11 +622,11 @@
}
final int userId = UserHandle.getUserId(info.applicationInfo.uid);
- final int N = mHistory.size();
- for (int i=(N-1); i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (!r.finishing) {
- if (r.intent.getComponent().equals(cls) && r.userId == userId) {
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
+ if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
//Slog.i(TAG, "Found matching class!");
//dump();
//Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
@@ -598,33 +650,54 @@
* @return whether there are any activities for the specified user.
*/
final boolean switchUserLocked(int userId, UserStartedState uss) {
- mCurrentUser = userId;
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
mStartingUsers.add(uss);
+ if (mCurrentUser == userId) {
+ return true;
+ }
+ mCurrentUser = userId;
- // Only one activity? Nothing to do...
- if (mHistory.size() < 2)
- return false;
-
+ // Move userId's tasks to the top.
boolean haveActivities = false;
- // Check if the top activity is from the new user.
- ActivityRecord top = mHistory.get(mHistory.size() - 1);
- if (top.userId == userId) return true;
- // Otherwise, move the user's activities to the top.
- int N = mHistory.size();
- int i = 0;
- while (i < N) {
- ActivityRecord r = mHistory.get(i);
- if (r.userId == userId) {
- ActivityRecord moveToTop = mHistory.remove(i);
- mHistory.add(moveToTop);
- // No need to check the top one now
- N--;
+ TaskRecord task = null;
+ int index = mTaskHistory.size();
+ for (int i = 0; i < index; ++i) {
+ task = mTaskHistory.get(i);
+ if (task.userId == userId) {
haveActivities = true;
- } else {
- i++;
+ mTaskHistory.remove(i);
+ mTaskHistory.add(task);
+ --index;
}
}
- // Transition from the old top to the new top
+
+ { // TODO: Remove when mHistory order no longer matters.
+ // Otherwise, move the user's activities to the top.
+ int N = mHistory.size();
+ int i = 0;
+ while (i < N) {
+ ActivityRecord r = mHistory.get(i);
+ if (r.userId == userId) {
+ ActivityRecord moveToTop = mHistory.remove(i);
+ mHistory.add(moveToTop);
+ // No need to check the top one now
+ N--;
+ haveActivities = true;
+ } else {
+ i++;
+ }
+ }
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
+ }
+ }
+
+ // task is now the original topmost TaskRecord. Transition from the old top to the new top.
+ ActivityRecord top = task != null ? task.getTopActivity() : null;
+ if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "newSwitchUserLocked: would call resumeTopActivity " + top);
resumeTopActivityLocked(top);
return haveActivities;
}
@@ -709,7 +782,13 @@
try {
profileFd = profileFd.dup();
} catch (IOException e) {
- profileFd = null;
+ if (profileFd != null) {
+ try {
+ profileFd.close();
+ } catch (IOException o) {
+ }
+ profileFd = null;
+ }
}
}
app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
@@ -718,7 +797,7 @@
r.compat, r.icicle, results, newIntents, !andResume,
mService.isNextTransitionForward(), profileFile, profileFd,
profileAutoStop);
-
+
if ((app.info.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
// This may be a heavy-weight process! Note that the package
// manager will ensure that only activity can run in the main
@@ -738,7 +817,7 @@
mService.mHandler.sendMessage(msg);
}
}
-
+
} catch (RemoteException e) {
if (r.launchFailed) {
// This is the second time we failed -- finish activity
@@ -797,7 +876,7 @@
if (mMainStack) {
mService.startSetupActivityLocked();
}
-
+
return true;
}
@@ -857,9 +936,11 @@
mGoingToSleep.release();
}
// Ensure activities are no longer sleeping.
- for (int i=mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
- r.setSleeping(false);
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ activities.get(activityNdx).setSleeping(false);
+ }
}
mGoingToSleepActivities.clear();
}
@@ -901,10 +982,16 @@
// Make sure any stopped but visible activities are now sleeping.
// This ensures that the activity's onStop() is called.
- for (int i=mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (r.state == ActivityState.STOPPING || r.state == ActivityState.STOPPED) {
- r.setSleeping(true);
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
+ }
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.state == ActivityState.STOPPING || r.state == ActivityState.STOPPED) {
+ r.setSleeping(true);
+ }
}
}
@@ -1042,12 +1129,9 @@
}
final void activityResumed(IBinder token) {
- ActivityRecord r = null;
-
synchronized (mService) {
- int index = indexOfTokenLocked(token);
- if (index >= 0) {
- r = mHistory.get(index);
+ final ActivityRecord r = isInStackLocked(token);
+ if (r != null) {
if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; dropping state of: " + r);
r.icicle = null;
r.haveState = false;
@@ -1059,12 +1143,9 @@
if (DEBUG_PAUSE) Slog.v(
TAG, "Activity paused: token=" + token + ", timeout=" + timeout);
- ActivityRecord r = null;
-
synchronized (mService) {
- int index = indexOfTokenLocked(token);
- if (index >= 0) {
- r = mHistory.get(index);
+ final ActivityRecord r = isInStackLocked(token);
+ if (r != null) {
mHandler.removeMessages(PAUSE_TIMEOUT_MSG, r);
if (mPausingActivity == r) {
if (DEBUG_STATES) Slog.v(TAG, "Moving to PAUSED: " + r
@@ -1274,106 +1355,98 @@
// If the top activity is not fullscreen, then we need to
// make sure any activities under it are now visible.
- final int count = mHistory.size();
- int i = count-1;
- while (mHistory.get(i) != top) {
- i--;
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
}
- ActivityRecord r;
+ boolean aboveTop = true;
boolean behindFullscreen = false;
- for (; i>=0; i--) {
- r = mHistory.get(i);
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Make visible? " + r + " finishing=" + r.finishing
- + " state=" + r.state);
- if (r.finishing) {
- continue;
- }
-
- final boolean doThisProcess = onlyThisProcess == null
- || onlyThisProcess.equals(r.processName);
-
- // First: if this is not the current activity being started, make
- // sure it matches the current configuration.
- if (r != starting && doThisProcess) {
- ensureActivityConfigurationLocked(r, 0);
- }
-
- if (r.app == null || r.app.thread == null) {
- if (onlyThisProcess == null
- || onlyThisProcess.equals(r.processName)) {
- // This activity needs to be visible, but isn't even
- // running... get it started, but don't resume it
- // at this point.
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.finishing) {
+ continue;
+ }
+ if (aboveTop && r != top) {
+ continue;
+ }
+ aboveTop = false;
+ if (!behindFullscreen) {
if (DEBUG_VISBILITY) Slog.v(
- TAG, "Start and freeze screen for " + r);
- if (r != starting) {
- r.startFreezingScreenLocked(r.app, configChanges);
+ TAG, "Make visible? " + r + " finishing=" + r.finishing
+ + " state=" + r.state);
+
+ final boolean doThisProcess = onlyThisProcess == null
+ || onlyThisProcess.equals(r.processName);
+
+ // First: if this is not the current activity being started, make
+ // sure it matches the current configuration.
+ if (r != starting && doThisProcess) {
+ ensureActivityConfigurationLocked(r, 0);
}
- if (!r.visible) {
+
+ if (r.app == null || r.app.thread == null) {
+ if (onlyThisProcess == null
+ || onlyThisProcess.equals(r.processName)) {
+ // This activity needs to be visible, but isn't even
+ // running... get it started, but don't resume it
+ // at this point.
+ if (DEBUG_VISBILITY) Slog.v(
+ TAG, "Start and freeze screen for " + r);
+ if (r != starting) {
+ r.startFreezingScreenLocked(r.app, configChanges);
+ }
+ if (!r.visible) {
+ if (DEBUG_VISBILITY) Slog.v(
+ TAG, "Starting and making visible: " + r);
+ mService.mWindowManager.setAppVisibility(r.appToken, true);
+ }
+ if (r != starting) {
+ startSpecificActivityLocked(r, false, false);
+ }
+ }
+
+ } else if (r.visible) {
+ // If this activity is already visible, then there is nothing
+ // else to do here.
if (DEBUG_VISBILITY) Slog.v(
- TAG, "Starting and making visible: " + r);
- mService.mWindowManager.setAppVisibility(r.appToken, true);
- }
- if (r != starting) {
- startSpecificActivityLocked(r, false, false);
- }
- }
-
- } else if (r.visible) {
- // If this activity is already visible, then there is nothing
- // else to do here.
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Skipping: already visible at " + r);
- r.stopFreezingScreenLocked(false);
-
- } else if (onlyThisProcess == null) {
- // This activity is not currently visible, but is running.
- // Tell it to become visible.
- r.visible = true;
- if (r.state != ActivityState.RESUMED && r != starting) {
- // If this activity is paused, tell it
- // to now show its window.
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Making visible and scheduling visibility: " + r);
- try {
- mService.mWindowManager.setAppVisibility(r.appToken, true);
- r.sleeping = false;
- r.app.pendingUiClean = true;
- r.app.thread.scheduleWindowVisibility(r.appToken, true);
+ TAG, "Skipping: already visible at " + r);
r.stopFreezingScreenLocked(false);
- } catch (Exception e) {
- // Just skip on any failure; we'll make it
- // visible when it next restarts.
- Slog.w(TAG, "Exception thrown making visibile: "
- + r.intent.getComponent(), e);
+
+ } else if (onlyThisProcess == null) {
+ // This activity is not currently visible, but is running.
+ // Tell it to become visible.
+ r.visible = true;
+ if (r.state != ActivityState.RESUMED && r != starting) {
+ // If this activity is paused, tell it
+ // to now show its window.
+ if (DEBUG_VISBILITY) Slog.v(
+ TAG, "Making visible and scheduling visibility: " + r);
+ try {
+ mService.mWindowManager.setAppVisibility(r.appToken, true);
+ r.sleeping = false;
+ r.app.pendingUiClean = true;
+ r.app.thread.scheduleWindowVisibility(r.appToken, true);
+ r.stopFreezingScreenLocked(false);
+ } catch (Exception e) {
+ // Just skip on any failure; we'll make it
+ // visible when it next restarts.
+ Slog.w(TAG, "Exception thrown making visibile: "
+ + r.intent.getComponent(), e);
+ }
+ }
}
- }
- }
- // Aggregate current change flags.
- configChanges |= r.configChangeFlags;
+ // Aggregate current change flags.
+ configChanges |= r.configChangeFlags;
- if (r.fullscreen) {
- // At this point, nothing else needs to be shown
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Stopping: fullscreen at " + r);
- behindFullscreen = true;
- i--;
- break;
- }
- }
-
- // Now for any activities that aren't visible to the user, make
- // sure they no longer are keeping the screen frozen.
- while (i >= 0) {
- r = mHistory.get(i);
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Make invisible? " + r + " finishing=" + r.finishing
- + " state=" + r.state
- + " behindFullscreen=" + behindFullscreen);
- if (!r.finishing) {
- if (behindFullscreen) {
+ if (r.fullscreen) {
+ // At this point, nothing else needs to be shown
+ if (DEBUG_VISBILITY) Slog.v(
+ TAG, "Stopping: fullscreen at " + r);
+ behindFullscreen = true;
+ }
+ } else {
if (r.visible) {
if (DEBUG_VISBILITY) Slog.v(
TAG, "Making invisible: " + r);
@@ -1397,13 +1470,8 @@
if (DEBUG_VISBILITY) Slog.v(
TAG, "Already invisible: " + r);
}
- } else if (r.fullscreen) {
- if (DEBUG_VISBILITY) Slog.v(
- TAG, "Now behindFullscreen: " + r);
- behindFullscreen = true;
}
}
- i--;
}
}
@@ -1641,7 +1709,7 @@
mService.mWindowManager.setAppWillBeHidden(prev.appToken);
mService.mWindowManager.setAppVisibility(prev.appToken, false);
}
- } else if (mHistory.size() > 1) {
+ } else if (numActivities() > 1) {
if (DEBUG_TRANSITION) Slog.v(TAG,
"Prepare open transition: no previous");
if (mNoAnimActivities.contains(next)) {
@@ -1722,7 +1790,7 @@
try {
// Deliver all pending results.
- ArrayList a = next.results;
+ ArrayList<ResultInfo> a = next.results;
if (a != null) {
final int N = a.size();
if (!next.finishing && N > 0) {
@@ -1810,8 +1878,15 @@
return true;
}
+ /** Temporary until startActivityLocked is rewritten for tasks. */
+ private int convertAddPos(int addPos) {
+ final ActivityRecord r = mHistory.get(addPos);
+ return r.task.mActivities.indexOf(r);
+ }
+
private final void startActivityLocked(ActivityRecord r, boolean newTask,
boolean doResume, boolean keepCurTransition, Bundle options) {
+ mLastHistoryModifier = "startActivityLocked";
final int NH = mHistory.size();
int addPos = -1;
@@ -1821,9 +1896,6 @@
boolean startIt = true;
for (int i = NH-1; i >= 0; i--) {
ActivityRecord p = mHistory.get(i);
- if (p.finishing) {
- continue;
- }
if (p.task == r.task) {
// Here it is! Now, if this is not yet visible to the
// user, then just add it without starting; it will
@@ -1836,13 +1908,15 @@
Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos,
here);
}
+ r.task.addActivityToTop(r);
mHistory.add(addPos, r);
r.putInHistory();
- mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
- r.info.screenOrientation, r.fullscreen,
+ mService.mWindowManager.addAppToken(convertAddPos(addPos), r.appToken,
+ r.task.taskId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
if (VALIDATE_TOKENS) {
validateAppTokensLocked();
+ verifyActivityRecords(true);
}
ActivityOptions.abort(options);
return;
@@ -1870,14 +1944,17 @@
}
// Slot the activity into the history stack and proceed
- if (DEBUG_ADD_REMOVE) {
- RuntimeException here = new RuntimeException("here");
- here.fillInStackTrace();
- Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos, here);
- }
+ if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos,
+ new RuntimeException("here").fillInStackTrace());
+ r.task.addActivityToTop(r);
mHistory.add(addPos, r);
r.putInHistory();
r.frontOfTask = newTask;
+ if (VALIDATE_TASK_REPLACE) {
+ if (verifyActivityRecords(false)) {
+ Slog.w(TAG, "startActivityLocked: addPos=" + addPos);
+ }
+ }
if (NH > 0) {
// We want to show the starting preview window if we are
// switching to a new task, or the next activity's process is
@@ -1903,8 +1980,8 @@
mNoAnimActivities.remove(r);
}
r.updateOptionsLocked(options);
- mService.mWindowManager.addAppToken(
- addPos, r.appToken, r.task.taskId, r.info.screenOrientation, r.fullscreen,
+ mService.mWindowManager.addAppToken(convertAddPos(addPos),
+ r.appToken, r.task.taskId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
boolean doShow = true;
if (newTask) {
@@ -1942,7 +2019,7 @@
} else {
// If this is the first activity, don't do any fancy animations,
// because there is nothing for it to animate on top of.
- mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
+ mService.mWindowManager.addAppToken(convertAddPos(addPos), r.appToken, r.task.taskId,
r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
ActivityOptions.abort(options);
@@ -1954,13 +2031,32 @@
if (doResume) {
resumeTopActivityLocked(null);
}
+ if (VALIDATE_TASK_REPLACE) {
+ if (verifyActivityRecords(true)) {
+ Slog.w(TAG, "startActivityLocked: addPos=" + addPos);
+ }
+ }
}
final void validateAppTokensLocked() {
+ verifyActivityRecords(true);
mValidateAppTokens.clear();
- mValidateAppTokens.ensureCapacity(mHistory.size());
- for (int i=0; i<mHistory.size(); i++) {
- mValidateAppTokens.add(mHistory.get(i).appToken);
+ mValidateAppTokens.ensureCapacity(numActivities());
+ final int numTasks = mTaskHistory.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ TaskRecord task = mTaskHistory.get(taskNdx);
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ if (activities.size() == 0) {
+ continue;
+ }
+ TaskGroup group = new TaskGroup();
+ group.taskId = task.taskId;
+ mValidateAppTokens.add(group);
+ final int numActivities = activities.size();
+ for (int activityNdx = 0; activityNdx < numActivities; ++activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ group.tokens.add(r.appToken);
+ }
}
mService.mWindowManager.validateAppTokens(mValidateAppTokens);
}
@@ -1969,216 +2065,39 @@
* Perform a reset of the given task, if needed as part of launching it.
* Returns the new HistoryRecord at the top of the task.
*/
- private final ActivityRecord resetTaskIfNeededLocked(ActivityRecord taskTop,
- ActivityRecord newActivity) {
- boolean forceReset = (newActivity.info.flags
- &ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH) != 0;
- if (ACTIVITY_INACTIVE_RESET_TIME > 0
- && taskTop.task.getInactiveDuration() > ACTIVITY_INACTIVE_RESET_TIME) {
- if ((newActivity.info.flags
- &ActivityInfo.FLAG_ALWAYS_RETAIN_TASK_STATE) == 0) {
- forceReset = true;
- }
- }
-
- final TaskRecord task = taskTop.task;
-
- // We are going to move through the history list so that we can look
- // at each activity 'target' with 'below' either the interesting
- // activity immediately below it in the stack or null.
- ActivityRecord target = null;
- int targetI = 0;
- int taskTopI = -1;
- int replyChainEnd = -1;
- int lastReparentPos = -1;
+ /**
+ * Helper method for #resetTaskIfNeededLocked.
+ * We are inside of the task being reset... we'll either finish this activity, push it out
+ * for another task, or leave it as-is.
+ * @param task The task containing the Activity (taskTop) that might be reset.
+ * @param forceReset
+ * @return An ActivityOptions that needs to be processed.
+ */
+ private final ActivityOptions resetTargetTaskIfNeededLocked(TaskRecord task,
+ boolean forceReset) {
ActivityOptions topOptions = null;
- boolean canMoveOptions = true;
- for (int i=mHistory.size()-1; i>=-1; i--) {
- ActivityRecord below = i >= 0 ? mHistory.get(i) : null;
-
- if (below != null && below.finishing) {
- continue;
- }
- // Don't check any lower in the stack if we're crossing a user boundary.
- if (below != null && below.userId != taskTop.userId) {
- break;
- }
- if (target == null) {
- target = below;
- targetI = i;
- // If we were in the middle of a reply chain before this
- // task, it doesn't appear like the root of the chain wants
- // anything interesting, so drop it.
- replyChainEnd = -1;
- continue;
- }
-
- final int flags = target.info.flags;
-
- final boolean finishOnTaskLaunch =
- (flags&ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH) != 0;
- final boolean allowTaskReparenting =
- (flags&ActivityInfo.FLAG_ALLOW_TASK_REPARENTING) != 0;
-
- if (target.task == task) {
- // We are inside of the task being reset... we'll either
- // finish this activity, push it out for another task,
- // or leave it as-is. We only do this
- // for activities that are not the root of the task (since
- // if we finish the root, we may no longer have the task!).
- if (taskTopI < 0) {
- taskTopI = targetI;
- }
- if (below != null && below.task == task) {
- final boolean clearWhenTaskReset =
- (target.intent.getFlags()
- &Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0;
- if (!finishOnTaskLaunch && !clearWhenTaskReset && target.resultTo != null) {
- // If this activity is sending a reply to a previous
- // activity, we can't do anything with it now until
- // we reach the start of the reply chain.
- // XXX note that we are assuming the result is always
- // to the previous activity, which is almost always
- // the case but we really shouldn't count on.
- if (replyChainEnd < 0) {
- replyChainEnd = targetI;
- }
- } else if (!finishOnTaskLaunch && !clearWhenTaskReset && allowTaskReparenting
- && target.taskAffinity != null
- && !target.taskAffinity.equals(task.affinity)) {
- // If this activity has an affinity for another
- // task, then we need to move it out of here. We will
- // move it as far out of the way as possible, to the
- // bottom of the activity stack. This also keeps it
- // correctly ordered with any activities we previously
- // moved.
- ActivityRecord p = mHistory.get(0);
- if (target.taskAffinity != null
- && target.taskAffinity.equals(p.task.affinity)) {
- // If the activity currently at the bottom has the
- // same task affinity as the one we are moving,
- // then merge it into the same task.
- target.setTask(p.task, p.thumbHolder, false);
- if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
- + " out to bottom task " + p.task);
- } else {
- mService.mCurTask++;
- if (mService.mCurTask <= 0) {
- mService.mCurTask = 1;
- }
- target.setTask(new TaskRecord(mService.mCurTask, target.info, null),
- null, false);
- target.task.affinityIntent = target.intent;
- if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
- + " out to new task " + target.task);
- }
- mService.mWindowManager.setAppGroupId(target.appToken, task.taskId);
- if (replyChainEnd < 0) {
- replyChainEnd = targetI;
- }
- int dstPos = 0;
- ThumbnailHolder curThumbHolder = target.thumbHolder;
- boolean gotOptions = !canMoveOptions;
- for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
- p = mHistory.get(srcPos);
- if (p.finishing) {
- continue;
- }
- if (DEBUG_TASKS) Slog.v(TAG, "Pushing next activity " + p
- + " out to target's task " + target.task);
- p.setTask(target.task, curThumbHolder, false);
- curThumbHolder = p.thumbHolder;
- canMoveOptions = false;
- if (!gotOptions && topOptions == null) {
- topOptions = p.takeOptionsLocked();
- if (topOptions != null) {
- gotOptions = true;
- }
- }
- if (DEBUG_ADD_REMOVE) {
- RuntimeException here = new RuntimeException("here");
- here.fillInStackTrace();
- Slog.i(TAG, "Removing and adding activity " + p + " to stack at "
- + dstPos, here);
- }
- mHistory.remove(srcPos);
- mHistory.add(dstPos, p);
- mService.mWindowManager.moveAppToken(dstPos, p.appToken);
- mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
- dstPos++;
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
- }
- i++;
- }
- if (taskTop == p) {
- taskTop = below;
- }
- if (taskTopI == replyChainEnd) {
- taskTopI = -1;
- }
- replyChainEnd = -1;
- } else if (forceReset || finishOnTaskLaunch
- || clearWhenTaskReset) {
- // If the activity should just be removed -- either
- // because it asks for it, or the task should be
- // cleared -- then finish it and anything that is
- // part of its reply chain.
- if (clearWhenTaskReset) {
- // In this case, we want to finish this activity
- // and everything above it, so be sneaky and pretend
- // like these are all in the reply chain.
- replyChainEnd = targetI+1;
- while (replyChainEnd < mHistory.size() &&
- (mHistory.get(
- replyChainEnd)).task == task) {
- replyChainEnd++;
- }
- replyChainEnd--;
- } else if (replyChainEnd < 0) {
- replyChainEnd = targetI;
- }
- ActivityRecord p = null;
- boolean gotOptions = !canMoveOptions;
- for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
- p = mHistory.get(srcPos);
- if (p.finishing) {
- continue;
- }
- canMoveOptions = false;
- if (!gotOptions && topOptions == null) {
- topOptions = p.takeOptionsLocked();
- if (topOptions != null) {
- gotOptions = true;
- }
- }
- if (finishActivityLocked(p, srcPos,
- Activity.RESULT_CANCELED, null, "reset", false)) {
- replyChainEnd--;
- srcPos--;
- }
- }
- if (taskTop == p) {
- taskTop = below;
- }
- if (taskTopI == replyChainEnd) {
- taskTopI = -1;
- }
- replyChainEnd = -1;
- } else {
- // If we were in the middle of a chain, well the
- // activity that started it all doesn't want anything
- // special, so leave it all as-is.
- replyChainEnd = -1;
- }
- } else {
- // Reached the bottom of the task -- any reply chain
- // should be left as-is.
- replyChainEnd = -1;
- }
- } else if (target.resultTo != null && (below == null
- || below.task == target.task)) {
+ int replyChainEnd = -1;
+ boolean canMoveOptions = true;
+
+ // We only do this for activities that are not the root of the task (since if we finish
+ // the root, we may no longer have the task!).
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ final int numActivities = activities.size();
+ for (int i = numActivities - 1; i > 0; --i ) {
+ ActivityRecord target = activities.get(i);
+
+ final int flags = target.info.flags;
+ final boolean finishOnTaskLaunch =
+ (flags & ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH) != 0;
+ final boolean allowTaskReparenting =
+ (flags & ActivityInfo.FLAG_ALLOW_TASK_REPARENTING) != 0;
+ final boolean clearWhenTaskReset =
+ (target.intent.getFlags() & Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0;
+
+ if (!finishOnTaskLaunch
+ && !clearWhenTaskReset
+ && target.resultTo != null) {
// If this activity is sending a reply to a previous
// activity, we can't do anything with it now until
// we reach the start of the reply chain.
@@ -2186,14 +2105,175 @@
// to the previous activity, which is almost always
// the case but we really shouldn't count on.
if (replyChainEnd < 0) {
- replyChainEnd = targetI;
+ replyChainEnd = i;
+ }
+ } else if (!finishOnTaskLaunch
+ && !clearWhenTaskReset
+ && allowTaskReparenting
+ && target.taskAffinity != null
+ && !target.taskAffinity.equals(task.affinity)) {
+ // If this activity has an affinity for another
+ // task, then we need to move it out of here. We will
+ // move it as far out of the way as possible, to the
+ // bottom of the activity stack. This also keeps it
+ // correctly ordered with any activities we previously
+ // moved.
+ TaskRecord bottomTask = mTaskHistory.get(0);
+ ActivityRecord p = bottomTask.mActivities.get(0);
+ if (target.taskAffinity != null
+ && target.taskAffinity.equals(p.task.affinity)) {
+ // If the activity currently at the bottom has the
+ // same task affinity as the one we are moving,
+ // then merge it into the same task.
+ if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "resetTaskFoundIntended: would reparenting " + target + " to bottom " + p.task);
+ target.setTask(p.task, p.thumbHolder, false);
+ if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
+ + " out to bottom task " + p.task);
+ } else {
+ do {
+ mService.mCurTask++;
+ if (mService.mCurTask <= 0) {
+ mService.mCurTask = 1;
+ }
+ } while (mTaskIdToTaskRecord.get(mService.mCurTask) != null);
+ target.setTask(createTaskRecord(mService.mCurTask, target.info, null, false),
+ null, false);
+ target.task.affinityIntent = target.intent;
+ if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
+ + " out to new task " + target.task);
}
- } else if (taskTopI >= 0 && allowTaskReparenting
- && task.affinity != null
- && task.affinity.equals(target.taskAffinity)) {
- // We are inside of another task... if this activity has
- // an affinity for our task, then either remove it if we are
+ final TaskRecord targetTask = target.task;
+ final int targetTaskId = targetTask.taskId;
+ mService.mWindowManager.setAppGroupId(target.appToken, targetTaskId);
+
+ ThumbnailHolder curThumbHolder = target.thumbHolder;
+ boolean gotOptions = !canMoveOptions;
+
+ final int start = replyChainEnd < 0 ? i : replyChainEnd;
+ for (int srcPos = start; srcPos >= i; --srcPos) {
+ p = activities.get(srcPos);
+ if (p.finishing) {
+ continue;
+ }
+
+ curThumbHolder = p.thumbHolder;
+ canMoveOptions = false;
+ if (!gotOptions && topOptions == null) {
+ topOptions = p.takeOptionsLocked();
+ if (topOptions != null) {
+ gotOptions = true;
+ }
+ }
+ if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing activity " + p + " from task="
+ + task + " adding to task=" + targetTask,
+ new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_TASKS) Slog.v(TAG, "Pushing next activity " + p
+ + " out to target's task " + target.task);
+ p.setTask(targetTask, curThumbHolder, false);
+ targetTask.addActivityAtBottom(p);
+ mHistory.remove(p);
+ mHistory.add(0, p);
+ mService.mWindowManager.setAppGroupId(p.appToken, targetTaskId);
+ }
+
+ mService.mWindowManager.moveTaskToBottom(targetTaskId);
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
+
+ replyChainEnd = -1;
+ } else if (forceReset || finishOnTaskLaunch || clearWhenTaskReset) {
+ // If the activity should just be removed -- either
+ // because it asks for it, or the task should be
+ // cleared -- then finish it and anything that is
+ // part of its reply chain.
+ int end;
+ if (clearWhenTaskReset) {
+ // In this case, we want to finish this activity
+ // and everything above it, so be sneaky and pretend
+ // like these are all in the reply chain.
+ end = numActivities - 1;
+ } else if (replyChainEnd < 0) {
+ end = i;
+ } else {
+ end = replyChainEnd;
+ }
+ ActivityRecord p = null;
+ boolean gotOptions = !canMoveOptions;
+ for (int srcPos = i; srcPos <= end; srcPos++) {
+ p = activities.get(srcPos);
+ if (p.finishing) {
+ continue;
+ }
+ canMoveOptions = false;
+ if (!gotOptions && topOptions == null) {
+ topOptions = p.takeOptionsLocked();
+ if (topOptions != null) {
+ gotOptions = true;
+ }
+ }
+ if (DEBUG_TASKS || VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "resetTaskIntendedTask: would call finishActivity on " + p);
+ if (finishActivityLocked(p, Activity.RESULT_CANCELED, null, "reset", false)) {
+ end--;
+ srcPos--;
+ }
+ }
+ replyChainEnd = -1;
+ } else {
+ // If we were in the middle of a chain, well the
+ // activity that started it all doesn't want anything
+ // special, so leave it all as-is.
+ replyChainEnd = -1;
+ }
+ }
+
+ return topOptions;
+ }
+
+ /**
+ * Helper method for #resetTaskIfNeededLocked. Processes all of the activities in a given
+ * TaskRecord looking for an affinity with the task of resetTaskIfNeededLocked.taskTop.
+ * @param affinityTask The task we are looking for an affinity to.
+ * @param task Task that resetTaskIfNeededLocked.taskTop belongs to.
+ * @param topTaskIsHigher True if #task has already been processed by resetTaskIfNeededLocked.
+ * @param forceReset Flag passed in to resetTaskIfNeededLocked.
+ */
+ private final void resetAffinityTaskIfNeededLocked(TaskRecord affinityTask, TaskRecord task,
+ boolean topTaskIsHigher, boolean forceReset
+ , ActivityRecord taskTop
+ ) {
+ int replyChainEnd = -1;
+ final int taskId = task.taskId;
+ final String taskAffinity = task.affinity;
+
+ final ArrayList<ActivityRecord> activities = affinityTask.mActivities;
+ final int numActivities = activities.size();
+ // Do not operate on the root Activity.
+ for (int i = numActivities - 1; i > 0; --i) {
+ ActivityRecord target = activities.get(i);
+
+ final int flags = target.info.flags;
+ boolean finishOnTaskLaunch = (flags & ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH) != 0;
+ boolean allowTaskReparenting = (flags & ActivityInfo.FLAG_ALLOW_TASK_REPARENTING) != 0;
+
+ if (target.resultTo != null) {
+ // If this activity is sending a reply to a previous
+ // activity, we can't do anything with it now until
+ // we reach the start of the reply chain.
+ // XXX note that we are assuming the result is always
+ // to the previous activity, which is almost always
+ // the case but we really shouldn't count on.
+ if (replyChainEnd < 0) {
+ replyChainEnd = i;
+ }
+ } else if (topTaskIsHigher
+ && allowTaskReparenting
+ && taskAffinity != null
+ && taskAffinity.equals(target.taskAffinity)) {
+ // This activity has an affinity for our task. Either remove it if we are
// clearing or move it over to our task. Note that
// we currently punt on the case where we are resetting a
// task that is not at the top but who has activities above
@@ -2204,107 +2284,118 @@
// someone starts an activity in a new task from an activity
// in a task that is not currently on top.)
if (forceReset || finishOnTaskLaunch) {
- if (replyChainEnd < 0) {
- replyChainEnd = targetI;
- }
- ActivityRecord p = null;
- if (DEBUG_TASKS) Slog.v(TAG, "Finishing task at index "
- + targetI + " to " + replyChainEnd);
- for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
- p = mHistory.get(srcPos);
+ final int start = replyChainEnd >= 0 ? replyChainEnd : i;
+ if (DEBUG_TASKS) Slog.v(TAG, "Finishing task at index " + start + " to " + i);
+ for (int srcPos = start; srcPos >= i; --srcPos) {
+ final ActivityRecord p = activities.get(srcPos);
if (p.finishing) {
continue;
}
- if (finishActivityLocked(p, srcPos,
- Activity.RESULT_CANCELED, null, "reset", false)) {
- taskTopI--;
- lastReparentPos--;
- replyChainEnd--;
- srcPos--;
- }
+ if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "resetAffinityTaskIfNeededLocked: calling finishActivity on " + p);
+ finishActivityLocked(p, Activity.RESULT_CANCELED, null, "reset", false);
}
- replyChainEnd = -1;
} else {
- if (replyChainEnd < 0) {
- replyChainEnd = targetI;
- }
- if (DEBUG_TASKS) Slog.v(TAG, "Reparenting task at index "
- + targetI + " to " + replyChainEnd);
- for (int srcPos=replyChainEnd; srcPos>=targetI; srcPos--) {
- ActivityRecord p = mHistory.get(srcPos);
- if (p.finishing) {
- continue;
- }
- if (lastReparentPos < 0) {
- lastReparentPos = taskTopI;
- taskTop = p;
- } else {
- lastReparentPos--;
- }
- if (DEBUG_ADD_REMOVE) {
- RuntimeException here = new RuntimeException("here");
- here.fillInStackTrace();
- Slog.i(TAG, "Removing and adding activity " + p + " to stack at "
- + lastReparentPos, here);
- }
- mHistory.remove(srcPos);
+ int taskTopI = mHistory.indexOf(taskTop);
+ final int end = replyChainEnd >= 0 ? replyChainEnd : i;
+ if (DEBUG_TASKS) Slog.v(TAG, "Reparenting task at index " + i + " to " + end);
+ for (int srcPos = i; srcPos <= end; ++srcPos) {
+ final ActivityRecord p = activities.get(srcPos);
p.setTask(task, null, false);
- mHistory.add(lastReparentPos, p);
- if (DEBUG_TASKS) Slog.v(TAG, "Pulling activity " + p
- + " from " + srcPos + " to " + lastReparentPos
+ task.addActivityToTop(p);
+
+ mHistory.remove(p);
+ mHistory.add(taskTopI, p);
+
+ if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing and adding activity " + p
+ + " to stack at " + task,
+ new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_TASKS) Slog.v(TAG, "Pulling activity " + p + " from " + srcPos
+ " in to resetting task " + task);
- mService.mWindowManager.moveAppToken(lastReparentPos, p.appToken);
- mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
- }
+ mService.mWindowManager.setAppGroupId(p.appToken, taskId);
}
- replyChainEnd = -1;
-
+ mService.mWindowManager.moveTaskToTop(taskId);
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(false);
+ }
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
+
// Now we've moved it in to place... but what if this is
// a singleTop activity and we have put it on top of another
// instance of the same activity? Then we drop the instance
// below so it remains singleTop.
if (target.info.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP) {
- for (int j=lastReparentPos-1; j>=0; j--) {
- ActivityRecord p = mHistory.get(j);
- if (p.finishing) {
- continue;
- }
+ ArrayList<ActivityRecord> taskActivities = task.mActivities;
+ boolean found = false;
+ int targetNdx = taskActivities.indexOf(target);
+ if (targetNdx > 0) {
+ ActivityRecord p = taskActivities.get(targetNdx - 1);
if (p.intent.getComponent().equals(target.intent.getComponent())) {
- if (finishActivityLocked(p, j,
- Activity.RESULT_CANCELED, null, "replace", false)) {
+ if (finishActivityLocked(p, Activity.RESULT_CANCELED, null, "replace",
+ false)) {
taskTopI--;
- lastReparentPos--;
}
}
}
}
}
- } else if (below != null && below.task != target.task) {
- // We hit the botton of a task; the reply chain can't
- // pass through it.
replyChainEnd = -1;
}
-
- target = below;
- targetI = i;
+ }
+ }
+
+ private final ActivityRecord resetTaskIfNeededLocked(ActivityRecord taskTop,
+ ActivityRecord newActivity) {
+ boolean forceReset =
+ (newActivity.info.flags & ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH) != 0;
+ if (ACTIVITY_INACTIVE_RESET_TIME > 0
+ && taskTop.task.getInactiveDuration() > ACTIVITY_INACTIVE_RESET_TIME) {
+ if ((newActivity.info.flags & ActivityInfo.FLAG_ALWAYS_RETAIN_TASK_STATE) == 0) {
+ forceReset = true;
+ }
}
+ final TaskRecord task = taskTop.task;
+
+ /** False until we evaluate the TaskRecord associated with taskTop. Switches to true
+ * for remaining tasks. Used for later tasks to reparent to task. */
+ boolean taskFound = false;
+
+ /** If ActivityOptions are moved out and need to be aborted or moved to taskTop. */
+ ActivityOptions topOptions = null;
+
+ for (int i = mTaskHistory.size() - 1; i >= 0; --i) {
+ final TaskRecord targetTask = mTaskHistory.get(i);
+
+ if (targetTask == task) {
+ topOptions = resetTargetTaskIfNeededLocked(task, forceReset);
+ taskFound = true;
+ } else {
+ resetAffinityTaskIfNeededLocked(targetTask, task, taskFound, forceReset, taskTop);
+ }
+ }
+
+ taskTop = task.getTopActivity();
if (topOptions != null) {
// If we got some ActivityOptions from an activity on top that
// was removed from the task, propagate them to the new real top.
if (taskTop != null) {
+ if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "newResetTaskIfNeededLocked: would call updateOptionsLocked " + topOptions);
taskTop.updateOptionsLocked(topOptions);
} else {
+ if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
+ "newResetTaskIfNeededLocked: would call " + topOptions + " abort");
topOptions.abort();
}
}
return taskTop;
}
-
+
/**
* Perform clear operation as requested by
* {@link Intent#FLAG_ACTIVITY_CLEAR_TOP}: search from the top of the
@@ -2316,39 +2407,22 @@
* @return Returns the old activity that should be continued to be used,
* or null if none was found.
*/
- private final ActivityRecord performClearTaskLocked(int taskId,
+ private final ActivityRecord performClearTaskLocked(TaskRecord task,
ActivityRecord newR, int launchFlags) {
- int i = mHistory.size();
-
- // First find the requested task.
- while (i > 0) {
- i--;
- ActivityRecord r = mHistory.get(i);
- if (r.task.taskId == taskId) {
- i++;
- break;
- }
- }
-
- // Now clear it.
- while (i > 0) {
- i--;
- ActivityRecord r = mHistory.get(i);
+
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ int numActivities = activities.size();
+ for (int activityNdx = numActivities - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
if (r.finishing) {
continue;
}
- if (r.task.taskId != taskId) {
- return null;
- }
if (r.realActivity.equals(newR.realActivity)) {
// Here it is! Now finish everything in front...
ActivityRecord ret = r;
- while (i < (mHistory.size()-1)) {
- i++;
- r = mHistory.get(i);
- if (r.task.taskId != taskId) {
- break;
- }
+
+ for (++activityNdx; activityNdx < numActivities; ++activityNdx) {
+ r = activities.get(activityNdx);
if (r.finishing) {
continue;
}
@@ -2356,27 +2430,26 @@
if (opts != null) {
ret.updateOptionsLocked(opts);
}
- if (finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "clear", false)) {
- i--;
+ if (finishActivityLocked(r, Activity.RESULT_CANCELED, null, "clear", false)) {
+ --activityNdx;
+ --numActivities;
}
}
-
+
// Finally, if this is a normal launch mode (that is, not
// expecting onNewIntent()), then we will finish the current
// instance of the activity so a new fresh one can be started.
if (ret.launchMode == ActivityInfo.LAUNCH_MULTIPLE
- && (launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) == 0) {
+ && (launchFlags & Intent.FLAG_ACTIVITY_SINGLE_TOP) == 0) {
if (!ret.finishing) {
- int index = indexOfTokenLocked(ret.appToken);
- if (index >= 0) {
- finishActivityLocked(ret, index, Activity.RESULT_CANCELED,
- null, "clear", false);
+ if (activities.contains(ret)) {
+ finishActivityLocked(ret, Activity.RESULT_CANCELED, null,
+ "clear", false);
}
return null;
}
}
-
+
return ret;
}
}
@@ -2388,20 +2461,17 @@
* Completely remove all activities associated with an existing
* task starting at a specified index.
*/
- private final void performClearTaskAtIndexLocked(int taskId, int i) {
- while (i < mHistory.size()) {
- ActivityRecord r = mHistory.get(i);
- if (r.task.taskId != taskId) {
- // Whoops hit the end.
- return;
- }
+ private final void performClearTaskAtIndexLocked(TaskRecord task, int activityNdx) {
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ int numActivities = activities.size();
+ for ( ; activityNdx < numActivities; ++activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
if (r.finishing) {
- i++;
continue;
}
- if (!finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "clear", false)) {
- i++;
+ if (finishActivityLocked(r, Activity.RESULT_CANCELED, null, "clear", false)) {
+ --activityNdx;
+ --numActivities;
}
}
}
@@ -2409,75 +2479,48 @@
/**
* Completely remove all activities associated with an existing task.
*/
- private final void performClearTaskLocked(int taskId) {
- int i = mHistory.size();
-
- // First find the requested task.
- while (i > 0) {
- i--;
- ActivityRecord r = mHistory.get(i);
- if (r.task.taskId == taskId) {
- i++;
- break;
- }
- }
-
- // Now find the start and clear it.
- while (i > 0) {
- i--;
- ActivityRecord r = mHistory.get(i);
- if (r.finishing) {
- continue;
- }
- if (r.task.taskId != taskId) {
- // We hit the bottom. Now finish it all...
- performClearTaskAtIndexLocked(taskId, i+1);
- return;
- }
- }
+ private final void performClearTaskLocked(TaskRecord task) {
+ performClearTaskAtIndexLocked(task, 0);
}
/**
* Find the activity in the history stack within the given task. Returns
* the index within the history at which it's found, or < 0 if not found.
*/
- private final int findActivityInHistoryLocked(ActivityRecord r, int task) {
- int i = mHistory.size();
- while (i > 0) {
- i--;
- ActivityRecord candidate = mHistory.get(i);
+ private final ActivityRecord findActivityInHistoryLocked(ActivityRecord r, TaskRecord task) {
+ final ComponentName realActivity = r.realActivity;
+ ArrayList<ActivityRecord> activities = task.mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord candidate = activities.get(activityNdx);
if (candidate.finishing) {
continue;
}
- if (candidate.task.taskId != task) {
- break;
- }
- if (candidate.realActivity.equals(r.realActivity)) {
- return i;
+ if (candidate.realActivity.equals(realActivity)) {
+ return candidate;
}
}
-
- return -1;
+ return null;
}
/**
* Reorder the history stack so that the activity at the given index is
* brought to the front.
*/
- private final ActivityRecord moveActivityToFrontLocked(int where) {
- ActivityRecord newTop = mHistory.remove(where);
- int top = mHistory.size();
- ActivityRecord oldTop = mHistory.get(top-1);
- if (DEBUG_ADD_REMOVE) {
- RuntimeException here = new RuntimeException("here");
- here.fillInStackTrace();
- Slog.i(TAG, "Removing and adding activity " + newTop + " to stack at "
- + top, here);
- }
- mHistory.add(top, newTop);
- oldTop.frontOfTask = false;
+ private final void moveActivityToFrontLocked(ActivityRecord newTop) {
+ if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing and adding activity " + newTop
+ + " to stack at top", new RuntimeException("here").fillInStackTrace());
+
+ final TaskRecord task = newTop.task;
+ task.getTopActivity().frontOfTask = false;
+ task.mActivities.remove(newTop);
+ task.mActivities.add(newTop);
newTop.frontOfTask = true;
- return newTop;
+
+ mHistory.remove(newTop);
+ mHistory.add(newTop);
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
+ }
}
final int startActivityLocked(IApplicationThread caller,
@@ -2485,6 +2528,7 @@
String resultWho, int requestCode,
int callingPid, int callingUid, String callingPackage, int startFlags, Bundle options,
boolean componentSpecified, ActivityRecord[] outActivity) {
+ mLastHistoryModifier = "startActivityLocked(IApplicationThread)";
int err = ActivityManager.START_SUCCESS;
@@ -2511,11 +2555,10 @@
ActivityRecord sourceRecord = null;
ActivityRecord resultRecord = null;
if (resultTo != null) {
- int index = indexOfTokenLocked(resultTo);
+ sourceRecord = isInStackLocked(resultTo);
if (DEBUG_RESULTS) Slog.v(
- TAG, "Will send result to " + resultTo + " (index " + index + ")");
- if (index >= 0) {
- sourceRecord = mHistory.get(index);
+ TAG, "Will send result to " + resultTo + " " + sourceRecord);
+ if (sourceRecord != null) {
if (requestCode >= 0 && !sourceRecord.finishing) {
resultRecord = sourceRecord;
}
@@ -2821,7 +2864,7 @@
// existing task with its new activity. Well that should
// not be too hard...
reuseTask = taskTop.task;
- performClearTaskLocked(taskTop.task.taskId);
+ performClearTaskLocked(taskTop.task);
reuseTask.setIntent(r.intent, r.info);
} else if ((launchFlags&Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0
|| r.launchMode == ActivityInfo.LAUNCH_SINGLE_TASK
@@ -2830,8 +2873,7 @@
// from the task up to the one being started. In most
// cases this means we are resetting the task to its
// initial state.
- ActivityRecord top = performClearTaskLocked(
- taskTop.task.taskId, r, launchFlags);
+ ActivityRecord top = performClearTaskLocked(taskTop.task, r, launchFlags);
if (top != null) {
if (top.frontOfTask) {
// Activity aliases may mean we use different
@@ -2967,7 +3009,7 @@
if (mService.mCurTask <= 0) {
mService.mCurTask = 1;
}
- r.setTask(new TaskRecord(mService.mCurTask, r.info, intent), null, true);
+ r.setTask(createTaskRecord(mService.mCurTask, r.info, intent, true), null, true);
if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
+ " in new task " + r.task);
} else {
@@ -2984,8 +3026,7 @@
// In this case, we are adding the activity to an existing
// task, but the caller has asked to clear that task if the
// activity is already running.
- ActivityRecord top = performClearTaskLocked(
- sourceRecord.task.taskId, r, launchFlags);
+ ActivityRecord top = performClearTaskLocked(sourceRecord.task, r, launchFlags);
keepCurTransition = true;
if (top != null) {
logStartActivity(EventLogTags.AM_NEW_INTENT, r, top.task);
@@ -3003,9 +3044,9 @@
// In this case, we are launching an activity in our own task
// that may already be running somewhere in the history, and
// we want to shuffle it to the front of the stack if so.
- int where = findActivityInHistoryLocked(r, sourceRecord.task.taskId);
- if (where >= 0) {
- ActivityRecord top = moveActivityToFrontLocked(where);
+ final ActivityRecord top = findActivityInHistoryLocked(r, sourceRecord.task);
+ if (top != null) {
+ moveActivityToFrontLocked(top);
logStartActivity(EventLogTags.AM_NEW_INTENT, r, top.task);
top.updateOptionsLocked(options);
top.deliverNewIntentLocked(callingUid, r.intent);
@@ -3026,12 +3067,19 @@
// This not being started from an existing activity, and not part
// of a new task... just put it in the top task, though these days
// this case should never happen.
- final int N = mHistory.size();
- ActivityRecord prev =
- N > 0 ? mHistory.get(N-1) : null;
+ ActivityRecord prev = null;
+ // Iterate to find the first non-empty task stack. Note that this code can
+ // go away once we stop storing tasks with empty mActivities lists.
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ prev = activities.get(activityNdx);
+ break;
+ }
+ }
r.setTask(prev != null
? prev.task
- : new TaskRecord(mService.mCurTask, r.info, intent), null, true);
+ : createTaskRecord(mService.mCurTask, r.info, intent, true), null, true);
if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
+ " in new guessed " + r.task);
}
@@ -3523,8 +3571,7 @@
}
// Get the activity record.
- int index = indexOfActivityLocked(r);
- if (index >= 0) {
+ if (isInStackLocked(token) != null) {
res = r;
if (fromTimeout) {
@@ -3579,9 +3626,9 @@
finishes = new ArrayList<ActivityRecord>(mFinishingActivities);
mFinishingActivities.clear();
}
- if ((NT=mService.mCancelledThumbnails.size()) > 0) {
- thumbnails = new ArrayList<ActivityRecord>(mService.mCancelledThumbnails);
- mService.mCancelledThumbnails.clear();
+ if ((NT=mCancelledThumbnails.size()) > 0) {
+ thumbnails = new ArrayList<ActivityRecord>(mCancelledThumbnails);
+ mCancelledThumbnails.clear();
}
if (mMainStack) {
@@ -3609,7 +3656,7 @@
// Stop any activities that are scheduled to do so but have been
// waiting for the next one to start.
for (i=0; i<NS; i++) {
- ActivityRecord r = (ActivityRecord)stops.get(i);
+ ActivityRecord r = stops.get(i);
synchronized (mService) {
if (r.finishing) {
finishCurrentActivityLocked(r, FINISH_IMMEDIATELY, false);
@@ -3622,7 +3669,7 @@
// Finish any activities that are scheduled to do so but have been
// waiting for the next one to start.
for (i=0; i<NF; i++) {
- ActivityRecord r = (ActivityRecord)finishes.get(i);
+ ActivityRecord r = finishes.get(i);
synchronized (mService) {
activityRemoved = destroyActivityLocked(r, true, false, "finish-idle");
}
@@ -3630,7 +3677,7 @@
// Report back to any thumbnail receivers.
for (i=0; i<NT; i++) {
- ActivityRecord r = (ActivityRecord)thumbnails.get(i);
+ ActivityRecord r = thumbnails.get(i);
mService.sendPendingThumbnail(r, null, null, null, true);
}
@@ -3663,17 +3710,16 @@
*/
final boolean requestFinishActivityLocked(IBinder token, int resultCode,
Intent resultData, String reason, boolean oomAdj) {
- int index = indexOfTokenLocked(token);
+ ActivityRecord r = isInStackLocked(token);
if (DEBUG_RESULTS || DEBUG_STATES) Slog.v(
- TAG, "Finishing activity @" + index + ": token=" + token
+ TAG, "Finishing activity token=" + token + " r="
+ ", result=" + resultCode + ", data=" + resultData
+ ", reason=" + reason);
- if (index < 0) {
+ if (r == null) {
return false;
}
- ActivityRecord r = mHistory.get(index);
- finishActivityLocked(r, index, resultCode, resultData, reason, oomAdj);
+ finishActivityLocked(r, resultCode, resultData, reason, oomAdj);
return true;
}
@@ -3683,43 +3729,78 @@
return;
}
- int i;
- for (i=mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = (ActivityRecord)mHistory.get(i);
- if (r.resultTo == self && r.requestCode == requestCode) {
- if ((r.resultWho == null && resultWho == null) ||
- (r.resultWho != null && r.resultWho.equals(resultWho))) {
- finishActivityLocked(r, i,
- Activity.RESULT_CANCELED, null, "request-sub", false);
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
+ if (r.resultTo == self && r.requestCode == requestCode) {
+ if ((r.resultWho == null && resultWho == null) ||
+ (r.resultWho != null && r.resultWho.equals(resultWho))) {
+ finishActivityLocked(r, Activity.RESULT_CANCELED, null, "request-sub",
+ false);
+ }
}
}
}
mService.updateOomAdjLocked();
}
+ final void finishTopRunningActivityLocked(ProcessRecord app) {
+ ActivityRecord r = topRunningActivityLocked(null);
+ if (r != null && r.app == app) {
+ // If the top running activity is from this crashing
+ // process, then terminate it to avoid getting in a loop.
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ int taskNdx = mTaskHistory.indexOf(r.task);
+ int activityNdx = r.task.mActivities.indexOf(r);
+ r.stack.finishActivityLocked(r, Activity.RESULT_CANCELED,
+ null, "crashed", false);
+ // Also terminate any activities below it that aren't yet
+ // stopped, to avoid a situation where one will get
+ // re-start our crashing activity once it gets resumed again.
+ --activityNdx;
+ if (activityNdx < 0) {
+ do {
+ --taskNdx;
+ if (taskNdx < 0) {
+ break;
+ }
+ activityNdx = mTaskHistory.get(taskNdx).mActivities.size() - 1;
+ } while (activityNdx < 0);
+ }
+ if (activityNdx >= 0) {
+ r = mTaskHistory.get(taskNdx).mActivities.get(activityNdx);
+ if (r.state == ActivityState.RESUMED
+ || r.state == ActivityState.PAUSING
+ || r.state == ActivityState.PAUSED) {
+ if (!r.isHomeActivity || mService.mHomeProcess != r.app) {
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ r.stack.finishActivityLocked(r, Activity.RESULT_CANCELED,
+ null, "crashed", false);
+ }
+ }
+ }
+ }
+ }
+
final boolean finishActivityAffinityLocked(IBinder token) {
- int index = indexOfTokenLocked(token);
+ ActivityRecord r = isInStackLocked(token);
if (DEBUG_RESULTS) Slog.v(
- TAG, "Finishing activity affinity @" + index + ": token=" + token);
- if (index < 0) {
+ TAG, "Finishing activity affinity token=" + token + " r=" + r);
+ if (r == null) {
return false;
}
- ActivityRecord r = mHistory.get(index);
- while (index >= 0) {
- ActivityRecord cur = mHistory.get(index);
- if (cur.task != r.task) {
+ ArrayList<ActivityRecord> activities = r.task.mActivities;
+ for (int index = activities.indexOf(r); index >= 0; --index) {
+ ActivityRecord cur = activities.get(index);
+ if (!Objects.equal(cur.taskAffinity, r.taskAffinity)) {
break;
}
- if (cur.taskAffinity == null && r.taskAffinity != null) {
- break;
- }
- if (cur.taskAffinity != null && !cur.taskAffinity.equals(r.taskAffinity)) {
- break;
- }
- finishActivityLocked(cur, index, Activity.RESULT_CANCELED, null,
- "request-affinity", true);
- index--;
+ finishActivityLocked(cur, Activity.RESULT_CANCELED, null, "request-affinity",
+ true);
}
return true;
}
@@ -3755,17 +3836,17 @@
* @return Returns true if this activity has been removed from the history
* list, or false if it is still in the list and will be removed later.
*/
- final boolean finishActivityLocked(ActivityRecord r, int index,
- int resultCode, Intent resultData, String reason, boolean oomAdj) {
- return finishActivityLocked(r, index, resultCode, resultData, reason, false, oomAdj);
+ final boolean finishActivityLocked(ActivityRecord r, int resultCode,
+ Intent resultData, String reason, boolean oomAdj) {
+ return finishActivityLocked(r, resultCode, resultData, reason, false, oomAdj);
}
/**
* @return Returns true if this activity has been removed from the history
* list, or false if it is still in the list and will be removed later.
*/
- final boolean finishActivityLocked(ActivityRecord r, int index, int resultCode,
- Intent resultData, String reason, boolean immediate, boolean oomAdj) {
+ final boolean finishActivityLocked(ActivityRecord r, int resultCode, Intent resultData,
+ String reason, boolean immediate, boolean oomAdj) {
if (r.finishing) {
Slog.w(TAG, "Duplicate finish request for " + r);
return false;
@@ -3775,19 +3856,19 @@
EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY,
r.userId, System.identityHashCode(r),
r.task.taskId, r.shortComponentName, reason);
- if (index < (mHistory.size()-1)) {
- ActivityRecord next = mHistory.get(index+1);
- if (next.task == r.task) {
- if (r.frontOfTask) {
- // The next activity is now the front of the task.
- next.frontOfTask = true;
- }
- if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) {
- // If the caller asked that this activity (and all above it)
- // be cleared when the task is reset, don't lose that information,
- // but propagate it up to the next activity.
- next.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
- }
+ final ArrayList<ActivityRecord> activities = r.task.mActivities;
+ final int index = activities.indexOf(r);
+ if (index < (activities.size() - 1)) {
+ ActivityRecord next = activities.get(index+1);
+ if (r.frontOfTask) {
+ // The next activity is now the front of the task.
+ next.frontOfTask = true;
+ }
+ if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) {
+ // If the caller asked that this activity (and all above it)
+ // be cleared when the task is reset, don't lose that information,
+ // but propagate it up to the next activity.
+ next.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
}
}
@@ -3804,12 +3885,11 @@
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
- mService.mCancelledThumbnails.add(r);
+ mCancelledThumbnails.add(r);
}
if (immediate) {
- return finishCurrentActivityLocked(r, index,
- FINISH_IMMEDIATELY, oomAdj) == null;
+ return finishCurrentActivityLocked(r, FINISH_IMMEDIATELY, oomAdj) == null;
} else if (mResumedActivity == r) {
boolean endTask = index <= 0
|| (mHistory.get(index-1)).task != r.task;
@@ -3832,8 +3912,7 @@
// If the activity is PAUSING, we will complete the finish once
// it is done pausing; else we can just directly finish it here.
if (DEBUG_PAUSE) Slog.v(TAG, "Finish not pausing: " + r);
- return finishCurrentActivityLocked(r, index,
- FINISH_AFTER_PAUSE, oomAdj) == null;
+ return finishCurrentActivityLocked(r, FINISH_AFTER_PAUSE, oomAdj) == null;
} else {
if (DEBUG_PAUSE) Slog.v(TAG, "Finish waiting for pause of: " + r);
}
@@ -3845,18 +3924,9 @@
private static final int FINISH_AFTER_PAUSE = 1;
private static final int FINISH_AFTER_VISIBLE = 2;
+
private final ActivityRecord finishCurrentActivityLocked(ActivityRecord r,
int mode, boolean oomAdj) {
- final int index = indexOfActivityLocked(r);
- if (index < 0) {
- return null;
- }
-
- return finishCurrentActivityLocked(r, index, mode, oomAdj);
- }
-
- private final ActivityRecord finishCurrentActivityLocked(ActivityRecord r,
- int index, int mode, boolean oomAdj) {
// First things first: if this activity is currently visible,
// and the resumed activity is not yet visible, then hold off on
// finishing until the resumed one becomes visible.
@@ -3903,16 +3973,102 @@
resumeTopActivityLocked(null);
}
return activityRemoved ? null : r;
- } else {
- // Need to go through the full pause cycle to get this
- // activity into the stopped state and then finish it.
- if (localLOGV) Slog.v(TAG, "Enqueueing pending finish: " + r);
- mFinishingActivities.add(r);
- resumeTopActivityLocked(null);
}
+
+ // Need to go through the full pause cycle to get this
+ // activity into the stopped state and then finish it.
+ if (localLOGV) Slog.v(TAG, "Enqueueing pending finish: " + r);
+ mFinishingActivities.add(r);
+ resumeTopActivityLocked(null);
return r;
}
+ final boolean navigateUpToLocked(ActivityRecord srec, Intent destIntent, int resultCode,
+ Intent resultData) {
+ final int start = mHistory.indexOf(srec);
+ if (start < 0) {
+ // Current activity is not in history stack; do nothing.
+ return false;
+ }
+ int finishTo = start - 1;
+ ActivityRecord parent = null;
+ boolean foundParentInTask = false;
+ ComponentName dest = destIntent.getComponent();
+ if (dest != null) {
+ TaskRecord tr = srec.task;
+ for (int i = start - 1; i >= 0; i--) {
+ ActivityRecord r = mHistory.get(i);
+ if (tr != r.task) {
+ // Couldn't find parent in the same task; stop at the one above this.
+ // (Root of current task; in-app "home" behavior)
+ // Always at least finish the current activity.
+ finishTo = Math.min(start - 1, i + 1);
+ parent = mHistory.get(finishTo);
+ break;
+ } else if (r.info.packageName.equals(dest.getPackageName()) &&
+ r.info.name.equals(dest.getClassName())) {
+ finishTo = i;
+ parent = r;
+ foundParentInTask = true;
+ break;
+ }
+ }
+ }
+
+ IActivityController controller = mService.mController;
+ if (controller != null) {
+ ActivityRecord next = topRunningActivityLocked(srec.appToken, 0);
+ if (next != null) {
+ // ask watcher if this is allowed
+ boolean resumeOK = true;
+ try {
+ resumeOK = controller.activityResuming(next.packageName);
+ } catch (RemoteException e) {
+ mService.mController = null;
+ }
+
+ if (!resumeOK) {
+ return false;
+ }
+ }
+ }
+ final long origId = Binder.clearCallingIdentity();
+ for (int i = start; i > finishTo; i--) {
+ ActivityRecord r = mHistory.get(i);
+ requestFinishActivityLocked(r.appToken, resultCode, resultData,
+ "navigate-up", true);
+ // Only return the supplied result for the first activity finished
+ resultCode = Activity.RESULT_CANCELED;
+ resultData = null;
+ }
+
+ if (parent != null && foundParentInTask) {
+ final int parentLaunchMode = parent.info.launchMode;
+ final int destIntentFlags = destIntent.getFlags();
+ if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE ||
+ parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
+ parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
+ (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
+ parent.deliverNewIntentLocked(srec.info.applicationInfo.uid, destIntent);
+ } else {
+ try {
+ ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
+ destIntent.getComponent(), 0, srec.userId);
+ int res = startActivityLocked(srec.app.thread, destIntent,
+ null, aInfo, parent.appToken, null,
+ 0, -1, parent.launchedFromUid, parent.launchedFromPackage,
+ 0, null, true, null);
+ foundParentInTask = res == ActivityManager.START_SUCCESS;
+ } catch (RemoteException e) {
+ foundParentInTask = false;
+ }
+ requestFinishActivityLocked(parent.appToken, resultCode,
+ resultData, "navigate-up", true);
+ }
+ }
+ Binder.restoreCallingIdentity(origId);
+ return foundParentInTask;
+ }
/**
* Perform the common clean-up of an activity record. This is called both
* as part of destroyActivityLocked() (when destroying the client-side
@@ -3964,7 +4120,7 @@
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
- mService.mCancelledThumbnails.add(r);
+ mCancelledThumbnails.add(r);
}
// Get rid of any pending idle timeouts.
@@ -3987,6 +4143,11 @@
here.fillInStackTrace();
Slog.i(TAG, "Removing activity " + r + " from stack");
}
+ final TaskRecord task = r.task;
+ if (task != null) {
+ // TODO: If this is the last ActivityRecord in task, remove from ActivityStack.
+ task.removeActivity(r);
+ }
mHistory.remove(r);
r.takeFromHistory();
removeTimeoutsForActivityLocked(r);
@@ -4027,31 +4188,34 @@
final void destroyActivitiesLocked(ProcessRecord owner, boolean oomAdj, String reason) {
boolean lastIsOpaque = false;
boolean activityRemoved = false;
- for (int i=mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (r.finishing) {
- continue;
- }
- if (r.fullscreen) {
- lastIsOpaque = true;
- }
- if (owner != null && r.app != owner) {
- continue;
- }
- if (!lastIsOpaque) {
- continue;
- }
- // We can destroy this one if we have its icicle saved and
- // it is not in the process of pausing/stopping/finishing.
- if (r.app != null && r != mResumedActivity && r != mPausingActivity
- && r.haveState && !r.visible && r.stopped
- && r.state != ActivityState.DESTROYING
- && r.state != ActivityState.DESTROYED) {
- if (DEBUG_SWITCH) Slog.v(TAG, "Destroying " + r + " in state " + r.state
- + " resumed=" + mResumedActivity
- + " pausing=" + mPausingActivity);
- if (destroyActivityLocked(r, true, oomAdj, reason)) {
- activityRemoved = true;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.finishing) {
+ continue;
+ }
+ if (r.fullscreen) {
+ lastIsOpaque = true;
+ }
+ if (owner != null && r.app != owner) {
+ continue;
+ }
+ if (!lastIsOpaque) {
+ continue;
+ }
+ // We can destroy this one if we have its icicle saved and
+ // it is not in the process of pausing/stopping/finishing.
+ if (r.app != null && r != mResumedActivity && r != mPausingActivity
+ && r.haveState && !r.visible && r.stopped
+ && r.state != ActivityState.DESTROYING
+ && r.state != ActivityState.DESTROYED) {
+ if (DEBUG_SWITCH) Slog.v(TAG, "Destroying " + r + " in state " + r.state
+ + " resumed=" + mResumedActivity
+ + " pausing=" + mPausingActivity);
+ if (destroyActivityLocked(r, true, oomAdj, reason)) {
+ activityRemoved = true;
+ }
}
}
}
@@ -4171,8 +4335,7 @@
mHandler.removeMessages(DESTROY_TIMEOUT_MSG, r);
}
- int index = indexOfActivityLocked(r);
- if (index >= 0) {
+ if (isInStackLocked(token) != null) {
if (r.state == ActivityState.DESTROYING) {
cleanUpActivityLocked(r, true, false);
removeActivityFromHistoryLocked(r);
@@ -4185,15 +4348,15 @@
}
}
- private void removeHistoryRecordsForAppLocked(ArrayList list, ProcessRecord app,
- String listName) {
+ private void removeHistoryRecordsForAppLocked(ArrayList<ActivityRecord> list,
+ ProcessRecord app, String listName) {
int i = list.size();
if (DEBUG_CLEANUP) Slog.v(
TAG, "Removing app " + app + " from list " + listName
+ " with " + i + " entries");
while (i > 0) {
i--;
- ActivityRecord r = (ActivityRecord)list.get(i);
+ ActivityRecord r = list.get(i);
if (DEBUG_CLEANUP) Slog.v(TAG, "Record #" + i + " " + r);
if (r.app == app) {
if (DEBUG_CLEANUP) Slog.v(TAG, "---> REMOVING this entry!");
@@ -4219,7 +4382,7 @@
TAG, "Removing app " + app + " from history with " + i + " entries");
while (i > 0) {
i--;
- ActivityRecord r = (ActivityRecord)mHistory.get(i);
+ ActivityRecord r = mHistory.get(i);
if (DEBUG_CLEANUP) Slog.v(
TAG, "Record #" + i + " " + r + ": app=" + r.app);
if (r.app == app) {
@@ -4287,6 +4450,7 @@
* of the stack.
*/
final void moveHomeToFrontLocked() {
+ newMoveHomeToFrontLocked();
TaskRecord homeTask = null;
for (int i=mHistory.size()-1; i>=0; i--) {
ActivityRecord hr = mHistory.get(i);
@@ -4296,6 +4460,23 @@
}
}
if (homeTask != null) {
+// moveTaskToFrontLocked(homeTask, null, null);
+ }
+ }
+
+ final void newMoveHomeToFrontLocked() {
+ TaskRecord homeTask = null;
+ for (int taskNdx = mTaskHistory.size() - 1; homeTask == null && taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.isHomeActivity) {
+ homeTask = r.task;
+ break;
+ }
+ }
+ }
+ if (homeTask != null) {
moveTaskToFrontLocked(homeTask, null, null);
}
}
@@ -4312,32 +4493,39 @@
mService.mWindowManager.prepareAppTransition(transit, false);
}
+ final boolean findTaskToMoveToFrontLocked(int taskId, int flags, Bundle options) {
+ for (int i = mHistory.size() - 1; i >= 0; i--) {
+ ActivityRecord hr = mHistory.get(i);
+ if (hr.task.taskId == taskId) {
+ if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
+ mUserLeaving = true;
+ }
+ if ((flags & ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
+ // Caller wants the home activity moved with it. To accomplish this,
+ // we'll just move the home task to the top first.
+ moveHomeToFrontLocked();
+ }
+ moveTaskToFrontLocked(hr.task, null, options);
+ return true;
+ }
+ }
+ return false;
+ }
+
final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord reason, Bundle options) {
- if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
final int task = tr.taskId;
int top = mHistory.size()-1;
if (top < 0 || (mHistory.get(top)).task.taskId == task) {
// nothing to do!
- if (reason != null &&
- (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- ActivityOptions.abort(options);
- } else {
- updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
- }
return;
}
- ArrayList<IBinder> moved = new ArrayList<IBinder>();
-
- // Applying the affinities may have removed entries from the history,
- // so get the size again.
- top = mHistory.size()-1;
- int pos = top;
// Shift all activities with this task up to the top
// of the stack, keeping them in the same internal order.
+ int pos = top;
while (pos >= 0) {
ActivityRecord r = mHistory.get(pos);
if (localLOGV) Slog.v(
@@ -4351,18 +4539,37 @@
}
mHistory.remove(pos);
mHistory.add(top, r);
- moved.add(0, r.appToken);
top--;
}
pos--;
}
+ //
+ // Start new code here! Delete everything above.
+ //
+ if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
- if (DEBUG_TRANSITION) Slog.v(TAG,
- "Prepare to front transition: task=" + tr);
+ final int numTasks = mTaskHistory.size();
+ final int index = mTaskHistory.indexOf(tr);
+ if (numTasks == 0 || index < 0 || index == numTasks - 1) {
+ // nothing to do!
+ if (reason != null &&
+ (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
+ ActivityOptions.abort(options);
+ } else {
+ updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
+ }
+ return;
+ }
+
+ // Shift all activities with this task up to the top
+ // of the stack, keeping them in the same internal order.
+ mTaskHistory.remove(tr);
+ mTaskHistory.add(tr);
+
+ if (DEBUG_TRANSITION) Slog.v(TAG, "Prepare to front transition: task=" + tr);
if (reason != null &&
(reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- mService.mWindowManager.prepareAppTransition(
- AppTransition.TRANSIT_NONE, false);
+ mService.mWindowManager.prepareAppTransition(AppTransition.TRANSIT_NONE, false);
ActivityRecord r = topRunningActivityLocked(null);
if (r != null) {
mNoAnimActivities.add(r);
@@ -4371,14 +4578,18 @@
} else {
updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
}
-
- mService.mWindowManager.moveAppTokensToTop(moved);
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
- }
+
+ mService.mWindowManager.moveTaskToTop(task);
finishTaskMoveLocked(task);
EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, tr.userId, task);
+
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
+ }
}
private final void finishTaskMoveLocked(int task) {
@@ -4398,7 +4609,7 @@
*/
final boolean moveTaskToBackLocked(int task, ActivityRecord reason) {
Slog.i(TAG, "moveTaskToBack: " + task);
-
+
// If we have a watcher, preflight the move before committing to it. First check
// for *other* available tasks, but if none are available, then try again allowing the
// current task to be selected.
@@ -4421,11 +4632,14 @@
}
}
- ArrayList<IBinder> moved = new ArrayList<IBinder>();
-
if (DEBUG_TRANSITION) Slog.v(TAG,
"Prepare to back transition: task=" + task);
-
+
+ final TaskRecord tr = mTaskIdToTaskRecord.get(task);
+ mTaskHistory.remove(tr);
+ mTaskHistory.add(0, tr);
+
+ // BEGIN REGION TO REMOVE.
final int N = mHistory.size();
int bottom = 0;
int pos = 0;
@@ -4446,16 +4660,18 @@
}
mHistory.remove(pos);
mHistory.add(bottom, r);
- moved.add(r.appToken);
bottom++;
}
pos++;
}
+ if (VALIDATE_TASK_REPLACE) {
+ verifyActivityRecords(true);
+ }
+ // END REGION TO REMOVE
if (reason != null &&
(reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- mService.mWindowManager.prepareAppTransition(
- AppTransition.TRANSIT_NONE, false);
+ mService.mWindowManager.prepareAppTransition(AppTransition.TRANSIT_NONE, false);
ActivityRecord r = topRunningActivityLocked(null);
if (r != null) {
mNoAnimActivities.add(r);
@@ -4464,7 +4680,8 @@
mService.mWindowManager.prepareAppTransition(
AppTransition.TRANSIT_TASK_TO_BACK, false);
}
- mService.mWindowManager.moveAppTokensToBottom(moved);
+ mService.mWindowManager.moveTaskToBottom(task);
+
if (VALIDATE_TOKENS) {
validateAppTokensLocked();
}
@@ -4474,7 +4691,7 @@
}
public ActivityManager.TaskThumbnails getTaskThumbnailsLocked(TaskRecord tr) {
- TaskAccessInfo info = getTaskAccessInfoLocked(tr.taskId, true);
+ TaskAccessInfo info = getTaskAccessInfoLocked(tr, true);
ActivityRecord resumed = mResumedActivity;
if (resumed != null && resumed.thumbHolder == tr) {
info.mainThumbnail = resumed.stack.screenshotActivities(resumed);
@@ -4494,17 +4711,17 @@
}
// Return the information about the task, to figure out the top
// thumbnail to return.
- TaskAccessInfo info = getTaskAccessInfoLocked(tr.taskId, true);
+ TaskAccessInfo info = getTaskAccessInfoLocked(tr, true);
if (info.numSubThumbbails <= 0) {
return info.mainThumbnail != null ? info.mainThumbnail : tr.lastThumbnail;
- } else {
- return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
}
+ return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
}
public ActivityRecord removeTaskActivitiesLocked(int taskId, int subTaskIndex,
boolean taskRequired) {
- TaskAccessInfo info = getTaskAccessInfoLocked(taskId, false);
+ final TaskRecord task = mTaskIdToTaskRecord.get(taskId);
+ TaskAccessInfo info = getTaskAccessInfoLocked(task, false);
if (info.root == null) {
if (taskRequired) {
Slog.w(TAG, "removeTaskLocked: unknown taskId " + taskId);
@@ -4514,7 +4731,7 @@
if (subTaskIndex < 0) {
// Just remove the entire task.
- performClearTaskAtIndexLocked(taskId, info.rootIndex);
+ performClearTaskAtIndexLocked(task, info.rootIndex);
return info.root;
}
@@ -4527,19 +4744,20 @@
// Remove all of this task's activities starting at the sub task.
TaskAccessInfo.SubTask subtask = info.subtasks.get(subTaskIndex);
- performClearTaskAtIndexLocked(taskId, subtask.index);
+ performClearTaskAtIndexLocked(task, subtask.index);
return subtask.activity;
}
- public TaskAccessInfo getTaskAccessInfoLocked(int taskId, boolean inclThumbs) {
+ public TaskAccessInfo getTaskAccessInfoLocked(TaskRecord task, boolean inclThumbs) {
final TaskAccessInfo thumbs = new TaskAccessInfo();
// How many different sub-thumbnails?
- final int NA = mHistory.size();
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ final int NA = activities.size();
int j = 0;
ThumbnailHolder holder = null;
while (j < NA) {
- ActivityRecord ar = mHistory.get(j);
- if (!ar.finishing && ar.task.taskId == taskId) {
+ ActivityRecord ar = activities.get(j);
+ if (!ar.finishing) {
thumbs.root = ar;
thumbs.rootIndex = j;
holder = ar.thumbHolder;
@@ -4559,14 +4777,11 @@
ArrayList<TaskAccessInfo.SubTask> subtasks = new ArrayList<TaskAccessInfo.SubTask>();
thumbs.subtasks = subtasks;
while (j < NA) {
- ActivityRecord ar = mHistory.get(j);
+ ActivityRecord ar = activities.get(j);
j++;
if (ar.finishing) {
continue;
}
- if (ar.task.taskId != taskId) {
- break;
- }
if (ar.thumbHolder != holder && holder != null) {
thumbs.numSubThumbbails++;
holder = ar.thumbHolder;
@@ -4579,6 +4794,7 @@
}
if (thumbs.numSubThumbbails > 0) {
thumbs.retriever = new IThumbnailRetriever.Stub() {
+ @Override
public Bitmap getThumbnail(int index) {
if (index < 0 || index >= thumbs.subtasks.size()) {
return null;
@@ -4777,4 +4993,292 @@
public void dismissKeyguardOnNextActivityLocked() {
mDismissKeyguardOnNextActivity = true;
}
+
+ boolean willActivityBeVisibleLocked(IBinder token) {
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.appToken == token) {
+ return true;
+ }
+ if (r.fullscreen && !r.finishing) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ void closeSystemDialogsLocked() {
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
+ r.stack.finishActivityLocked(r, Activity.RESULT_CANCELED,
+ null, "close-sys", true);
+ }
+ }
+ }
+ }
+
+ boolean forceStopPackageLocked(String name, boolean doit, boolean evenPersistent, int userId) {
+ boolean didSomething = false;
+ TaskRecord lastTask = null;
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ int numActivities = activities.size();
+ for (int activityNdx = 0; activityNdx < numActivities; ++activityNdx) {
+ ActivityRecord r = activities.get(activityNdx);
+ final boolean samePackage = r.packageName.equals(name)
+ || (name == null && r.userId == userId);
+ if ((userId == UserHandle.USER_ALL || r.userId == userId)
+ && (samePackage || r.task == lastTask)
+ && (r.app == null || evenPersistent || !r.app.persistent)) {
+ if (!doit) {
+ if (r.finishing) {
+ // If this activity is just finishing, then it is not
+ // interesting as far as something to stop.
+ continue;
+ }
+ return true;
+ }
+ didSomething = true;
+ Slog.i(TAG, " Force finishing activity " + r);
+ if (samePackage) {
+ if (r.app != null) {
+ r.app.removed = true;
+ }
+ r.app = null;
+ }
+ lastTask = r.task;
+ r.stack.finishActivityLocked(r, Activity.RESULT_CANCELED, null, "force-stop",
+ true);
+ }
+ }
+ }
+ return didSomething;
+ }
+
+ ActivityRecord getTasksLocked(int maxNum, IThumbnailReceiver receiver,
+ PendingThumbnailsRecord pending, List<RunningTaskInfo> list) {
+ ActivityRecord topRecord = null;
+ int pos = mHistory.size() - 1;
+ ActivityRecord next = pos >= 0 ? mHistory.get(pos) : null;
+ ActivityRecord top = null;
+ TaskRecord curTask = null;
+ int numActivities = 0;
+ int numRunning = 0;
+ while (pos >= 0 && maxNum > 0) {
+ final ActivityRecord r = next;
+ pos--;
+ next = pos >= 0 ? mHistory.get(pos) : null;
+
+ // Initialize state for next task if needed.
+ if (top == null || (top.state == ActivityState.INITIALIZING && top.task == r.task)) {
+ top = r;
+ curTask = r.task;
+ numActivities = numRunning = 0;
+ }
+
+ // Add 'r' into the current task.
+ numActivities++;
+ if (r.app != null && r.app.thread != null) {
+ numRunning++;
+ }
+
+ if (localLOGV) Slog.v(
+ TAG, r.intent.getComponent().flattenToShortString()
+ + ": task=" + r.task);
+
+ // If the next one is a different task, generate a new
+ // TaskInfo entry for what we have.
+ if (next == null || next.task != curTask) {
+ RunningTaskInfo ci = new RunningTaskInfo();
+ ci.id = curTask.taskId;
+ ci.baseActivity = r.intent.getComponent();
+ ci.topActivity = top.intent.getComponent();
+ if (top.thumbHolder != null) {
+ ci.description = top.thumbHolder.lastDescription;
+ }
+ ci.numActivities = numActivities;
+ ci.numRunning = numRunning;
+ //System.out.println(
+ // "#" + maxNum + ": " + " descr=" + ci.description);
+ if (receiver != null) {
+ if (localLOGV) Slog.v(
+ TAG, "State=" + top.state + "Idle=" + top.idle
+ + " app=" + top.app
+ + " thr=" + (top.app != null ? top.app.thread : null));
+ if (top.state == ActivityState.RESUMED || top.state == ActivityState.PAUSING) {
+ if (top.idle && top.app != null && top.app.thread != null) {
+ topRecord = top;
+ } else {
+ top.thumbnailNeeded = true;
+ }
+ }
+ pending.pendingRecords.add(top);
+ }
+ list.add(ci);
+ maxNum--;
+ top = null;
+ }
+ }
+ return topRecord;
+ }
+
+ public void unhandledBackLocked() {
+ int top = mHistory.size() - 1;
+ if (DEBUG_SWITCH) Slog.d(
+ TAG, "Performing unhandledBack(): top activity at " + top);
+ if (top > 0) {
+ finishActivityLocked(mHistory.get(top),
+ Activity.RESULT_CANCELED, null, "unhandled-back", true);
+ }
+ }
+
+ void handleAppCrashLocked(ProcessRecord app) {
+ for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
+ final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (r.app == app) {
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ r.stack.finishActivityLocked(r, Activity.RESULT_CANCELED, null, "crashed",
+ false);
+ }
+ }
+ }
+ }
+
+ void dumpActivitiesLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
+ boolean dumpClient, String dumpPackage) {
+ ActivityManagerService.dumpHistoryList(fd, pw, mHistory, " ", "Hist", true, !dumpAll,
+ dumpClient, dumpPackage);
+ }
+
+ ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {
+ ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
+
+ if ("all".equals(name)) {
+ for (ActivityRecord r1 : mHistory) {
+ activities.add(r1);
+ }
+ } else if ("top".equals(name)) {
+ final int N = mHistory.size();
+ if (N > 0) {
+ activities.add(mHistory.get(N-1));
+ }
+ } else {
+ ItemMatcher matcher = new ItemMatcher();
+ matcher.build(name);
+
+ for (ActivityRecord r1 : mHistory) {
+ if (matcher.match(r1, r1.intent.getComponent())) {
+ activities.add(r1);
+ }
+ }
+ }
+
+ return activities;
+ }
+
+ ActivityRecord restartPackage(String packageName) {
+ ActivityRecord starting = topRunningActivityLocked(null);
+
+ // All activities that came from the package must be
+ // restarted as if there was a config change.
+ for (int i = mHistory.size() - 1; i >= 0; i--) {
+ ActivityRecord a = mHistory.get(i);
+ if (a.info.packageName.equals(packageName)) {
+ a.forceNewConfig = true;
+ if (starting != null && a == starting && a.visible) {
+ a.startFreezingScreenLocked(starting.app, ActivityInfo.CONFIG_SCREEN_LAYOUT);
+ }
+ }
+ }
+
+ return starting;
+ }
+
+ void rebuildTaskHistory() {
+ mTaskHistory.clear();
+ final int numActivities = mHistory.size();
+ TaskRecord task = null;
+ for (int i = 0; i < numActivities; ++i) {
+ final ActivityRecord r = mHistory.get(i);
+ if (r.task != task) {
+ task = r.task;
+ task.mActivities.clear();
+ mTaskHistory.add(task);
+ }
+ task.mActivities.add(r);
+ }
+ }
+
+ boolean verifyActivityRecords(boolean rebuild) {
+ final int numHistory = mHistory.size();
+ int historyNdx = 0;
+
+ final int numTasks = mTaskHistory.size();
+ int taskNdx;
+ for (taskNdx = historyNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final TaskRecord task = mTaskHistory.get(taskNdx);
+ final ArrayList<ActivityRecord> activities = task.mActivities;
+ final int numActivities = activities.size();
+ int activityNdx;
+ for (activityNdx = 0;
+ activityNdx < numActivities && historyNdx < numHistory;
+ ++activityNdx, ++historyNdx) {
+ ActivityRecord r1 = mHistory.get(historyNdx);
+ ActivityRecord r2 = activities.get(activityNdx);
+ if (r1 != r2) {
+ break;
+ }
+ }
+ if (activityNdx != numActivities) {
+ // either a mismatch or mHistory ran out before mTaskHistory.
+ break;
+ }
+ }
+ if (taskNdx != numTasks || historyNdx != numHistory) {
+ logHistories("verifyActivityRecords", rebuild);
+ return true;
+ }
+ return false;
+ }
+
+ private void logHistories(String caller, boolean rebuild) {
+ Slog.w(TAG, "Mismatch! " + caller + " mHistory=" + mHistory);
+ ArrayList<ArrayList<ActivityRecord>> nestedRecords =
+ new ArrayList<ArrayList<ActivityRecord>>();
+ for (TaskRecord task : mTaskHistory) {
+ nestedRecords.add(task.mActivities);
+ }
+ Slog.w(TAG, "Mismatch! " + caller + " mTaskHistory" + nestedRecords);
+ Slog.w(TAG, "Mismatch! " + caller + " lastHistoryModifier=" + mLastHistoryModifier
+ + " Caller=" + Debug.getCallers(4));
+ if (rebuild) {
+ rebuildTaskHistory();
+ }
+ }
+
+ private TaskRecord createTaskRecord(int taskId, ActivityInfo info, Intent intent,
+ boolean toTop) {
+ TaskRecord oldTask = mTaskIdToTaskRecord.get(taskId);
+ if (oldTask != null) {
+ Slog.w(TAG, "createTaskRecord: Reusing taskId=" + taskId + " without removing");
+ mTaskHistory.remove(oldTask);
+ }
+ TaskRecord task = new TaskRecord(taskId, info, intent);
+ mTaskIdToTaskRecord.put(taskId, task);
+ if (toTop) {
+ mTaskHistory.add(task);
+ } else {
+ mTaskHistory.add(0, task);
+ }
+ return task;
+ }
}
diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java
index 3a6492e..863bdad 100644
--- a/services/java/com/android/server/am/CompatModePackages.java
+++ b/services/java/com/android/server/am/CompatModePackages.java
@@ -295,20 +295,8 @@
Message msg = mHandler.obtainMessage(MSG_WRITE);
mHandler.sendMessageDelayed(msg, 10000);
- ActivityRecord starting = mService.mMainStack.topRunningActivityLocked(null);
-
- // All activities that came from the package must be
- // restarted as if there was a config change.
- for (int i=mService.mMainStack.mHistory.size()-1; i>=0; i--) {
- ActivityRecord a = (ActivityRecord)mService.mMainStack.mHistory.get(i);
- if (a.info.packageName.equals(packageName)) {
- a.forceNewConfig = true;
- if (starting != null && a == starting && a.visible) {
- a.startFreezingScreenLocked(starting.app,
- ActivityInfo.CONFIG_SCREEN_LAYOUT);
- }
- }
- }
+
+ ActivityRecord starting = mService.mMainStack.restartPackage(packageName);
// Tell all processes that loaded this package about the change.
for (int i=mService.mLruProcesses.size()-1; i>=0; i--) {
diff --git a/services/java/com/android/server/am/PendingThumbnailsRecord.java b/services/java/com/android/server/am/PendingThumbnailsRecord.java
index ed478c9..c460791 100644
--- a/services/java/com/android/server/am/PendingThumbnailsRecord.java
+++ b/services/java/com/android/server/am/PendingThumbnailsRecord.java
@@ -27,13 +27,13 @@
class PendingThumbnailsRecord
{
final IThumbnailReceiver receiver; // who is waiting.
- HashSet pendingRecords; // HistoryRecord objects we still wait for.
+ final HashSet<ActivityRecord> pendingRecords; // HistoryRecord objects we still wait for.
boolean finished; // Is pendingRecords empty?
PendingThumbnailsRecord(IThumbnailReceiver _receiver)
{
receiver = _receiver;
- pendingRecords = new HashSet();
+ pendingRecords = new HashSet<ActivityRecord>();
finished = false;
}
}
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index 1bae9ca..347aa7d 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -23,6 +23,7 @@
import android.util.Slog;
import java.io.PrintWriter;
+import java.util.ArrayList;
class TaskRecord extends ThumbnailHolder {
final int taskId; // Unique identifier for this task.
@@ -39,7 +40,11 @@
String stringName; // caching of toString() result.
int userId; // user for which this task was created
-
+
+ int numFullscreen; // Number of fullscreen activities.
+
+ final ArrayList<ActivityRecord> mActivities = new ArrayList<ActivityRecord>();
+
TaskRecord(int _taskId, ActivityInfo info, Intent _intent) {
taskId = _taskId;
affinity = info.taskAffinity;
@@ -104,12 +109,49 @@
userId = UserHandle.getUserId(info.applicationInfo.uid);
}
}
-
+
+ ActivityRecord getTopActivity() {
+ for (int i = mActivities.size() - 1; i >= 0; --i) {
+ final ActivityRecord r = mActivities.get(i);
+ if (r.finishing) {
+ continue;
+ }
+ return r;
+ }
+ return null;
+ }
+
+ void addActivityAtBottom(ActivityRecord r) {
+ if (!mActivities.remove(r) && r.fullscreen) {
+ // Was not previously in list.
+ numFullscreen++;
+ }
+ mActivities.add(0, r);
+ }
+
+ void addActivityToTop(ActivityRecord r) {
+ if (!mActivities.remove(r) && r.fullscreen) {
+ // Was not previously in list.
+ numFullscreen++;
+ }
+ mActivities.add(r);
+ }
+
+ /** @return true if this was the last activity in the task */
+ boolean removeActivity(ActivityRecord r) {
+ if (mActivities.remove(r) && r.fullscreen) {
+ // Was previously in list.
+ numFullscreen--;
+ }
+ return mActivities.size() == 0;
+ }
+
void dump(PrintWriter pw, String prefix) {
if (numActivities != 0 || rootWasReset || userId != 0) {
pw.print(prefix); pw.print("numActivities="); pw.print(numActivities);
pw.print(" rootWasReset="); pw.print(rootWasReset);
- pw.print(" userId="); pw.println(userId);
+ pw.print(" userId="); pw.print(userId);
+ pw.print(" numFullscreen="); pw.println(numFullscreen);
}
if (affinity != null) {
pw.print(prefix); pw.print("affinity="); pw.println(affinity);
@@ -136,6 +178,7 @@
pw.print(prefix); pw.print("realActivity=");
pw.println(realActivity.flattenToShortString());
}
+ pw.print(prefix); pw.print("Activities="); pw.println(mActivities);
if (!askedCompatMode) {
pw.print(prefix); pw.print("askedCompatMode="); pw.println(askedCompatMode);
}
@@ -146,6 +189,7 @@
pw.print((getInactiveDuration()/1000)); pw.println("s)");
}
+ @Override
public String toString() {
if (stringName != null) {
return stringName;
@@ -156,19 +200,21 @@
sb.append(" #");
sb.append(taskId);
if (affinity != null) {
- sb.append(" A ");
+ sb.append(" A=");
sb.append(affinity);
} else if (intent != null) {
- sb.append(" I ");
+ sb.append(" I=");
sb.append(intent.getComponent().flattenToShortString());
} else if (affinityIntent != null) {
- sb.append(" aI ");
+ sb.append(" aI=");
sb.append(affinityIntent.getComponent().flattenToShortString());
} else {
sb.append(" ??");
}
- sb.append(" U ");
+ sb.append(" U=");
sb.append(userId);
+ sb.append(" sz=");
+ sb.append(mActivities.size());
sb.append('}');
return stringName = sb.toString();
}
diff --git a/services/java/com/android/server/pm/KeySetManager.java b/services/java/com/android/server/pm/KeySetManager.java
new file mode 100644
index 0000000..afb7d4b
--- /dev/null
+++ b/services/java/com/android/server/pm/KeySetManager.java
@@ -0,0 +1,540 @@
+/*
+ * Copyright (C) 2013 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.server.pm;
+
+import android.content.pm.KeySet;
+import android.content.pm.PackageParser;
+import android.os.Binder;
+import android.util.Base64;
+import android.util.Log;
+import android.util.LongSparseArray;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.security.PublicKey;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlSerializer;
+
+/*
+ * Manages system-wide KeySet state.
+ */
+public class KeySetManager {
+
+ static final String TAG = "KeySetManager";
+
+ private static final long KEYSET_NOT_FOUND = -1;
+ private static final long PUBLIC_KEY_NOT_FOUND = -1;
+
+ private final Object mLockObject = new Object();
+
+ private final LongSparseArray<KeySet> mKeySets;
+
+ private final LongSparseArray<PublicKey> mPublicKeys;
+
+ private final LongSparseArray<Set<Long>> mKeySetMapping;
+
+ private final Map<String, PackageSetting> mPackages;
+
+ private static long lastIssuedKeySetId = 0;
+
+ private static long lastIssuedKeyId = 0;
+
+ public KeySetManager(Map<String, PackageSetting> packages) {
+ mKeySets = new LongSparseArray<KeySet>();
+ mPublicKeys = new LongSparseArray<PublicKey>();
+ mKeySetMapping = new LongSparseArray<Set<Long>>();
+ mPackages = packages;
+ }
+
+ /*
+ * Determine if a package is signed by the given KeySet.
+ *
+ * Returns false if the package was not signed by all the
+ * keys in the KeySet.
+ *
+ * Returns true if the package was signed by at least the
+ * keys in the given KeySet.
+ *
+ * Note that this can return true for multiple KeySets.
+ */
+ public boolean packageIsSignedBy(String packageName, KeySet ks) {
+ synchronized (mLockObject) {
+ PackageSetting pkg = mPackages.get(packageName);
+ if (pkg == null) {
+ throw new NullPointerException("Invalid package name");
+ }
+ if (pkg.keySetData == null) {
+ throw new NullPointerException("Package has no KeySet data");
+ }
+ long id = getIdByKeySetLocked(ks);
+ return pkg.keySetData.packageIsSignedBy(id);
+ }
+ }
+
+ /*
+ * This informs the system that the given package has defined a KeySet
+ * in its manifest that a) contains the given keys and b) is named
+ * alias by that package.
+ */
+ public void addDefinedKeySetToPackage(String packageName,
+ Set<PublicKey> keys, String alias) {
+ if ((packageName == null) || (keys == null) || (alias == null)) {
+ Log.e(TAG, "Got null argument for a defined keyset, ignoring!");
+ return;
+ }
+ synchronized (mLockObject) {
+ KeySet ks = addKeySetLocked(keys);
+ PackageSetting pkg = mPackages.get(packageName);
+ if (pkg == null) {
+ throw new NullPointerException("Unknown package");
+ }
+ long id = getIdByKeySetLocked(ks);
+ pkg.keySetData.addDefinedKeySet(id, alias);
+ }
+ }
+
+ /*
+ * Similar to the above, this informs the system that the given package
+ * was signed by the provided KeySet.
+ */
+ public void addSigningKeySetToPackage(String packageName,
+ Set<PublicKey> signingKeys) {
+ if ((packageName == null) || (signingKeys == null)) {
+ Log.e(TAG, "Got null argument for a signing keyset, ignoring!");
+ return;
+ }
+ synchronized (mLockObject) {
+ // add the signing KeySet
+ KeySet ks = addKeySetLocked(signingKeys);
+ long id = getIdByKeySetLocked(ks);
+ Set<Long> publicKeyIds = mKeySetMapping.get(id);
+ if (publicKeyIds == null) {
+ throw new NullPointerException("Got invalid KeySet id");
+ }
+
+ // attach it to the package
+ PackageSetting pkg = mPackages.get(packageName);
+ if (pkg == null) {
+ throw new NullPointerException("No such package!");
+ }
+ pkg.keySetData.addSigningKeySet(id);
+
+ // for each KeySet the package defines which is a subset of
+ // the one above, add the KeySet id to the package's signing KeySets
+ for (Long keySetID : pkg.keySetData.getDefinedKeySets()) {
+ Set<Long> definedKeys = mKeySetMapping.get(keySetID);
+ if (publicKeyIds.contains(definedKeys)) {
+ pkg.keySetData.addSigningKeySet(keySetID);
+ }
+ }
+ }
+ }
+
+ /*
+ * Fetches the stable identifier associated with the given KeySet.
+ *
+ * Returns KEYSET_NOT_FOUND if the KeySet... wasn't found.
+ */
+ public long getIdByKeySet(KeySet ks) {
+ synchronized (mLockObject) {
+ return getIdByKeySetLocked(ks);
+ }
+ }
+
+ private long getIdByKeySetLocked(KeySet ks) {
+ for (int keySetIndex = 0; keySetIndex < mKeySets.size(); keySetIndex++) {
+ KeySet value = mKeySets.valueAt(keySetIndex);
+ if (ks.equals(value)) {
+ return mKeySets.keyAt(keySetIndex);
+ }
+ }
+ return KEYSET_NOT_FOUND;
+ }
+
+ /*
+ * Fetches the KeySet corresponding to the given stable identifier.
+ *
+ * Returns KEYSET_NOT_FOUND if the identifier doesn't identify a KeySet.
+ */
+ public KeySet getKeySetById(long id) {
+ synchronized (mLockObject) {
+ return mKeySets.get(id);
+ }
+ }
+
+ /*
+ * Fetches the KeySet that a given package refers to by the provided alias.
+ *
+ * If the package isn't known to us, throws an IllegalArgumentException.
+ * Returns null if the alias isn't known to us.
+ */
+ public KeySet getKeySetByAliasAndPackageName(String packageName, String alias) {
+ synchronized (mLockObject) {
+ PackageSetting p = mPackages.get(packageName);
+ if (p == null) {
+ throw new NullPointerException("Unknown package");
+ }
+ if (p.keySetData == null) {
+ throw new IllegalArgumentException("Package has no keySet data");
+ }
+ long keySetId = p.keySetData.getAliases().get(alias);
+ return mKeySets.get(keySetId);
+ }
+ }
+
+ /*
+ * Fetches all the known KeySets that signed the given package.
+ *
+ * If the package is unknown to us, throws an IllegalArgumentException.
+ */
+ public Set<KeySet> getSigningKeySetsByPackageName(String packageName) {
+ synchronized (mLockObject) {
+ Set<KeySet> signingKeySets = new HashSet<KeySet>();
+ PackageSetting p = mPackages.get(packageName);
+ if (p == null) {
+ throw new NullPointerException("Unknown package");
+ }
+ if (p.keySetData == null) {
+ throw new IllegalArgumentException("Package has no keySet data");
+ }
+ for (long l : p.keySetData.getSigningKeySets()) {
+ signingKeySets.add(mKeySets.get(l));
+ }
+ return signingKeySets;
+ }
+ }
+
+ /*
+ * Creates a new KeySet corresponding to the given keys.
+ *
+ * If the PublicKeys aren't known to the system, this adds them. Otherwise,
+ * they're deduped.
+ *
+ * If the KeySet isn't known to the system, this adds that and creates the
+ * mapping to the PublicKeys. If it is known, then it's deduped.
+ *
+ * Throws if the provided set is null.
+ */
+ private KeySet addKeySetLocked(Set<PublicKey> keys) {
+ if (keys == null) {
+ throw new NullPointerException("Provided keys cannot be null");
+ }
+ // add each of the keys in the provided set
+ Set<Long> addedKeyIds = new HashSet<Long>(keys.size());
+ for (PublicKey k : keys) {
+ long id = addPublicKeyLocked(k);
+ addedKeyIds.add(id);
+ }
+
+ // check to see if the resulting keyset is new
+ long existingKeySetId = getIdFromKeyIdsLocked(addedKeyIds);
+ if (existingKeySetId != KEYSET_NOT_FOUND) {
+ return mKeySets.get(existingKeySetId);
+ }
+
+ // create the KeySet object
+ KeySet ks = new KeySet(new Binder());
+ // get the first unoccupied slot in mKeySets
+ long id = getFreeKeySetIDLocked();
+ // add the KeySet object to it
+ mKeySets.put(id, ks);
+ // add the stable key ids to the mapping
+ mKeySetMapping.put(id, addedKeyIds);
+ // go home
+ return ks;
+ }
+
+ /*
+ * Adds the given PublicKey to the system, deduping as it goes.
+ */
+ private long addPublicKeyLocked(PublicKey key) {
+ // check if the public key is new
+ long existingKeyId = getIdForPublicKeyLocked(key);
+ if (existingKeyId != PUBLIC_KEY_NOT_FOUND) {
+ return existingKeyId;
+ }
+ // if it's new find the first unoccupied slot in the public keys
+ long id = getFreePublicKeyIdLocked();
+ // add the public key to it
+ mPublicKeys.put(id, key);
+ // return the stable identifier
+ return id;
+ }
+
+ /*
+ * Finds the stable identifier for a KeySet based on a set of PublicKey stable IDs.
+ *
+ * Returns KEYSET_NOT_FOUND if there isn't one.
+ */
+ private long getIdFromKeyIdsLocked(Set<Long> publicKeyIds) {
+ for (int keyMapIndex = 0; keyMapIndex < mKeySetMapping.size(); keyMapIndex++) {
+ Set<Long> value = mKeySetMapping.valueAt(keyMapIndex);
+ if (value.equals(publicKeyIds)) {
+ return mKeySetMapping.keyAt(keyMapIndex);
+ }
+ }
+ return KEYSET_NOT_FOUND;
+ }
+
+ /*
+ * Finds the stable identifier for a PublicKey or PUBLIC_KEY_NOT_FOUND.
+ */
+ private long getIdForPublicKeyLocked(PublicKey k) {
+ String encodedPublicKey = new String(k.getEncoded());
+ for (int publicKeyIndex = 0; publicKeyIndex < mPublicKeys.size(); publicKeyIndex++) {
+ PublicKey value = mPublicKeys.valueAt(publicKeyIndex);
+ String encodedExistingKey = new String(value.getEncoded());
+ if (encodedPublicKey.equals(encodedExistingKey)) {
+ return mPublicKeys.keyAt(publicKeyIndex);
+ }
+ }
+ return PUBLIC_KEY_NOT_FOUND;
+ }
+
+ /*
+ * Gets an unused stable identifier for a KeySet.
+ */
+ private long getFreeKeySetIDLocked() {
+ lastIssuedKeySetId += 1;
+ return lastIssuedKeySetId;
+ }
+
+ /*
+ * Same as above, but for public keys.
+ */
+ private long getFreePublicKeyIdLocked() {
+ lastIssuedKeyId += 1;
+ return lastIssuedKeyId;
+ }
+
+ public void removeAppKeySetData(String packageName) {
+ Log.e(TAG, "Removing application " + packageName);
+ synchronized (mLockObject) {
+ // Get the package's known keys and KeySets
+ Set<Long> deletableKeySets = getKnownKeySetsByPackageName(packageName);
+ Set<Long> deletableKeys = new HashSet<Long>();
+ for (Long ks : deletableKeySets) {
+ deletableKeys.addAll(mKeySetMapping.get(ks));
+ }
+
+ // Now remove the keys and KeySets known to any other package
+ for (String pkgName : mPackages.keySet()) {
+ if (pkgName.equals(packageName)) {
+ continue;
+ }
+ Set<Long> knownKeySets = getKnownKeySetsByPackageName(pkgName);
+ deletableKeySets.removeAll(knownKeySets);
+ Set<Long> knownKeys = new HashSet<Long>();
+ for (Long ks : knownKeySets) {
+ deletableKeys.removeAll(mKeySetMapping.get(ks));
+ }
+ }
+
+ // The remaining keys and KeySets are not known to any other
+ // application and so can be safely deleted.
+ for (Long ks : deletableKeySets) {
+ mKeySets.delete(ks);
+ mKeySetMapping.delete(ks);
+ }
+ for (Long keyId : deletableKeys) {
+ mPublicKeys.delete(keyId);
+ }
+ }
+ }
+
+ private Set<Long> getKnownKeySetsByPackageName(String packageName) {
+ PackageSetting p = mPackages.get(packageName);
+ if (p == null) {
+ throw new NullPointerException("Unknown package");
+ }
+ if (p.keySetData == null) {
+ throw new IllegalArgumentException("Package has no keySet data");
+ }
+ Set<Long> knownKeySets = new HashSet<Long>();
+ for (Long ks : p.keySetData.getSigningKeySets()) {
+ knownKeySets.add(ks);
+ }
+ for (Long ks : p.keySetData.getDefinedKeySets()) {
+ knownKeySets.add(ks);
+ }
+ return knownKeySets;
+ }
+
+ public String encodePublicKey(PublicKey k) throws IOException {
+ return new String(Base64.encode(k.getEncoded(), 0));
+ }
+
+ public void dump(PrintWriter pw) {
+ synchronized (mLockObject) {
+ pw.println(" Dumping KeySetManager");
+ for (Map.Entry<String, PackageSetting> e : mPackages.entrySet()) {
+ String packageName = e.getKey();
+ PackageSetting pkg = e.getValue();
+ pw.print(" ["); pw.print(packageName); pw.println("]");
+ if (pkg.keySetData != null) {
+ pw.print(" Defined KeySets:");
+ for (long keySetId : pkg.keySetData.getDefinedKeySets()) {
+ pw.print(" "); pw.print(Long.toString(keySetId));
+ }
+ pw.println("");
+ pw.print(" Signing KeySets:");
+ for (long keySetId : pkg.keySetData.getSigningKeySets()) {
+ pw.print(" "); pw.print(Long.toString(keySetId));
+ }
+ pw.println("");
+ }
+ }
+ }
+ }
+
+ void writeKeySetManagerLPr(XmlSerializer serializer) throws IOException {
+ serializer.startTag(null, "keyset-settings");
+ writePublicKeysLPr(serializer);
+ writeKeySetsLPr(serializer);
+ serializer.startTag(null, "lastIssuedKeyId");
+ serializer.attribute(null, "value", Long.toString(lastIssuedKeyId));
+ serializer.endTag(null, "lastIssuedKeyId");
+ serializer.startTag(null, "lastIssuedKeySetId");
+ serializer.attribute(null, "value", Long.toString(lastIssuedKeySetId));
+ serializer.endTag(null, "lastIssuedKeySetId");
+ serializer.endTag(null, "keyset-settings");
+ }
+
+ void writePublicKeysLPr(XmlSerializer serializer) throws IOException {
+ serializer.startTag(null, "keys");
+ for (int pKeyIndex = 0; pKeyIndex < mPublicKeys.size(); pKeyIndex++) {
+ long id = mPublicKeys.keyAt(pKeyIndex);
+ PublicKey key = mPublicKeys.valueAt(pKeyIndex);
+ String encodedKey = encodePublicKey(key);
+ serializer.startTag(null, "public-key");
+ serializer.attribute(null, "identifier", Long.toString(id));
+ serializer.attribute(null, "value", encodedKey);
+ serializer.endTag(null, "public-key");
+ }
+ serializer.endTag(null, "keys");
+ }
+
+ void writeKeySetsLPr(XmlSerializer serializer) throws IOException {
+ serializer.startTag(null, "keysets");
+ for (int keySetIndex = 0; keySetIndex < mKeySetMapping.size(); keySetIndex++) {
+ long id = mKeySetMapping.keyAt(keySetIndex);
+ Set<Long> keys = mKeySetMapping.valueAt(keySetIndex);
+ serializer.startTag(null, "keyset");
+ serializer.attribute(null, "identifier", Long.toString(id));
+ for (long keyId : keys) {
+ serializer.startTag(null, "key-id");
+ serializer.attribute(null, "identifier", Long.toString(keyId));
+ serializer.endTag(null, "key-id");
+ }
+ serializer.endTag(null, "keyset");
+ }
+ serializer.endTag(null, "keysets");
+ }
+
+ void readKeySetsLPw(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ int type;
+ long currentKeySetId = 0;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ final String tagName = parser.getName();
+ if (tagName.equals("keys")) {
+ readKeysLPw(parser);
+ } else if (tagName.equals("keysets")) {
+ readKeySetListLPw(parser);
+ } else {
+ PackageManagerService.reportSettingsProblem(Log.WARN,
+ "Could not read KeySets for KeySetManager!");
+ }
+ }
+ }
+
+ void readKeysLPw(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ int outerDepth = parser.getDepth();
+ int type;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ final String tagName = parser.getName();
+ if (tagName.equals("public-key")) {
+ readPublicKeyLPw(parser);
+ } else if (tagName.equals("lastIssuedKeyId")) {
+ lastIssuedKeyId = Long.parseLong(parser.getAttributeValue(null, "value"));
+ } else if (tagName.equals("lastIssuedKeySetId")) {
+ lastIssuedKeySetId = Long.parseLong(parser.getAttributeValue(null, "value"));
+ } else {
+ PackageManagerService.reportSettingsProblem(Log.WARN,
+ "Could not read keys for KeySetManager!");
+ }
+ }
+ }
+
+ void readKeySetListLPw(XmlPullParser parser)
+ throws XmlPullParserException, IOException {
+ int outerDepth = parser.getDepth();
+ int type;
+ long currentKeySetId = 0;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ final String tagName = parser.getName();
+ if (tagName.equals("keyset")) {
+ currentKeySetId = readIdentifierLPw(parser);
+ mKeySets.put(currentKeySetId, new KeySet(new Binder()));
+ mKeySetMapping.put(currentKeySetId, new HashSet<Long>());
+ } else if (tagName.equals("key-id")) {
+ long id = readIdentifierLPw(parser);
+ mKeySetMapping.get(currentKeySetId).add(id);
+ } else {
+ PackageManagerService.reportSettingsProblem(Log.WARN,
+ "Could not read KeySets for KeySetManager!");
+ }
+ }
+ }
+
+ long readIdentifierLPw(XmlPullParser parser)
+ throws XmlPullParserException {
+ return Long.parseLong(parser.getAttributeValue(null, "identifier"));
+ }
+
+ void readPublicKeyLPw(XmlPullParser parser)
+ throws XmlPullParserException {
+ String encodedID = parser.getAttributeValue(null, "identifier");
+ long identifier = Long.parseLong(encodedID);
+ String encodedPublicKey = parser.getAttributeValue(null, "value");
+ PublicKey pub = PackageParser.parsePublicKey(encodedPublicKey);
+ if (pub == null) {
+ PackageManagerService.reportSettingsProblem(Log.WARN,
+ "Could not read public key for KeySetManager!");
+ } else {
+ mPublicKeys.put(identifier, pub);
+ }
+ }
+}
\ No newline at end of file
diff --git a/services/java/com/android/server/pm/PackageKeySetData.java b/services/java/com/android/server/pm/PackageKeySetData.java
new file mode 100644
index 0000000..01ba5ba
--- /dev/null
+++ b/services/java/com/android/server/pm/PackageKeySetData.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2013 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.server.pm;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class PackageKeySetData {
+
+ private long[] mSigningKeySets;
+
+ private long[] mDefinedKeySets;
+
+ private final Map<String, Long> mKeySetAliases;
+
+ PackageKeySetData() {
+ mSigningKeySets = new long[0];
+ mDefinedKeySets = new long[0];
+ mKeySetAliases = new HashMap<String, Long>();
+ }
+
+ PackageKeySetData(PackageKeySetData original) {
+ mSigningKeySets = original.getSigningKeySets().clone();
+ mDefinedKeySets = original.getDefinedKeySets().clone();
+ mKeySetAliases = new HashMap<String, Long>();
+ mKeySetAliases.putAll(original.getAliases());
+ }
+
+ public void addSigningKeySet(long ks) {
+ // deduplicate
+ for (long knownKeySet : mSigningKeySets) {
+ if (ks == knownKeySet) {
+ return;
+ }
+ }
+ int end = mSigningKeySets.length;
+ mSigningKeySets = Arrays.copyOf(mSigningKeySets, end + 1);
+ mSigningKeySets[end] = ks;
+ }
+
+ public void addDefinedKeySet(long ks, String alias) {
+ // deduplicate
+ for (long knownKeySet : mDefinedKeySets) {
+ if (ks == knownKeySet) {
+ return;
+ }
+ }
+ int end = mDefinedKeySets.length;
+ mDefinedKeySets = Arrays.copyOf(mDefinedKeySets, end + 1);
+ mDefinedKeySets[end] = ks;
+ mKeySetAliases.put(alias, ks);
+ }
+
+ public boolean packageIsSignedBy(long ks) {
+ for (long signingKeySet : mSigningKeySets) {
+ if (ks == signingKeySet) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public long[] getSigningKeySets() {
+ return mSigningKeySets;
+ }
+
+ public long[] getDefinedKeySets() {
+ return mDefinedKeySets;
+ }
+
+ public Map<String, Long> getAliases() {
+ return mKeySetAliases;
+ }
+}
\ No newline at end of file
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 7fb8902..c88ed9c 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -70,6 +70,7 @@
import android.content.pm.IPackageMoveObserver;
import android.content.pm.IPackageStatsObserver;
import android.content.pm.InstrumentationInfo;
+import android.content.pm.KeySet;
import android.content.pm.PackageCleanItem;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInfoLite;
@@ -113,10 +114,12 @@
import android.os.UserManager;
import android.os.Environment.UserEnvironment;
import android.security.SystemKeyStore;
+import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
import android.util.LogPrinter;
+import android.util.LongSparseArray;
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
@@ -1022,6 +1025,7 @@
mRestoredSettings = mSettings.readLPw(this, sUserManager.getUsers(false),
mSdkVersion, mOnlyCore);
+
long startTime = SystemClock.uptimeMillis();
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_SYSTEM_SCAN_START,
@@ -3262,10 +3266,12 @@
pp.setOnlyCoreApps(mOnlyCore);
final PackageParser.Package pkg = pp.parsePackage(scanFile,
scanPath, mMetrics, parseFlags);
+
if (pkg == null) {
mLastScanError = pp.getParseError();
return null;
}
+
PackageSetting ps = null;
PackageSetting updatedPkg;
// reader
@@ -3408,6 +3414,7 @@
} else {
resPath = pkg.mScanPath;
}
+
codePath = pkg.mScanPath;
// Set application objects path explicitly.
setApplicationInfoPaths(pkg, codePath, resPath);
@@ -4230,6 +4237,24 @@
}
}
+ // Add the package's KeySets to the global KeySetManager
+ KeySetManager ksm = mSettings.mKeySetManager;
+ try {
+ ksm.addSigningKeySetToPackage(pkg.packageName, pkg.mSigningKeys);
+ if (pkg.mKeySetMapping != null) {
+ for (Map.Entry<String, Set<PublicKey>> entry : pkg.mKeySetMapping.entrySet()) {
+ if (entry.getValue() != null) {
+ ksm.addDefinedKeySetToPackage(pkg.packageName,
+ entry.getValue(), entry.getKey());
+ }
+ }
+ }
+ } catch (NullPointerException e) {
+ Slog.e(TAG, "Could not add KeySet to " + pkg.packageName, e);
+ } catch (IllegalArgumentException e) {
+ Slog.e(TAG, "Could not add KeySet to malformed package" + pkg.packageName, e);
+ }
+
int N = pkg.providers.size();
StringBuilder r = null;
int i;
@@ -8420,7 +8445,9 @@
removePackageDataLI(ps, outInfo, flags, writeSettings);
return true;
}
+
boolean ret = false;
+ mSettings.mKeySetManager.removeAppKeySetData(packageName);
if (isSystemApp(ps)) {
Log.i(TAG, "Removing system package:" + ps.name);
// When an updated system application is deleted we delete the existing resources as well and
@@ -8433,6 +8460,7 @@
ret = deleteInstalledPackageLI(ps, deleteCodeAndResources, flags, outInfo,
writeSettings);
}
+
return ret;
}
@@ -9234,6 +9262,8 @@
public static final int DUMP_PREFERRED_XML = 1 << 10;
+ public static final int DUMP_KEYSETS = 1 << 11;
+
public static final int OPTION_SHOW_FILTERS = 1 << 0;
private int mTypes;
@@ -9331,6 +9361,7 @@
pw.println(" m[essages]: print collected runtime messages");
pw.println(" v[erifiers]: print package verifier info");
pw.println(" <package.name>: info about given package");
+ pw.println(" k[eysets]: print known keysets");
return;
} else if ("-f".equals(opt)) {
dumpState.setOptionEnabled(DumpState.OPTION_SHOW_FILTERS);
@@ -9372,6 +9403,8 @@
dumpState.setDump(DumpState.DUMP_MESSAGES);
} else if ("v".equals(cmd) || "verifiers".equals(cmd)) {
dumpState.setDump(DumpState.DUMP_VERIFIERS);
+ } else if ("k".equals(cmd) || "keysets".equals(cmd)) {
+ dumpState.setDump(DumpState.DUMP_KEYSETS);
}
}
@@ -9507,7 +9540,14 @@
}
}
}
-
+
+ if (dumpState.isDumping(DumpState.DUMP_KEYSETS)) {
+ if (dumpState.onTitlePrinted()) {
+ pw.println(" ");
+ }
+ mSettings.mKeySetManager.dump(pw);
+ }
+
if (dumpState.isDumping(DumpState.DUMP_PACKAGES)) {
mSettings.dumpPackagesLPr(pw, packageName, dumpState);
}
diff --git a/services/java/com/android/server/pm/PackageSettingBase.java b/services/java/com/android/server/pm/PackageSettingBase.java
index ae1b213..2a723b4 100644
--- a/services/java/com/android/server/pm/PackageSettingBase.java
+++ b/services/java/com/android/server/pm/PackageSettingBase.java
@@ -65,6 +65,8 @@
boolean permissionsFixed;
boolean haveGids;
+ PackageKeySetData keySetData = new PackageKeySetData();
+
private static final PackageUserState DEFAULT_USER_STATE = new PackageUserState();
// Whether this package is currently stopped, thus can not be
@@ -120,6 +122,9 @@
origPackage = base.origPackage;
installerPackageName = base.installerPackageName;
+
+ keySetData = new PackageKeySetData(base.keySetData);
+
}
void init(File codePath, File resourcePath, String nativeLibraryPathString,
@@ -170,6 +175,7 @@
userState.put(base.userState.keyAt(i), base.userState.valueAt(i));
}
installStatus = base.installStatus;
+ keySetData = base.keySetData;
}
private PackageUserState modifyUserState(int userId) {
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index 13f514b..b3f87ff 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -44,6 +44,7 @@
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.ComponentInfo;
+import android.content.pm.KeySet;
import android.content.pm.PackageCleanItem;
import android.content.pm.PackageManager;
import android.content.pm.PackageParser;
@@ -58,6 +59,7 @@
import android.os.Process;
import android.os.UserHandle;
import android.util.Log;
+import android.util.LongSparseArray;
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
@@ -68,6 +70,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
+import java.security.PublicKey;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -177,6 +180,9 @@
private final Context mContext;
private final File mSystemDir;
+
+ public final KeySetManager mKeySetManager = new KeySetManager(mPackages);
+
Settings(Context context) {
this(context, Environment.getDataDirectory());
}
@@ -1325,6 +1331,8 @@
}
}
+ mKeySetManager.writeKeySetManagerLPr(serializer);
+
serializer.endTag(null, "packages");
serializer.endDocument();
@@ -1512,9 +1520,31 @@
serializer.endTag(null, "perms");
}
+ writeSigningKeySetsLPr(serializer, pkg.keySetData);
+ writeKeySetAliasesLPr(serializer, pkg.keySetData);
+
serializer.endTag(null, "package");
}
+ void writeSigningKeySetsLPr(XmlSerializer serializer,
+ PackageKeySetData data) throws IOException {
+ for (long id : data.getSigningKeySets()) {
+ serializer.startTag(null, "signing-keyset");
+ serializer.attribute(null, "identifier", Long.toString(id));
+ serializer.endTag(null, "signing-keyset");
+ }
+ }
+
+ void writeKeySetAliasesLPr(XmlSerializer serializer,
+ PackageKeySetData data) throws IOException {
+ for (Map.Entry<String, Long> e: data.getAliases().entrySet()) {
+ serializer.startTag(null, "defined-keyset");
+ serializer.attribute(null, "alias", e.getKey());
+ serializer.attribute(null, "identifier", Long.toString(e.getValue()));
+ serializer.endTag(null, "defined-keyset");
+ }
+ }
+
void writePermissionLPr(XmlSerializer serializer, BasePermission bp)
throws XmlPullParserException, java.io.IOException {
if (bp.type != BasePermission.TYPE_BUILTIN && bp.sourcePackage != null) {
@@ -1692,6 +1722,8 @@
} else if (TAG_READ_EXTERNAL_STORAGE.equals(tagName)) {
final String enforcement = parser.getAttributeValue(null, ATTR_ENFORCEMENT);
mReadExternalStorageEnforced = "1".equals(enforcement);
+ } else if (tagName.equals("keyset-settings")) {
+ mKeySetManager.readKeySetsLPw(parser);
} else {
Slog.w(PackageManagerService.TAG, "Unknown element under <packages>: "
+ parser.getName());
@@ -2287,12 +2319,22 @@
} else if (tagName.equals("perms")) {
readGrantedPermissionsLPw(parser, packageSetting.grantedPermissions);
packageSetting.permissionsFixed = true;
+ } else if (tagName.equals("signing-keyset")) {
+ long id = Long.parseLong(parser.getAttributeValue(null, "identifier"));
+ packageSetting.keySetData.addSigningKeySet(id);
+ Slog.e(TAG, "Adding signing keyset " + Long.toString(id) + " to " + name);
+ } else if (tagName.equals("defined-keyset")) {
+ long id = Long.parseLong(parser.getAttributeValue(null, "identifier"));
+ String alias = parser.getAttributeValue(null, "alias");
+ packageSetting.keySetData.addDefinedKeySet(id, alias);
} else {
PackageManagerService.reportSettingsProblem(Log.WARN,
"Unknown element under <package>: " + parser.getName());
XmlUtils.skipCurrentTag(parser);
}
}
+
+
} else {
XmlUtils.skipCurrentTag(parser);
}
diff --git a/services/java/com/android/server/wm/AppWindowToken.java b/services/java/com/android/server/wm/AppWindowToken.java
index fbb5013..8cc1d02 100644
--- a/services/java/com/android/server/wm/AppWindowToken.java
+++ b/services/java/com/android/server/wm/AppWindowToken.java
@@ -30,6 +30,10 @@
import android.view.WindowManager;
import java.io.PrintWriter;
+import java.util.ArrayList;
+
+class AppTokenList extends ArrayList<AppWindowToken> {
+}
/**
* Version of WindowToken that is specifically for a particular application (or
diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java
index 59e4b0e..33b7a5d 100644
--- a/services/java/com/android/server/wm/DisplayContent.java
+++ b/services/java/com/android/server/wm/DisplayContent.java
@@ -16,6 +16,7 @@
package com.android.server.wm;
+import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayInfo;
@@ -33,6 +34,7 @@
* WindowManagerService.mWindowMap.
*/
class DisplayContent {
+// private final static String TAG = "DisplayContent";
/** Unique identifier of this stack. */
private final int mDisplayId;
@@ -67,6 +69,24 @@
final boolean isDefaultDisplay;
/**
+ * Window tokens that are in the process of exiting, but still
+ * on screen for animations.
+ */
+ final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
+
+ /**
+ * Application tokens that are in the process of exiting, but still
+ * on screen for animations.
+ */
+ final AppTokenList mExitingAppTokens = new AppTokenList();
+
+ /**
+ * Sorted most recent at top, oldest at [0].
+ */
+ ArrayList<TaskList> mTaskLists = new ArrayList<TaskList>();
+ SparseArray<TaskList> mTaskIdToTaskList = new SparseArray<TaskList>();
+
+ /**
* @param display May not be null.
*/
DisplayContent(Display display) {
@@ -96,6 +116,65 @@
mDisplay.getDisplayInfo(mDisplayInfo);
}
+ /**
+ * Find the location to insert a new AppWindowToken into the window-ordered app token list.
+ * @param addPos The location the token was inserted into in mAppTokens.
+ * @param wtoken The token to insert.
+ */
+ void addAppToken(final int addPos, final AppWindowToken wtoken) {
+ TaskList task = mTaskIdToTaskList.get(wtoken.groupId);
+ if (task == null) {
+ task = new TaskList(wtoken, this);
+ mTaskIdToTaskList.put(wtoken.groupId, task);
+ mTaskLists.add(task);
+ } else {
+ task.mAppTokens.add(addPos, wtoken);
+ }
+ }
+
+ void removeAppToken(final AppWindowToken wtoken) {
+ final int taskId = wtoken.groupId;
+ final TaskList task = mTaskIdToTaskList.get(taskId);
+ if (task != null) {
+ AppTokenList appTokens = task.mAppTokens;
+ appTokens.remove(wtoken);
+ if (appTokens.size() == 0) {
+ mTaskLists.remove(task);
+ mTaskIdToTaskList.delete(taskId);
+ }
+ }
+ }
+
+ void setAppTaskId(AppWindowToken wtoken, int newTaskId) {
+ final int taskId = wtoken.groupId;
+ TaskList task = mTaskIdToTaskList.get(taskId);
+ if (task != null) {
+ AppTokenList appTokens = task.mAppTokens;
+ appTokens.remove(wtoken);
+ if (appTokens.size() == 0) {
+ mTaskIdToTaskList.delete(taskId);
+ }
+ }
+
+ task = mTaskIdToTaskList.get(newTaskId);
+ if (task == null) {
+ task = new TaskList(wtoken, this);
+ mTaskIdToTaskList.put(newTaskId, task);
+ } else {
+ task.mAppTokens.add(wtoken);
+ }
+
+ wtoken.groupId = newTaskId;
+ }
+
+ int numTokens() {
+ int count = 0;
+ for (int taskNdx = mTaskLists.size() - 1; taskNdx >= 0; --taskNdx) {
+ count += mTaskLists.get(taskNdx).mAppTokens.size();
+ }
+ return count;
+ }
+
public void dump(String prefix, PrintWriter pw) {
pw.print(prefix); pw.print("Display: mDisplayId="); pw.println(mDisplayId);
final String subPrefix = " " + prefix;
@@ -119,7 +198,53 @@
pw.print("x"); pw.print(mDisplayInfo.smallestNominalAppHeight);
pw.print("-"); pw.print(mDisplayInfo.largestNominalAppWidth);
pw.print("x"); pw.println(mDisplayInfo.largestNominalAppHeight);
- pw.print(subPrefix); pw.print("layoutNeeded="); pw.print(layoutNeeded);
+ pw.print(subPrefix); pw.print("layoutNeeded="); pw.println(layoutNeeded);
+ int ndx = numTokens();
+ if (ndx > 0) {
+ pw.println();
+ pw.println(" Application tokens in Z order:");
+ for (int taskNdx = mTaskLists.size() - 1; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = mTaskLists.get(taskNdx).mAppTokens;
+ for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ pw.print(" App #"); pw.print(ndx--);
+ pw.print(' '); pw.print(wtoken); pw.println(":");
+ wtoken.dump(pw, " ");
+ }
+ }
+ }
+ if (mExitingTokens.size() > 0) {
+ pw.println();
+ pw.println(" Exiting tokens:");
+ for (int i=mExitingTokens.size()-1; i>=0; i--) {
+ WindowToken token = mExitingTokens.get(i);
+ pw.print(" Exiting #"); pw.print(i);
+ pw.print(' '); pw.print(token);
+ pw.println(':');
+ token.dump(pw, " ");
+ }
+ }
+ if (mExitingAppTokens.size() > 0) {
+ pw.println();
+ pw.println(" Exiting application tokens:");
+ for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
+ WindowToken token = mExitingAppTokens.get(i);
+ pw.print(" Exiting App #"); pw.print(i);
+ pw.print(' '); pw.print(token);
+ pw.println(':');
+ token.dump(pw, " ");
+ }
+ }
+ if (mTaskIdToTaskList.size() > 0) {
+ pw.println();
+ for (int i = 0; i < mTaskIdToTaskList.size(); ++i) {
+ pw.print(" TaskList #"); pw.print(i);
+ pw.print(" taskId="); pw.println(mTaskIdToTaskList.keyAt(i));
+ pw.print(" mAppTokens=");
+ pw.println(mTaskIdToTaskList.valueAt(i).mAppTokens);
+ pw.println();
+ }
+ }
pw.println();
}
}
diff --git a/services/java/com/android/server/wm/TaskGroup.java b/services/java/com/android/server/wm/TaskGroup.java
new file mode 100644
index 0000000..1f1dd58
--- /dev/null
+++ b/services/java/com/android/server/wm/TaskGroup.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2013 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.server.wm;
+
+import android.view.IApplicationToken;
+
+import java.util.ArrayList;
+
+public class TaskGroup {
+ public int taskId = -1;
+ public ArrayList<IApplicationToken> tokens = new ArrayList<IApplicationToken>();
+
+ @Override
+ public String toString() {
+ return "id=" + taskId + " tokens=" + tokens;
+ }
+}
diff --git a/services/java/com/android/server/wm/TaskList.java b/services/java/com/android/server/wm/TaskList.java
new file mode 100644
index 0000000..67dfa4f
--- /dev/null
+++ b/services/java/com/android/server/wm/TaskList.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 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.server.wm;
+
+class TaskList {
+// private final String TAG = "TaskGroup";
+ DisplayContent mDisplayContent;
+ final AppTokenList mAppTokens = new AppTokenList();
+ final int taskId;
+
+ TaskList(AppWindowToken wtoken, DisplayContent displayContent) {
+ taskId = wtoken.groupId;
+ mAppTokens.add(wtoken);
+ mDisplayContent = displayContent;
+ }
+
+ @Override
+ public String toString() {
+ return "id=" + taskId + " appTokens=" + mAppTokens;
+ }
+}
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index 3964782..aa81941 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -21,7 +21,6 @@
import android.util.TimeUtils;
import android.util.TypedValue;
import android.view.Display;
-import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManagerPolicy;
import android.view.animation.Animation;
@@ -172,28 +171,34 @@
}
}
- private void updateAppWindowsLocked() {
+ private void updateAppWindowsLocked(int displayId) {
int i;
- final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
- final int NAT = appTokens.size();
- for (i=0; i<NAT; i++) {
- final AppWindowAnimator appAnimator = appTokens.get(i).mAppAnimator;
- final boolean wasAnimating = appAnimator.animation != null
- && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
- if (appAnimator.stepAnimationLocked(mCurrentTime)) {
- mAnimating = true;
- } else if (wasAnimating) {
- // stopped animating, do one more pass through the layout
- setAppLayoutChanges(appAnimator, WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,
- "appToken " + appAnimator.mAppToken + " done");
- if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
- "updateWindowsApps...: done animating " + appAnimator.mAppToken);
+ final DisplayContent displayContent = mService.getDisplayContentLocked(displayId);
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ final int numTasks = tasks.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ final int numTokens = tokens.size();
+ for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
+ final AppWindowAnimator appAnimator = tokens.get(tokenNdx).mAppAnimator;
+ final boolean wasAnimating = appAnimator.animation != null
+ && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
+ if (appAnimator.stepAnimationLocked(mCurrentTime)) {
+ mAnimating = true;
+ } else if (wasAnimating) {
+ // stopped animating, do one more pass through the layout
+ setAppLayoutChanges(appAnimator, WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,
+ "appToken " + appAnimator.mAppToken + " done");
+ if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
+ "updateWindowsApps...: done animating " + appAnimator.mAppToken);
+ }
}
}
- final int NEAT = mService.mExitingAppTokens.size();
+ final AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+ final int NEAT = exitingAppTokens.size();
for (i=0; i<NEAT; i++) {
- final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator;
+ final AppWindowAnimator appAnimator = exitingAppTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
&& appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime)) {
@@ -454,39 +459,43 @@
/** See if any windows have been drawn, so they (and others associated with them) can now be
* shown. */
- private void testTokenMayBeDrawnLocked() {
+ private void testTokenMayBeDrawnLocked(int displayId) {
// See if any windows have been drawn, so they (and others
// associated with them) can now be shown.
- final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
- final int NT = appTokens.size();
- for (int i=0; i<NT; i++) {
- AppWindowToken wtoken = appTokens.get(i);
- AppWindowAnimator appAnimator = wtoken.mAppAnimator;
- final boolean allDrawn = wtoken.allDrawn;
- if (allDrawn != appAnimator.allDrawn) {
- appAnimator.allDrawn = allDrawn;
- if (allDrawn) {
- // The token has now changed state to having all
- // windows shown... what to do, what to do?
- if (appAnimator.freezingScreen) {
- appAnimator.showAllWindowsLocked();
- mService.unsetAppFreezingScreenLocked(wtoken, false, true);
- if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
- "Setting mOrientationChangeComplete=true because wtoken "
- + wtoken + " numInteresting=" + wtoken.numInterestingWindows
- + " numDrawn=" + wtoken.numDrawnWindows);
- // This will set mOrientationChangeComplete and cause a pass through layout.
- setAppLayoutChanges(appAnimator,
- WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,
- "testTokenMayBeDrawnLocked: freezingScreen");
- } else {
- setAppLayoutChanges(appAnimator,
- WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,
- "testTokenMayBeDrawnLocked");
-
- // We can now show all of the drawn windows!
- if (!mService.mOpeningApps.contains(wtoken)) {
- mAnimating |= appAnimator.showAllWindowsLocked();
+ final ArrayList<TaskList> tasks = mService.getDisplayContentLocked(displayId).mTaskLists;
+ final int numTasks = tasks.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ final int numTokens = tokens.size();
+ for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ AppWindowAnimator appAnimator = wtoken.mAppAnimator;
+ final boolean allDrawn = wtoken.allDrawn;
+ if (allDrawn != appAnimator.allDrawn) {
+ appAnimator.allDrawn = allDrawn;
+ if (allDrawn) {
+ // The token has now changed state to having all
+ // windows shown... what to do, what to do?
+ if (appAnimator.freezingScreen) {
+ appAnimator.showAllWindowsLocked();
+ mService.unsetAppFreezingScreenLocked(wtoken, false, true);
+ if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
+ "Setting mOrientationChangeComplete=true because wtoken "
+ + wtoken + " numInteresting=" + wtoken.numInterestingWindows
+ + " numDrawn=" + wtoken.numDrawnWindows);
+ // This will set mOrientationChangeComplete and cause a pass through layout.
+ setAppLayoutChanges(appAnimator,
+ WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,
+ "testTokenMayBeDrawnLocked: freezingScreen");
+ } else {
+ setAppLayoutChanges(appAnimator,
+ WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,
+ "testTokenMayBeDrawnLocked");
+
+ // We can now show all of the drawn windows!
+ if (!mService.mOpeningApps.contains(wtoken)) {
+ mAnimating |= appAnimator.showAllWindowsLocked();
+ }
}
}
}
@@ -530,11 +539,10 @@
SurfaceControl.openTransaction();
SurfaceControl.setAnimationTransaction();
try {
- updateAppWindowsLocked();
-
final int numDisplays = mDisplayContentsAnimators.size();
for (int i = 0; i < numDisplays; i++) {
final int displayId = mDisplayContentsAnimators.keyAt(i);
+ updateAppWindowsLocked(displayId);
DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
final ScreenRotationAnimation screenRotationAnimation =
@@ -560,10 +568,11 @@
}
}
- testTokenMayBeDrawnLocked();
-
for (int i = 0; i < numDisplays; i++) {
final int displayId = mDisplayContentsAnimators.keyAt(i);
+
+ testTokenMayBeDrawnLocked(displayId);
+
DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
final ScreenRotationAnimation screenRotationAnimation =
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index a6ce54c..90ac0b8 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -181,7 +181,7 @@
static final boolean DEBUG_INPUT_METHOD = false;
static final boolean DEBUG_VISIBILITY = false;
static final boolean DEBUG_WINDOW_MOVEMENT = false;
- static final boolean DEBUG_TOKEN_MOVEMENT = false;
+ static final boolean DEBUG_TOKEN_MOVEMENT = true;
static final boolean DEBUG_ORIENTATION = false;
static final boolean DEBUG_APP_ORIENTATION = false;
static final boolean DEBUG_CONFIGURATION = false;
@@ -197,6 +197,7 @@
static final boolean DEBUG_LAYOUT_REPEATS = true;
static final boolean DEBUG_SURFACE_TRACE = false;
static final boolean DEBUG_WINDOW_TRACE = false;
+ static final boolean DEBUG_TASK_MOVEMENT = false;
static final boolean SHOW_SURFACE_ALLOC = false;
static final boolean SHOW_TRANSACTIONS = false;
static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS;
@@ -206,6 +207,9 @@
static final boolean PROFILE_ORIENTATION = false;
static final boolean localLOGV = DEBUG;
+ final static boolean REVERSE_ITERATOR = true;
+ final static boolean FORWARD_ITERATOR = false;
+
/** How much to multiply the policy's type layer, to reserve room
* for multiple windows of the same type and Z-ordering adjustment
* with TYPE_LAYER_OFFSET. */
@@ -332,34 +336,7 @@
/**
* Mapping from a token IBinder to a WindowToken object.
*/
- final HashMap<IBinder, WindowToken> mTokenMap =
- new HashMap<IBinder, WindowToken>();
-
- /**
- * Window tokens that are in the process of exiting, but still
- * on screen for animations.
- */
- final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
-
- /**
- * List controlling the ordering of windows in different applications which must
- * be kept in sync with ActivityManager.
- */
- final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>();
-
- /**
- * AppWindowTokens in the Z order they were in at the start of an animation. Between
- * animations this list is maintained in the exact order of mAppTokens. If tokens
- * are added to mAppTokens during an animation an attempt is made to insert them at the same
- * logical location in this list. Note that this list is always in sync with mWindows.
- */
- ArrayList<AppWindowToken> mAnimatingAppTokens = new ArrayList<AppWindowToken>();
-
- /**
- * Application tokens that are in the process of exiting, but still
- * on screen for animations.
- */
- final ArrayList<AppWindowToken> mExitingAppTokens = new ArrayList<AppWindowToken>();
+ final HashMap<IBinder, WindowToken> mTokenMap = new HashMap<IBinder, WindowToken>();
/**
* List of window tokens that have finished starting their application,
@@ -444,8 +421,12 @@
String mLastANRState;
- /** All DisplayDontents in the world, kept here */
+ /** All DisplayContents in the world, kept here */
private SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>();
+ private SparseArray<DisplayContent> mTaskIdToDisplayContents =
+ new SparseArray<DisplayContent>();
+
+ private final AllWindowsIterator mTmpWindowsIterator = new AllWindowsIterator();
int mRotation = 0;
int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
@@ -851,10 +832,14 @@
private void placeWindowBefore(WindowState pos, WindowState window) {
final WindowList windows = pos.getWindowList();
- final int i = windows.indexOf(pos);
+ int i = windows.indexOf(pos);
if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(
TAG, "Adding window " + window + " at "
+ i + " of " + windows.size() + " (before " + pos + ")");
+ if (i < 0) {
+ Slog.w(TAG, "placeWindowBefore: Unable to find " + pos + " in " + windows);
+ i = 0;
+ }
windows.add(i, window);
mWindowsChanged = true;
}
@@ -919,7 +904,6 @@
final WindowList windows = win.getWindowList();
final int N = windows.size();
final WindowState attached = win.mAttachedWindow;
- int i;
WindowList tokenWindowList = getTokenWindowsOnDisplay(token, displayContent);
if (attached == null) {
int tokenWindowsPos = 0;
@@ -969,21 +953,37 @@
+ client.asBinder() + " (token=" + token + ")");
// Figure out where the window should go, based on the
// order of applications.
- final int NA = mAnimatingAppTokens.size();
WindowState pos = null;
- for (i=NA-1; i>=0; i--) {
- AppWindowToken t = mAnimatingAppTokens.get(i);
- if (t == token) {
- i--;
- break;
- }
- // We haven't reached the token yet; if this token
- // is not going to the bottom and has windows on this display, we can
- // use it as an anchor for when we do reach the token.
- tokenWindowList = getTokenWindowsOnDisplay(t, win.mDisplayContent);
- if (!t.sendingToBottom && tokenWindowList.size() > 0) {
- pos = tokenWindowList.get(0);
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ int taskNdx;
+ int tokenNdx = -1;
+ for (taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ for (tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken t = tokens.get(tokenNdx);
+ if (t == token) {
+ --tokenNdx;
+ if (tokenNdx < 0) {
+ --taskNdx;
+ if (taskNdx >= 0) {
+ tokenNdx = tasks.get(taskNdx).mAppTokens.size() - 1;
+ }
+ }
+ break;
+ }
+
+ // We haven't reached the token yet; if this token
+ // is not going to the bottom and has windows on this display, we can
+ // use it as an anchor for when we do reach the token.
+ tokenWindowList = getTokenWindowsOnDisplay(t, win.mDisplayContent);
+ if (!t.sendingToBottom && tokenWindowList.size() > 0) {
+ pos = tokenWindowList.get(0);
+ }
+ }
+ if (tokenNdx >= 0) {
+ // early exit
+ break;
}
}
// We now know the index into the apps. If we found
@@ -1007,15 +1007,21 @@
} else {
// Continue looking down until we find the first
// token that has windows on this display.
- while (i >= 0) {
- AppWindowToken t = mAnimatingAppTokens.get(i);
- tokenWindowList = getTokenWindowsOnDisplay(t, win.mDisplayContent);
- final int NW = tokenWindowList.size();
- if (NW > 0) {
- pos = tokenWindowList.get(NW-1);
+ for ( ; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ for ( ; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken t = tokens.get(tokenNdx);
+ tokenWindowList = getTokenWindowsOnDisplay(t, displayContent);
+ final int NW = tokenWindowList.size();
+ if (NW > 0) {
+ pos = tokenWindowList.get(NW-1);
+ break;
+ }
+ }
+ if (tokenNdx >= 0) {
+ // found
break;
}
- i--;
}
if (pos != null) {
// Move in front of any windows attached to this
@@ -1034,7 +1040,8 @@
} else {
// Just search for the start of this layer.
final int myLayer = win.mBaseLayer;
- for (i=0; i<N; i++) {
+ int i;
+ for (i = 0; i < N; i++) {
WindowState w = windows.get(i);
if (w.mBaseLayer > myLayer) {
break;
@@ -1052,7 +1059,8 @@
} else {
// Figure out where window should go, based on layer.
final int myLayer = win.mBaseLayer;
- for (i=N-1; i>=0; i--) {
+ int i;
+ for (i = N - 1; i >= 0; i--) {
if (windows.get(i).mBaseLayer <= myLayer) {
break;
}
@@ -1077,7 +1085,8 @@
final int sublayer = win.mSubLayer;
int largestSublayer = Integer.MIN_VALUE;
WindowState windowWithLargestSublayer = null;
- for (i=0; i<NA; i++) {
+ int i;
+ for (i = 0; i < NA; i++) {
WindowState w = tokenWindowList.get(i);
final int wSublayer = w.mSubLayer;
if (wSublayer >= largestSublayer) {
@@ -2482,22 +2491,15 @@
public void updateAppOpsState() {
synchronized(mWindowMap) {
- boolean changed = false;
- for (int i=0; i<mDisplayContents.size(); i++) {
- DisplayContent display = mDisplayContents.valueAt(i);
- WindowList windows = display.getWindowList();
- for (int j=0; j<windows.size(); j++) {
- final WindowState win = windows.get(j);
- if (win.mAppOp != AppOpsManager.OP_NONE) {
- changed |= win.setAppOpVisibilityLw(mAppOps.checkOpNoThrow(win.mAppOp,
- win.getOwningUid(),
- win.getOwningPackage()) == AppOpsManager.MODE_ALLOWED);
- }
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState win = mTmpWindowsIterator.next();
+ if (win.mAppOp != AppOpsManager.OP_NONE) {
+ final int mode = mAppOps.checkOpNoThrow(win.mAppOp, win.getOwningUid(),
+ win.getOwningPackage());
+ win.setAppOpVisibilityLw(mode == AppOpsManager.MODE_ALLOWED);
}
}
- if (changed) {
- scheduleAnimationLocked();
- }
}
}
@@ -3137,32 +3139,63 @@
// Application Window Tokens
// -------------------------------------------------------------
- public void validateAppTokens(List<IBinder> tokens) {
- int v = tokens.size()-1;
- int m = mAppTokens.size()-1;
- while (v >= 0 && m >= 0) {
- AppWindowToken atoken = mAppTokens.get(m);
- if (atoken.removed) {
- m--;
- continue;
+ public void validateAppTokens(List<TaskGroup> tasks) {
+ synchronized (mWindowMap) {
+ int t = tasks.size() - 1;
+ if (t < 0) {
+ Slog.w(TAG, "validateAppTokens: empty task list");
+ return;
}
- if (tokens.get(v) != atoken.token) {
- Slog.w(TAG, "Tokens out of sync: external is " + tokens.get(v)
- + " @ " + v + ", internal is " + atoken.token + " @ " + m);
+
+ TaskGroup task = tasks.get(0);
+ int taskId = task.taskId;
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ Slog.w(TAG, "validateAppTokens: no Display for taskId=" + taskId);
+ return;
}
- v--;
- m--;
- }
- while (v >= 0) {
- Slog.w(TAG, "External token not found: " + tokens.get(v) + " @ " + v);
- v--;
- }
- while (m >= 0) {
- AppWindowToken atoken = mAppTokens.get(m);
- if (!atoken.removed) {
- Slog.w(TAG, "Invalid internal atoken: " + atoken.token + " @ " + m);
+
+ final ArrayList<TaskList> localTasks = displayContent.mTaskLists;
+ int taskNdx;
+ for (taskNdx = localTasks.size() - 1; taskNdx >= 0 && t >= 0; --taskNdx, --t) {
+ AppTokenList localTokens = localTasks.get(taskNdx).mAppTokens;
+ task = tasks.get(t);
+ List<IApplicationToken> tokens = task.tokens;
+
+ DisplayContent lastDisplayContent = displayContent;
+ displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent != lastDisplayContent) {
+ Slog.w(TAG, "validateAppTokens: displayContent changed in TaskGroup list!");
+ return;
+ }
+
+ int tokenNdx;
+ int v;
+ for (tokenNdx = localTokens.size() - 1, v = task.tokens.size() - 1;
+ tokenNdx >= 0 && v >= 0; ) {
+ final AppWindowToken atoken = localTokens.get(tokenNdx);
+ if (atoken.removed) {
+ --tokenNdx;
+ continue;
+ }
+ if (tokens.get(v) != atoken.token) {
+ break;
+ }
+ --tokenNdx;
+ v--;
+ }
+
+ if (tokenNdx >= 0 || v >= 0) {
+ break;
+ }
}
- m--;
+
+ if (taskNdx >= 0 || t >= 0) {
+ Slog.w(TAG, "validateAppTokens: Mismatch! ActivityManager=" + tasks);
+ Slog.w(TAG, "validateAppTokens: Mismatch! WindowManager="
+ + displayContent.mTaskLists);
+ Slog.w(TAG, "validateAppTokens: Mismatch! Callers=" + Debug.getCallers(4));
+ }
}
}
@@ -3226,6 +3259,7 @@
final long origId = Binder.clearCallingIdentity();
synchronized(mWindowMap) {
+ DisplayContent displayContent = null;
WindowToken wtoken = mTokenMap.remove(token);
if (wtoken != null) {
boolean delayed = false;
@@ -3235,6 +3269,7 @@
for (int i=0; i<N; i++) {
WindowState win = wtoken.windows.get(i);
+ displayContent = win.mDisplayContent;
if (win.mWinAnimator.isAnimating()) {
delayed = true;
@@ -3244,13 +3279,12 @@
win.mWinAnimator.applyAnimationLocked(WindowManagerPolicy.TRANSIT_EXIT,
false);
//TODO (multidisplay): Magnification is supported only for the default
- if (mDisplayMagnifier != null
- && win.getDisplayId() == Display.DEFAULT_DISPLAY) {
+ if (mDisplayMagnifier != null && win.isDefaultDisplay()) {
mDisplayMagnifier.onWindowTransitionLocked(win,
WindowManagerPolicy.TRANSIT_EXIT);
}
changed = true;
- win.mDisplayContent.layoutNeeded = true;
+ displayContent.layoutNeeded = true;
}
}
@@ -3263,7 +3297,7 @@
}
if (delayed) {
- mExitingTokens.add(wtoken);
+ displayContent.mExitingTokens.add(wtoken);
} else if (wtoken.windowType == TYPE_WALLPAPER) {
mWallpaperTokens.remove(wtoken);
}
@@ -3277,27 +3311,9 @@
Binder.restoreCallingIdentity(origId);
}
- /**
- * Find the location to insert a new AppWindowToken into the window-ordered app token list.
- * Note that mAppTokens.size() == mAnimatingAppTokens.size() + 1.
- * @param addPos The location the token was inserted into in mAppTokens.
- * @param atoken The token to insert.
- */
- private void addAppTokenToAnimating(final int addPos, final AppWindowToken atoken) {
- if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
- // It was inserted into the beginning or end of mAppTokens. Honor that.
- mAnimatingAppTokens.add(addPos, atoken);
- return;
- }
- // Find the item immediately above the mAppTokens insertion point and put the token
- // immediately below that one in mAnimatingAppTokens.
- final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
- mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), atoken);
- }
-
@Override
public void addAppToken(int addPos, IApplicationToken token,
- int groupId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
+ int taskId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"addAppToken()")) {
throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@@ -3325,15 +3341,21 @@
}
atoken = new AppWindowToken(this, token);
atoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
- atoken.groupId = groupId;
+ atoken.groupId = taskId;
atoken.appFullscreen = fullscreen;
atoken.showWhenLocked = showWhenLocked;
atoken.requestedOrientation = requestedOrientation;
if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
+ " at " + addPos);
- mAppTokens.add(addPos, atoken);
- addAppTokenToAnimating(addPos, atoken);
+
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ displayContent = getDefaultDisplayContentLocked();
+ mTaskIdToDisplayContents.put(taskId, displayContent);
+ }
+ displayContent.addAppToken(addPos, atoken);
mTokenMap.put(token.asBinder(), atoken);
+ mTaskIdToDisplayContents.put(taskId, displayContent);
// Application tokens start out hidden.
atoken.hidden = true;
@@ -3351,12 +3373,17 @@
}
synchronized(mWindowMap) {
- AppWindowToken atoken = findAppWindowToken(token);
+ final AppWindowToken atoken = findAppWindowToken(token);
if (atoken == null) {
Slog.w(TAG, "Attempted to set group id of non-existing app token: " + token);
return;
}
- atoken.groupId = groupId;
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(atoken.groupId);
+ if (displayContent == null) {
+ Slog.w(TAG, "setAppGroupId: No DisplayContent for taskId=" + atoken.groupId);
+ displayContent = getDefaultDisplayContentLocked();
+ }
+ displayContent.setAppTaskId(atoken, groupId);
}
}
@@ -3402,67 +3429,73 @@
boolean findingBehind = false;
boolean haveGroup = false;
boolean lastFullscreen = false;
- for (int pos = mAppTokens.size() - 1; pos >= 0; pos--) {
- AppWindowToken atoken = mAppTokens.get(pos);
-
- if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken);
-
- // if we're about to tear down this window and not seek for
- // the behind activity, don't use it for orientation
- if (!findingBehind
- && (!atoken.hidden && atoken.hiddenRequested)) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
- + " -- going to hide");
- continue;
- }
-
- if (haveGroup == true && curGroup != atoken.groupId) {
- // If we have hit a new application group, and the bottom
- // of the previous group didn't explicitly say to use
- // the orientation behind it, and the last app was
- // full screen, then we'll stick with the
- // user's orientation.
- if (lastOrientation != ActivityInfo.SCREEN_ORIENTATION_BEHIND
- && lastFullscreen) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
- + " -- end of group, return " + lastOrientation);
- return lastOrientation;
+ // TODO: Multi window.
+ DisplayContent displayContent = getDefaultDisplayContentLocked();
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken atoken = tokens.get(tokenNdx);
+
+ if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken);
+
+ // if we're about to tear down this window and not seek for
+ // the behind activity, don't use it for orientation
+ if (!findingBehind
+ && (!atoken.hidden && atoken.hiddenRequested)) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
+ + " -- going to hide");
+ continue;
}
+
+ if (haveGroup == true && curGroup != atoken.groupId) {
+ // If we have hit a new application group, and the bottom
+ // of the previous group didn't explicitly say to use
+ // the orientation behind it, and the last app was
+ // full screen, then we'll stick with the
+ // user's orientation.
+ if (lastOrientation != ActivityInfo.SCREEN_ORIENTATION_BEHIND
+ && lastFullscreen) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ + " -- end of group, return " + lastOrientation);
+ return lastOrientation;
+ }
+ }
+
+ // We ignore any hidden applications on the top.
+ if (atoken.hiddenRequested || atoken.willBeHidden) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
+ + " -- hidden on top");
+ continue;
+ }
+
+ if (!haveGroup) {
+ haveGroup = true;
+ curGroup = atoken.groupId;
+ lastOrientation = atoken.requestedOrientation;
+ }
+
+ int or = atoken.requestedOrientation;
+ // If this application is fullscreen, and didn't explicitly say
+ // to use the orientation behind it, then just take whatever
+ // orientation it has and ignores whatever is under it.
+ lastFullscreen = atoken.appFullscreen;
+ if (lastFullscreen
+ && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ + " -- full screen, return " + or);
+ return or;
+ }
+ // If this application has requested an explicit orientation,
+ // then use it.
+ if (or != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
+ && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ + " -- explicitly set, return " + or);
+ return or;
+ }
+ findingBehind |= (or == ActivityInfo.SCREEN_ORIENTATION_BEHIND);
}
-
- // We ignore any hidden applications on the top.
- if (atoken.hiddenRequested || atoken.willBeHidden) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
- + " -- hidden on top");
- continue;
- }
-
- if (!haveGroup) {
- haveGroup = true;
- curGroup = atoken.groupId;
- lastOrientation = atoken.requestedOrientation;
- }
-
- int or = atoken.requestedOrientation;
- // If this application is fullscreen, and didn't explicitly say
- // to use the orientation behind it, then just take whatever
- // orientation it has and ignores whatever is under it.
- lastFullscreen = atoken.appFullscreen;
- if (lastFullscreen
- && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
- + " -- full screen, return " + or);
- return or;
- }
- // If this application has requested an explicit orientation,
- // then use it.
- if (or != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
- && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
- + " -- explicitly set, return " + or);
- return or;
- }
- findingBehind |= (or == ActivityInfo.SCREEN_ORIENTATION_BEHIND);
}
if (DEBUG_ORIENTATION) Slog.v(TAG, "No app is requesting an orientation");
return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
@@ -4318,11 +4351,12 @@
TAG, "Removing app " + wtoken + " delayed=" + delayed
+ " animation=" + wtoken.mAppAnimator.animation
+ " animating=" + wtoken.mAppAnimator.animating);
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(wtoken.groupId);
if (delayed) {
// set the token aside because it has an active animation to be finished
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"removeAppToken make exiting: " + wtoken);
- mExitingAppTokens.add(wtoken);
+ displayContent.mExitingAppTokens.add(wtoken);
} else {
// Make sure there is no animation running on this token,
// so any windows associated with it will be removed as
@@ -4332,8 +4366,7 @@
}
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"removeAppToken: " + wtoken);
- mAppTokens.remove(wtoken);
- mAnimatingAppTokens.remove(wtoken);
+ displayContent.removeAppToken(wtoken);
wtoken.removed = true;
if (wtoken.startingData != null) {
startingToken = wtoken;
@@ -4385,78 +4418,85 @@
}
void dumpAppTokensLocked() {
- for (int i=mAppTokens.size()-1; i>=0; i--) {
- Slog.v(TAG, " #" + i + ": " + mAppTokens.get(i).token);
- }
- }
-
- void dumpAnimatingAppTokensLocked() {
- for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
- Slog.v(TAG, " #" + i + ": " + mAnimatingAppTokens.get(i).token);
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
+ while (iterator.hasNext()) {
+ DisplayContent displayContent = iterator.next();
+ Slog.v(TAG, " Display " + displayContent.getDisplayId());
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ int i = displayContent.numTokens();
+ for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ Slog.v(TAG, " #" + --i + ": " + wtoken.token);
+ }
+ }
}
}
void dumpWindowsLocked() {
int i = 0;
- final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(REVERSE_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
Slog.v(TAG, " #" + i++ + ": " + w);
}
}
- private int findWindowOffsetLocked(WindowList windows, int tokenPos) {
+ private int findAppWindowInsertionPointLocked(AppWindowToken target) {
+ final int taskId = target.groupId;
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ Slog.w(TAG, "findTopAppWindowLocked: no DisplayContent for " + target);
+ return 0;
+ }
+ final WindowList windows = displayContent.getWindowList();
final int NW = windows.size();
- if (tokenPos >= mAnimatingAppTokens.size()) {
- int i = NW;
- while (i > 0) {
- i--;
- WindowState win = windows.get(i);
- if (win.getAppToken() != null) {
- return i+1;
- }
- }
- }
-
- while (tokenPos > 0) {
- // Find the first app token below the new position that has
- // a window displayed.
- final AppWindowToken wtoken = mAppTokens.get(tokenPos-1);
- if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows @ "
- + tokenPos + " -- " + wtoken.token);
- if (wtoken.sendingToBottom) {
- if (DEBUG_REORDER) Slog.v(TAG,
- "Skipping token -- currently sending to bottom");
- tokenPos--;
+ boolean found = false;
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
+ final TaskList task = tasks.get(taskNdx);
+ if (!found && task.taskId != taskId) {
continue;
}
- int i = wtoken.windows.size();
- while (i > 0) {
- i--;
- WindowState win = wtoken.windows.get(i);
- int j = win.mChildWindows.size();
- while (j > 0) {
- j--;
- WindowState cwin = win.mChildWindows.get(j);
- if (cwin.mSubLayer >= 0) {
- for (int pos=NW-1; pos>=0; pos--) {
- if (windows.get(pos) == cwin) {
- if (DEBUG_REORDER) Slog.v(TAG,
- "Found child win @" + (pos+1));
- return pos+1;
+ AppTokenList tokens = task.mAppTokens;
+ for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ if (!found && wtoken == target) {
+ found = true;
+ }
+ if (found) {
+ // Find the first app token below the new position that has
+ // a window displayed.
+ if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows in " + wtoken.token);
+ if (wtoken.sendingToBottom) {
+ if (DEBUG_REORDER) Slog.v(TAG, "Skipping token -- currently sending to bottom");
+ continue;
+ }
+ for (int i = wtoken.windows.size() - 1; i >= 0; --i) {
+ WindowState win = wtoken.windows.get(i);
+ for (int j = win.mChildWindows.size() - 1; j >= 0; --j) {
+ WindowState cwin = win.mChildWindows.get(j);
+ if (cwin.mSubLayer >= 0) {
+ for (int pos = NW - 1; pos >= 0; pos--) {
+ if (windows.get(pos) == cwin) {
+ if (DEBUG_REORDER) Slog.v(TAG,
+ "Found child win @" + (pos + 1));
+ return pos + 1;
+ }
+ }
+ }
+ }
+ for (int pos = NW - 1; pos >= 0; pos--) {
+ if (windows.get(pos) == win) {
+ if (DEBUG_REORDER) Slog.v(TAG, "Found win @" + (pos + 1));
+ return pos + 1;
}
}
}
}
- for (int pos=NW-1; pos>=0; pos--) {
- if (windows.get(pos) == win) {
- if (DEBUG_REORDER) Slog.v(TAG, "Found win @" + (pos+1));
- return pos+1;
- }
- }
}
- tokenPos--;
}
return 0;
@@ -4505,198 +4545,104 @@
return index;
}
- @Override
- public void moveAppToken(int index, IBinder token) {
- if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
- "moveAppToken()")) {
- throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
+ private void moveTaskWindowsLocked(int taskId) {
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ Slog.w(TAG, "moveTaskWindowsLocked: can't find DisplayContent for taskId=" + taskId);
+ return;
}
- synchronized(mWindowMap) {
- if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:");
- if (DEBUG_REORDER) dumpAppTokensLocked();
- final AppWindowToken wtoken = findAppWindowToken(token);
- final int oldIndex = mAppTokens.indexOf(wtoken);
- if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
- "Start moving token " + wtoken + " initially at "
- + oldIndex);
- if (oldIndex > index && mAppTransition.isTransitionSet()) {
- // animation towards back has not started, copy old list for duration of animation.
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
- }
- if (wtoken == null || !mAppTokens.remove(wtoken)) {
- Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
- + token + " (" + wtoken + ")");
- return;
- }
- mAppTokens.add(index, wtoken);
- if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":");
- else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index);
- if (DEBUG_REORDER) dumpAppTokensLocked();
- if (!mAppTransition.isTransitionSet()) {
- // Not animating, bring animating app list in line with mAppTokens.
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
-
- // Bring window ordering, window focus and input window in line with new app token
- final long origId = Binder.clearCallingIdentity();
- if (DEBUG_REORDER) Slog.v(TAG, "Removing windows in " + token + ":");
- if (DEBUG_REORDER) dumpWindowsLocked();
- if (tmpRemoveAppWindowsLocked(wtoken)) {
- if (DEBUG_REORDER) Slog.v(TAG, "Adding windows back in:");
- if (DEBUG_REORDER) dumpWindowsLocked();
- DisplayContentsIterator iterator = new DisplayContentsIterator();
- while(iterator.hasNext()) {
- final DisplayContent displayContent = iterator.next();
- final WindowList windows = displayContent.getWindowList();
- final int pos = findWindowOffsetLocked(windows, index);
- final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken);
- if (pos != newPos) {
- displayContent.layoutNeeded = true;
- }
- }
- if (DEBUG_REORDER) Slog.v(TAG, "Final window list:");
- if (DEBUG_REORDER) dumpWindowsLocked();
- updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
- false /*updateInputWindows*/);
- mInputMonitor.setUpdateInputWindowsNeededLw();
- performLayoutAndPlaceSurfacesLocked();
- mInputMonitor.updateInputWindowsLw(false /*force*/);
- }
- Binder.restoreCallingIdentity(origId);
- }
+ TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
+ if (taskList == null) {
+ Slog.w(TAG, "moveTaskWindowsLocked: can't find TaskList for taskId=" + taskId);
+ return;
}
- }
- private void removeAppTokensLocked(List<IBinder> tokens) {
- // XXX This should be done more efficiently!
- // (take advantage of the fact that both lists should be
- // ordered in the same way.)
- int N = tokens.size();
- for (int i=0; i<N; i++) {
- IBinder token = tokens.get(i);
- final AppWindowToken wtoken = findAppWindowToken(token);
- if (DEBUG_REORDER || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
- "Temporarily removing " + wtoken + " from " + mAppTokens.indexOf(wtoken));
- if (!mAppTokens.remove(wtoken)) {
- Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
- + token + " (" + wtoken + ")");
- i--;
- N--;
- }
- }
- }
-
- private void moveAppWindowsLocked(List<IBinder> tokens, int tokenPos) {
// First remove all of the windows from the list.
- final int N = tokens.size();
- int i;
- for (i=0; i<N; i++) {
- WindowToken token = mTokenMap.get(tokens.get(i));
- if (token != null) {
- tmpRemoveAppWindowsLocked(token);
- }
+ for (AppWindowToken wtoken : taskList.mAppTokens) {
+ tmpRemoveAppWindowsLocked(wtoken);
}
// And now add them back at the correct place.
- DisplayContentsIterator iterator = new DisplayContentsIterator();
- while (iterator.hasNext()) {
- final DisplayContent displayContent = iterator.next();
- final WindowList windows = displayContent.getWindowList();
- // Where to start adding?
- int pos = findWindowOffsetLocked(windows, tokenPos);
- for (i=0; i<N; i++) {
- WindowToken token = mTokenMap.get(tokens.get(i));
- if (token != null) {
- final int newPos = reAddAppWindowsLocked(displayContent, pos, token);
- if (newPos != pos) {
- displayContent.layoutNeeded = true;
- }
- pos = newPos;
+ // Where to start adding?
+ int pos = findAppWindowInsertionPointLocked(taskList.mAppTokens.get(0));
+ for (AppWindowToken wtoken : taskList.mAppTokens) {
+ if (wtoken != null) {
+ final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken);
+ if (newPos != pos) {
+ displayContent.layoutNeeded = true;
}
- }
- if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
- false /*updateInputWindows*/)) {
- assignLayersLocked(windows);
+ pos = newPos;
}
}
+ if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
+ false /*updateInputWindows*/)) {
+ assignLayersLocked(displayContent.getWindowList());
+ }
+ updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
+ false /*updateInputWindows*/);
mInputMonitor.setUpdateInputWindowsNeededLw();
-
- // Note that the above updateFocusedWindowLocked used to sit here.
-
performLayoutAndPlaceSurfacesLocked();
mInputMonitor.updateInputWindowsLw(false /*force*/);
//dump();
}
- @Override
- public void moveAppTokensToTop(List<IBinder> tokens) {
- if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
- "moveAppTokensToTop()")) {
- throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
- }
-
+ public void moveTaskToTop(int taskId) {
final long origId = Binder.clearCallingIdentity();
- synchronized(mWindowMap) {
- removeAppTokensLocked(tokens);
- final int N = tokens.size();
- for (int i=0; i<N; i++) {
- AppWindowToken wt = findAppWindowToken(tokens.get(i));
- if (wt != null) {
- if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
- "Adding next to top: " + wt);
- mAppTokens.add(wt);
- if (mAppTransition.isTransitionSet()) {
- wt.sendingToBottom = false;
- }
+ try {
+ synchronized(mWindowMap) {
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ Slog.e(TAG, "moveTaskToTop: taskId=" + taskId
+ + " not found in mTaskIdToDisplayContents");
+ return;
}
- }
+ TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
+ if (taskList == null) {
+ Slog.e(TAG, "moveTaskToTop: taskId=" + taskId
+ + " not found in mTaskIdToTaskLists");
+ return;
+ }
+ if (!displayContent.mTaskLists.remove(taskList)) {
+ Slog.e(TAG, "moveTaskToTop: taskId=" + taskId + " not found in mTaskLists");
+ }
+ displayContent.mTaskLists.add(taskList);
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
- moveAppWindowsLocked(tokens, mAppTokens.size());
+ moveTaskWindowsLocked(taskId);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(origId);
}
- Binder.restoreCallingIdentity(origId);
}
- @Override
- public void moveAppTokensToBottom(List<IBinder> tokens) {
- if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
- "moveAppTokensToBottom()")) {
- throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
- }
-
+ public void moveTaskToBottom(int taskId) {
final long origId = Binder.clearCallingIdentity();
- synchronized(mWindowMap) {
- final int N = tokens.size();
- if (N > 0) {
- // animating towards back, hang onto old list for duration of animation.
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
- }
- removeAppTokensLocked(tokens);
- int pos = 0;
- for (int i=0; i<N; i++) {
- AppWindowToken wt = findAppWindowToken(tokens.get(i));
- if (wt != null) {
- if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
- "Adding next to bottom: " + wt + " at " + pos);
- mAppTokens.add(pos, wt);
- if (mAppTransition.isTransitionSet()) {
- wt.sendingToBottom = true;
- }
- pos++;
+ try {
+ synchronized(mWindowMap) {
+ DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+ if (displayContent == null) {
+ Slog.e(TAG, "moveTaskToBottom: taskId=" + taskId
+ + " not found in mTaskIdToDisplayContents");
+ return;
}
- }
+ TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
+ if (taskList == null) {
+ Slog.e(TAG, "moveTaskToTopBottom: taskId=" + taskId
+ + " not found in mTaskIdToTaskLists");
+ return;
+ }
+ if (!displayContent.mTaskLists.remove(taskList)) {
+ Slog.e(TAG, "moveTaskToBottom: taskId=" + taskId + " not found in mTaskLists");
+ }
+ displayContent.mTaskLists.add(0, taskList);
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
- moveAppWindowsLocked(tokens, 0);
+ moveTaskWindowsLocked(taskId);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(origId);
}
- Binder.restoreCallingIdentity(origId);
}
// -------------------------------------------------------------
@@ -4817,9 +4763,9 @@
@Override
public void closeSystemDialogs(String reason) {
synchronized(mWindowMap) {
- final AllWindowsIterator iterator = new AllWindowsIterator();
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
if (w.mHasSurface) {
try {
w.mClient.closeSystemDialogs(reason);
@@ -5213,9 +5159,9 @@
// the background..)
if (on) {
boolean isVisible = false;
- final AllWindowsIterator iterator = new AllWindowsIterator();
- while (iterator.hasNext()) {
- final WindowState ws = iterator.next();
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState ws = mTmpWindowsIterator.next();
if (ws.mSession.mPid == pid && ws.isVisibleLw()) {
isVisible = true;
break;
@@ -6110,9 +6056,9 @@
}
synchronized (mWindowMap) {
- final AllWindowsIterator iterator = new AllWindowsIterator();
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
if (System.identityHashCode(w) == hashCode) {
return w;
}
@@ -6661,10 +6607,10 @@
// TODO(multidisplay): Call isScreenOn for each display.
private void sendScreenStatusToClientsLocked() {
final boolean on = mPowerManager.isScreenOn();
- final AllWindowsIterator iterator = new AllWindowsIterator();
- while (iterator.hasNext()) {
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
try {
- iterator.next().mClient.dispatchScreenState(on);
+ mTmpWindowsIterator.next().mClient.dispatchScreenState(on);
} catch (RemoteException e) {
// Ignored
}
@@ -6960,8 +6906,6 @@
if (mAppTransition.isTransitionSet()) {
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** APP TRANSITION TIMEOUT");
mAppTransition.setTimeout();
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
performLayoutAndPlaceSurfacesLocked();
}
}
@@ -7006,13 +6950,16 @@
case APP_FREEZE_TIMEOUT: {
synchronized (mWindowMap) {
Slog.w(TAG, "App freeze timeout expired.");
- int i = mAppTokens.size();
- while (i > 0) {
- i--;
- AppWindowToken tok = mAppTokens.get(i);
- if (tok.mAppAnimator.freezingScreen) {
- Slog.w(TAG, "Force clearing freeze: " + tok);
- unsetAppFreezingScreenLocked(tok, true, true);
+ DisplayContent displayContent = getDefaultDisplayContentLocked();
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
+ AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
+ AppWindowToken tok = tokens.get(tokenNdx);
+ if (tok.mAppAnimator.freezingScreen) {
+ Slog.w(TAG, "Force clearing freeze: " + tok);
+ unsetAppFreezingScreenLocked(tok, true, true);
+ }
}
}
}
@@ -7408,6 +7355,7 @@
performLayoutAndPlaceSurfacesLocked();
}
+ @Override
public void setOverscan(int displayId, int left, int top, int right, int bottom) {
if (mContext.checkCallingOrSelfPermission(
android.Manifest.permission.WRITE_SECURE_SETTINGS) !=
@@ -7526,15 +7474,22 @@
// in the main app list, but still have windows shown. We put them
// in the back because now that the animation is over we no longer
// will care about them.
- int NT = mExitingAppTokens.size();
+ AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+ int NT = exitingAppTokens.size();
for (int j=0; j<NT; j++) {
- i = reAddAppWindowsLocked(displayContent, i, mExitingAppTokens.get(j));
+ i = reAddAppWindowsLocked(displayContent, i, exitingAppTokens.get(j));
}
// And add in the still active app tokens in Z order.
- NT = mAnimatingAppTokens.size();
- for (int j=0; j<NT; j++) {
- i = reAddAppWindowsLocked(displayContent, i, mAnimatingAppTokens.get(j));
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ final int numTasks = tasks.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ final int numTokens = tokens.size();
+ for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ i = reAddAppWindowsLocked(displayContent, i, wtoken);
+ }
}
i -= lastBelow;
@@ -7554,7 +7509,7 @@
}
}
Slog.w(TAG, "Current app token list:");
- dumpAnimatingAppTokensLocked();
+ dumpAppTokensLocked();
Slog.w(TAG, "Final window list:");
dumpWindowsLocked();
}
@@ -8204,11 +8159,17 @@
mAppTransition.setIdle();
// Restore window app tokens to the ActivityManager views
- for (int i = mAnimatingAppTokens.size() - 1; i >= 0; i--) {
- mAnimatingAppTokens.get(i).sendingToBottom = false;
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ final int numTasks = tasks.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ final int numTokens = tokens.size();
+ for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ wtoken.sendingToBottom = false;
+ }
}
- mAnimatingAppTokens.clear();
- mAnimatingAppTokens.addAll(mAppTokens);
rebuildAppWindowListLocked();
changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
@@ -8365,21 +8326,25 @@
}
}
- private void updateAllDrawnLocked() {
+ private void updateAllDrawnLocked(DisplayContent displayContent) {
// See if any windows have been drawn, so they (and others
// associated with them) can now be shown.
- final ArrayList<AppWindowToken> appTokens = mAnimatingAppTokens;
- final int NT = appTokens.size();
- for (int i=0; i<NT; i++) {
- AppWindowToken wtoken = appTokens.get(i);
- if (!wtoken.allDrawn) {
- int numInteresting = wtoken.numInterestingWindows;
- if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
- "allDrawn: " + wtoken
- + " interesting=" + numInteresting
- + " drawn=" + wtoken.numDrawnWindows);
- wtoken.allDrawn = true;
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ final int numTasks = tasks.size();
+ for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) {
+ final AppTokenList tokens = tasks.get(taskNdx).mAppTokens;
+ final int numTokens = tokens.size();
+ for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) {
+ final AppWindowToken wtoken = tokens.get(tokenNdx);
+ if (!wtoken.allDrawn) {
+ int numInteresting = wtoken.numInterestingWindows;
+ if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
+ if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
+ "allDrawn: " + wtoken
+ + " interesting=" + numInteresting
+ + " drawn=" + wtoken.numDrawnWindows);
+ wtoken.allDrawn = true;
+ }
}
}
}
@@ -8403,13 +8368,17 @@
}
// Initialize state of exiting tokens.
- for (i=mExitingTokens.size()-1; i>=0; i--) {
- mExitingTokens.get(i).hasVisible = false;
- }
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
+ while (iterator.hasNext()) {
+ final DisplayContent displayContent = iterator.next();
+ for (i=displayContent.mExitingTokens.size()-1; i>=0; i--) {
+ displayContent.mExitingTokens.get(i).hasVisible = false;
+ }
- // Initialize state of exiting applications.
- for (i=mExitingAppTokens.size()-1; i>=0; i--) {
- mExitingAppTokens.get(i).hasVisible = false;
+ // Initialize state of exiting applications.
+ for (i=displayContent.mExitingAppTokens.size()-1; i>=0; i--) {
+ displayContent.mExitingAppTokens.get(i).hasVisible = false;
+ }
}
mInnerFields.mHoldScreen = null;
@@ -8438,10 +8407,10 @@
}
boolean focusDisplayed = false;
- boolean updateAllDrawn = false;
- DisplayContentsIterator iterator = new DisplayContentsIterator();
+ iterator = new DisplayContentsIterator();
while (iterator.hasNext()) {
+ boolean updateAllDrawn = false;
final DisplayContent displayContent = iterator.next();
WindowList windows = displayContent.getWindowList();
DisplayInfo displayInfo = displayContent.getDisplayInfo();
@@ -8685,10 +8654,10 @@
if (!mInnerFields.mDimming && mAnimator.isDimmingLocked(displayId)) {
stopDimmingLocked(displayId);
}
- }
- if (updateAllDrawn) {
- updateAllDrawnLocked();
+ if (updateAllDrawn) {
+ updateAllDrawnLocked(displayContent);
+ }
}
if (focusDisplayed) {
@@ -8835,30 +8804,35 @@
}
// Time to remove any exiting tokens?
- for (i=mExitingTokens.size()-1; i>=0; i--) {
- WindowToken token = mExitingTokens.get(i);
- if (!token.hasVisible) {
- mExitingTokens.remove(i);
- if (token.windowType == TYPE_WALLPAPER) {
- mWallpaperTokens.remove(token);
+ iterator = new DisplayContentsIterator();
+ while (iterator.hasNext()) {
+ final DisplayContent displayContent = iterator.next();
+ ArrayList<WindowToken> exitingTokens = displayContent.mExitingTokens;
+ for (i = exitingTokens.size() - 1; i >= 0; i--) {
+ WindowToken token = exitingTokens.get(i);
+ if (!token.hasVisible) {
+ exitingTokens.remove(i);
+ if (token.windowType == TYPE_WALLPAPER) {
+ mWallpaperTokens.remove(token);
+ }
}
}
- }
- // Time to remove any exiting applications?
- for (i=mExitingAppTokens.size()-1; i>=0; i--) {
- AppWindowToken token = mExitingAppTokens.get(i);
- if (!token.hasVisible && !mClosingApps.contains(token)) {
- // Make sure there is no animation running on this token,
- // so any windows associated with it will be removed as
- // soon as their animations are complete
- token.mAppAnimator.clearAnimation();
- token.mAppAnimator.animating = false;
- if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
- "performLayout: App token exiting now removed" + token);
- mAppTokens.remove(token);
- mAnimatingAppTokens.remove(token);
- mExitingAppTokens.remove(i);
+ // Time to remove any exiting applications?
+ AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+ for (i = exitingAppTokens.size() - 1; i >= 0; i--) {
+ AppWindowToken token = exitingAppTokens.get(i);
+ if (!token.hasVisible && !mClosingApps.contains(token)) {
+ // Make sure there is no animation running on this token,
+ // so any windows associated with it will be removed as
+ // soon as their animations are complete
+ token.mAppAnimator.clearAnimation();
+ token.mAppAnimator.animating = false;
+ if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+ "performLayout: App token exiting now removed" + token);
+ displayContent.removeAppToken(token);
+ exitingAppTokens.remove(i);
+ }
}
}
@@ -8878,7 +8852,7 @@
defaultDisplay.layoutNeeded = true;
}
- DisplayContentsIterator iterator = new DisplayContentsIterator();
+ iterator = new DisplayContentsIterator();
while (iterator.hasNext()) {
DisplayContent displayContent = iterator.next();
if (displayContent.pendingLayoutChanges != 0) {
@@ -9129,10 +9103,10 @@
// window list to make sure we haven't left any dangling surfaces
// around.
- AllWindowsIterator iterator = new AllWindowsIterator();
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
Slog.i(TAG, "Out of memory for surface! Looking for leaks...");
- while (iterator.hasNext()) {
- WindowState ws = iterator.next();
+ while (mTmpWindowsIterator.hasNext()) {
+ WindowState ws = mTmpWindowsIterator.next();
WindowStateAnimator wsa = ws.mWinAnimator;
if (wsa.mSurfaceControl != null) {
if (!mSessions.contains(wsa.mSession)) {
@@ -9165,9 +9139,9 @@
if (!leakedSurface) {
Slog.w(TAG, "No leaked surfaces; killing applicatons!");
SparseIntArray pidCandidates = new SparseIntArray();
- iterator = new AllWindowsIterator();
- while (iterator.hasNext()) {
- WindowState ws = iterator.next();
+ mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ WindowState ws = mTmpWindowsIterator.next();
if (mForceRemoves.contains(ws)) {
continue;
}
@@ -9293,8 +9267,19 @@
}
private WindowState findFocusedWindowLocked(DisplayContent displayContent) {
- int nextAppIndex = mAppTokens.size()-1;
- WindowToken nextApp = nextAppIndex >= 0 ? mAppTokens.get(nextAppIndex) : null;
+ final ArrayList<TaskList> tasks = displayContent.mTaskLists;
+ int taskNdx = tasks.size() - 1;
+ AppTokenList tokens = taskNdx >= 0 ? tasks.get(taskNdx).mAppTokens : null;
+ int tokenNdx = tokens != null ? tokens.size() - 1 : -1;
+ WindowToken nextApp = tokenNdx >= 0 ? tokens.get(tokenNdx) : null;
+ --tokenNdx;
+ if (tokenNdx < 0) {
+ --taskNdx;
+ if (taskNdx >= 0) {
+ tokens = tasks.get(taskNdx).mAppTokens;
+ tokenNdx = tokens.size() - 1;
+ }
+ }
final WindowList windows = displayContent.getWindowList();
for (int i = windows.size() - 1; i >= 0; i--) {
@@ -9320,18 +9305,25 @@
// through the app tokens until we find its app.
if (thisApp != null && nextApp != null && thisApp != nextApp
&& win.mAttrs.type != TYPE_APPLICATION_STARTING) {
- int origAppIndex = nextAppIndex;
- while (nextAppIndex > 0) {
- if (nextApp == mFocusedApp) {
- // Whoops, we are below the focused app... no focus
- // for you!
- if (localLOGV || DEBUG_FOCUS) Slog.v(
- TAG, "Reached focused app: " + mFocusedApp);
- return null;
+ final WindowToken origAppToken = nextApp;
+ final int origTaskNdx = taskNdx;
+ final int origTokenNdx = tokenNdx;
+ for ( ; taskNdx >= 0; --taskNdx) {
+ tokens = tasks.get(taskNdx).mAppTokens;
+ for ( ; tokenNdx >= 0; --tokenNdx) {
+ if (nextApp == mFocusedApp) {
+ // Whoops, we are below the focused app... no focus
+ // for you!
+ if (localLOGV || DEBUG_FOCUS) Slog.v(
+ TAG, "Reached focused app: " + mFocusedApp);
+ return null;
+ }
+ nextApp = tokens.get(tokenNdx);
+ if (nextApp == thisApp) {
+ break;
+ }
}
- nextAppIndex--;
- nextApp = mAppTokens.get(nextAppIndex);
- if (nextApp == thisApp) {
+ if (thisApp == nextApp) {
break;
}
}
@@ -9339,8 +9331,10 @@
// Uh oh, the app token doesn't exist! This shouldn't
// happen, but if it does we can get totally hosed...
// so restart at the original app.
- nextAppIndex = origAppIndex;
- nextApp = mAppTokens.get(nextAppIndex);
+ nextApp = origAppToken;
+ // return indices to same place.
+ taskNdx = origTaskNdx;
+ tokenNdx = origTokenNdx;
}
}
@@ -9710,15 +9704,6 @@
}
}
}
- if (mAppTokens.size() > 0) {
- pw.println();
- pw.println(" Application tokens in Z order:");
- for (int i=mAppTokens.size()-1; i>=0; i--) {
- pw.print(" App #"); pw.print(i);
- pw.print(' '); pw.print(mAppTokens.get(i)); pw.println(":");
- mAppTokens.get(i).dump(pw, " ");
- }
- }
if (mFinishedStarting.size() > 0) {
pw.println();
pw.println(" Finishing start of application tokens:");
@@ -9734,51 +9719,6 @@
}
}
}
- if (mExitingTokens.size() > 0) {
- pw.println();
- pw.println(" Exiting tokens:");
- for (int i=mExitingTokens.size()-1; i>=0; i--) {
- WindowToken token = mExitingTokens.get(i);
- pw.print(" Exiting #"); pw.print(i);
- pw.print(' '); pw.print(token);
- if (dumpAll) {
- pw.println(':');
- token.dump(pw, " ");
- } else {
- pw.println();
- }
- }
- }
- if (mExitingAppTokens.size() > 0) {
- pw.println();
- pw.println(" Exiting application tokens:");
- for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
- WindowToken token = mExitingAppTokens.get(i);
- pw.print(" Exiting App #"); pw.print(i);
- pw.print(' '); pw.print(token);
- if (dumpAll) {
- pw.println(':');
- token.dump(pw, " ");
- } else {
- pw.println();
- }
- }
- }
- if (mAppTransition.isRunning() && mAnimatingAppTokens.size() > 0) {
- pw.println();
- pw.println(" Application tokens during animation:");
- for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
- WindowToken token = mAnimatingAppTokens.get(i);
- pw.print(" App moving to bottom #"); pw.print(i);
- pw.print(' '); pw.print(token);
- if (dumpAll) {
- pw.println(':');
- token.dump(pw, " ");
- } else {
- pw.println();
- }
- }
- }
if (mOpeningApps.size() > 0 || mClosingApps.size() > 0) {
pw.println();
if (mOpeningApps.size() > 0) {
@@ -9823,9 +9763,9 @@
void dumpWindowsNoHeaderLocked(PrintWriter pw, boolean dumpAll,
ArrayList<WindowState> windows) {
int j = 0;
- final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(REVERSE_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
if (windows == null || windows.contains(w)) {
pw.print(" Window #"); pw.print(j++); pw.print(' ');
pw.print(w); pw.println(":");
@@ -10011,9 +9951,9 @@
WindowList windows = new WindowList();
if ("visible".equals(name)) {
synchronized(mWindowMap) {
- final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(REVERSE_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
if (w.mWinAnimator.mSurfaceShown) {
windows.add(w);
}
@@ -10028,9 +9968,9 @@
} catch (RuntimeException e) {
}
synchronized(mWindowMap) {
- final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- final WindowState w = iterator.next();
+ mTmpWindowsIterator.reset(REVERSE_ITERATOR);
+ while (mTmpWindowsIterator.hasNext()) {
+ final WindowState w = mTmpWindowsIterator.next();
if (name != null) {
if (w.mAttrs.getTitle().toString().contains(name)) {
windows.add(w);
@@ -10283,6 +10223,10 @@
class DisplayContentsIterator implements Iterator<DisplayContent> {
private int cur;
+ void reset() {
+ cur = 0;
+ }
+
@Override
public boolean hasNext() {
return cur < mDisplayContents.size();
@@ -10302,7 +10246,6 @@
}
}
- final static boolean REVERSE_ITERATOR = true;
class AllWindowsIterator implements Iterator<WindowState> {
private DisplayContent mDisplayContent;
private DisplayContentsIterator mDisplayContentsIterator;
@@ -10311,19 +10254,33 @@
private boolean mReverse;
AllWindowsIterator() {
- mDisplayContentsIterator = new DisplayContentsIterator();
- mDisplayContent = mDisplayContentsIterator.next();
- mWindowList = mDisplayContent.getWindowList();
+ this(false);
}
AllWindowsIterator(boolean reverse) {
- this();
+ mDisplayContentsIterator = new DisplayContentsIterator();
+ reset(reverse);
+ }
+
+ void reset(boolean reverse) {
mReverse = reverse;
- mWindowListIndex = reverse ? mWindowList.size() - 1 : 0;
+ mDisplayContentsIterator.reset();
+ if (mDisplayContentsIterator.hasNext()) {
+ mDisplayContent = mDisplayContentsIterator.next();
+ mWindowList = mDisplayContent.getWindowList();
+ mWindowListIndex = reverse ? mWindowList.size() - 1 : 0;
+ } else {
+ mDisplayContent = null;
+ mWindowList = null;
+ mWindowListIndex = 0;
+ }
}
@Override
public boolean hasNext() {
+ if (mDisplayContent == null) {
+ return false;
+ }
if (mReverse) {
return mWindowListIndex >= 0;
}
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index a600623..517c4e4 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -52,6 +52,12 @@
import java.util.ArrayList;
class WindowList extends ArrayList<WindowState> {
+ WindowList() {
+ super();
+ }
+ WindowList(WindowList windows) {
+ super(windows);
+ }
}
/**
@@ -1086,7 +1092,7 @@
return true;
}
- public boolean setAppOpVisibilityLw(boolean state) {
+ public void setAppOpVisibilityLw(boolean state) {
if (mAppOpVisibility != state) {
mAppOpVisibility = state;
if (state) {
@@ -1096,13 +1102,11 @@
// ops modifies they should only be hidden by policy due to the
// lock screen, and the user won't be changing this if locked.
// Plus it will quickly be fixed the next time we do a layout.
- showLw(true, false);
+ showLw(true, true);
} else {
- hideLw(true, false);
+ hideLw(true, true);
}
- return true;
}
- return false;
}
@Override
diff --git a/services/java/com/android/server/wm/WindowToken.java b/services/java/com/android/server/wm/WindowToken.java
index bd0ace8..2267123 100644
--- a/services/java/com/android/server/wm/WindowToken.java
+++ b/services/java/com/android/server/wm/WindowToken.java
@@ -19,7 +19,6 @@
import android.os.IBinder;
import java.io.PrintWriter;
-import java.util.ArrayList;
/**
* Container of a set of related windows in the window manager. Often this
diff --git a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
index 746ac06..03871f6 100644
--- a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
+++ b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
@@ -222,37 +222,7 @@
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
-
- try {
- mWm.moveAppToken(0, null);
- fail("IWindowManager.moveAppToken did not throw SecurityException as"
- + " expected");
- } catch (SecurityException e) {
- // expected
- } catch (RemoteException e) {
- fail("Unexpected remote exception");
- }
-
- try {
- mWm.moveAppTokensToTop(null);
- fail("IWindowManager.moveAppTokensToTop did not throw SecurityException as"
- + " expected");
- } catch (SecurityException e) {
- // expected
- } catch (RemoteException e) {
- fail("Unexpected remote exception");
- }
-
- try {
- mWm.moveAppTokensToBottom(null);
- fail("IWindowManager.moveAppTokensToBottom did not throw SecurityException as"
- + " expected");
- } catch (SecurityException e) {
- // expected
- } catch (RemoteException e) {
- fail("Unexpected remote exception");
- }
- }
+ }
@SmallTest
public void testDISABLE_KEYGUARD() {
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index 59ae1a1..278413e 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -210,24 +210,6 @@
}
@Override
- public void moveAppToken(int arg0, IBinder arg1) throws RemoteException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void moveAppTokensToBottom(List<IBinder> arg0) throws RemoteException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void moveAppTokensToTop(List<IBinder> arg0) throws RemoteException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1)
throws RemoteException {
// TODO Auto-generated method stub