summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java18
12 files changed, 48 insertions, 27 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index e66934e..fae0643 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -773,6 +773,11 @@ public class KeyguardViewMediator extends SystemUI {
synchronized (this) {
if (DEBUG) Log.d(TAG, "setKeyguardEnabled(" + enabled + ")");
+ if (isSecure()) {
+ Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard");
+ return;
+ }
+
mExternallyEnabled = enabled;
if (!enabled && mShowing) {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index 330333a..cf5d3a6 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -23,7 +23,6 @@ import android.database.DataSetObserver;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
-import android.util.FloatMath;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@@ -368,7 +367,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
View child = mAdapter.createView(mLinearLayout);
child.measure(childWidthMeasureSpec, childheightMeasureSpec);
mNumItemsInOneScreenful =
- (int) FloatMath.ceil(dm.widthPixels / (float) child.getMeasuredWidth());
+ (int) Math.ceil(dm.widthPixels / (double) child.getMeasuredWidth());
addToRecycledViews(child);
for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
index 1e247be..d518f74 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
@@ -23,7 +23,6 @@ import android.database.DataSetObserver;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
-import android.util.FloatMath;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@@ -378,7 +377,7 @@ public class RecentsVerticalScrollView extends ScrollView
View child = mAdapter.createView(mLinearLayout);
child.measure(childWidthMeasureSpec, childheightMeasureSpec);
mNumItemsInOneScreenful =
- (int) FloatMath.ceil(dm.heightPixels / (float) child.getMeasuredHeight());
+ (int) Math.ceil(dm.heightPixels / (double) child.getMeasuredHeight());
addToRecycledViews(child);
for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 910a57e..2ddab48 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -611,13 +611,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Starts the recents activity */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) {
- RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
- RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
-
if (sInstanceLoadPlan == null) {
// Create a new load plan if onPreloadRecents() was never triggered
+ RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
sInstanceLoadPlan = loader.createLoadPlan(mContext);
}
+ RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
loader.preloadTasks(sInstanceLoadPlan, isTopTaskHome);
TaskStack stack = sInstanceLoadPlan.getTaskStack();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index cb1baeb..7422e36 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -362,11 +362,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // For the non-primary user, ensure that the SystemServicesProxy and configuration is
- // initialized
+ // For the non-primary user, ensure that the SystemSericesProxy is initialized
RecentsTaskLoader.initialize(this);
- SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
- mConfig = RecentsConfiguration.reinitialize(this, ssp);
+
+ // Initialize the loader and the configuration
+ mConfig = RecentsConfiguration.reinitialize(this,
+ RecentsTaskLoader.getInstance().getSystemServicesProxy());
// Initialize the widget host (the host id is static and does not change)
mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId);
@@ -421,6 +422,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
super.onNewIntent(intent);
setIntent(intent);
+ // Reinitialize the configuration
+ RecentsConfiguration.reinitialize(this, RecentsTaskLoader.getInstance().getSystemServicesProxy());
+
// Clear any debug rects
if (mDebugOverlay != null) {
mDebugOverlay.clear();
@@ -446,12 +450,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Update the recent tasks
updateRecentsTasks(getIntent());
-
- // If this is a new instance from a configuration change, then we have to manually trigger
- // the enter animation state
- if (mConfig.launchedHasConfigurationChanged) {
- onEnterAnimationTriggered();
- }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
index 81f0cef..255d642 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
@@ -252,8 +252,6 @@ public class TaskStack {
if (group.getTaskCount() == 0) {
removeGroup(group);
}
- // Update the lock-to-app state
- t.lockToThisTask = false;
if (mCb != null) {
// Notify that a task has been removed
mCb.onStackTaskRemoved(this, t, null);
@@ -482,4 +480,4 @@ public class TaskStack {
}
return str;
}
-}
+} \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 427ffe5..ee79242 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -542,7 +542,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
loader.deleteTaskData(t, false);
// Remove the old task from activity manager
- loader.getSystemServicesProxy().removeTask(t.key.id);
+ RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java
index cbdd138..49693f5fe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java
@@ -37,7 +37,7 @@ public interface BluetoothController {
void onBluetoothPairedDevicesChanged();
}
- public static final class PairedDevice {
+ public static final class PairedDevice implements Comparable<PairedDevice> {
public static int STATE_DISCONNECTED = 0;
public static int STATE_CONNECTING = 1;
public static int STATE_CONNECTED = 2;
@@ -55,5 +55,9 @@ public interface BluetoothController {
if (state == STATE_DISCONNECTING) return "STATE_DISCONNECTING";
return "UNKNOWN";
}
+
+ public int compareTo(PairedDevice another) {
+ return name.compareTo(another.name);
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 81e1e45..894f82a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -45,7 +45,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.ParcelUuid;
import android.util.ArrayMap;
-import android.util.ArraySet;
import android.util.Log;
import android.util.SparseArray;
@@ -55,6 +54,7 @@ import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Set;
+import java.util.TreeSet;
public class BluetoothControllerImpl implements BluetoothController {
private static final String TAG = "BluetoothController";
@@ -194,8 +194,8 @@ public class BluetoothControllerImpl implements BluetoothController {
}
@Override
- public ArraySet<PairedDevice> getPairedDevices() {
- final ArraySet<PairedDevice> rt = new ArraySet<>();
+ public Set<PairedDevice> getPairedDevices() {
+ final Set<PairedDevice> rt = new TreeSet<>();
for (int i = 0; i < mDeviceInfo.size(); i++) {
final BluetoothDevice device = mDeviceInfo.keyAt(i);
final DeviceInfo info = mDeviceInfo.valueAt(i);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index 779ff52..04c626b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -152,7 +152,7 @@ public class Clock extends TextView implements DemoMode {
final char MAGIC2 = '\uEF01';
SimpleDateFormat sdf;
- String format = is24 ? d.timeFormat24 : d.timeFormat12;
+ String format = is24 ? d.timeFormat_Hm : d.timeFormat_hm;
if (!format.equals(mClockFormatString)) {
/*
* Search for an unquoted "a" in the format string, so we can
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
index 2fbb812..f0dd943 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
@@ -190,7 +190,8 @@ public class SecurityControllerImpl implements SecurityController {
NetworkCapabilities networkCapabilities =
mConnectivityManager.getNetworkCapabilities(network);
if (DEBUG) Log.d(TAG, "onAvailable " + network.netId + " : " + networkCapabilities);
- if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
+ if (networkCapabilities != null &&
+ networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
setCurrentNetid(network.netId);
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index dce5c37..f804736 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -28,6 +28,7 @@ import android.os.HandlerThread;
import android.os.UserHandle;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
+import android.os.storage.StorageVolume;
import android.provider.Settings;
import android.util.Log;
@@ -198,6 +199,8 @@ public class StorageNotification extends SystemUI {
*/
Intent intent = new Intent();
intent.setClass(mContext, com.android.internal.app.ExternalMediaFormatActivity.class);
+ intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME,
+ getVolumeByPath(mStorageManager.getVolumeList(), path));
PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
setMediaStorageNotification(
@@ -212,6 +215,8 @@ public class StorageNotification extends SystemUI {
*/
Intent intent = new Intent();
intent.setClass(mContext, com.android.internal.app.ExternalMediaFormatActivity.class);
+ intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME,
+ getVolumeByPath(mStorageManager.getVolumeList(), path));
PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
setMediaStorageNotification(
@@ -247,6 +252,19 @@ public class StorageNotification extends SystemUI {
}
/**
+ * Get the corresponding StorageVolume object for a specific path.
+ */
+ private final StorageVolume getVolumeByPath(StorageVolume[] volumes, String path) {
+ for (StorageVolume volume : volumes) {
+ if (volume.getPath().equals(path)) {
+ return volume;
+ }
+ }
+ Log.w(TAG, "No storage found");
+ return null;
+ }
+
+ /**
* Update the state of the USB mass storage notification
*/
void updateUsbMassStorageNotification(boolean available) {