summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java20
6 files changed, 64 insertions, 29 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index b0939de..2594167 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 78;
+ private static final int DATABASE_VERSION = 79;
private Context mContext;
@@ -1054,6 +1054,23 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 78;
}
+ if (upgradeVersion == 78) {
+ // The JavaScript based screen-reader URL changes in JellyBean.
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO secure(name,value)"
+ + " VALUES(?,?);");
+ loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_SCREEN_READER_URL,
+ R.string.def_accessibility_screen_reader_url);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ upgradeVersion = 79;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index a2a03ea..04cff96 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -65,6 +65,7 @@ import com.android.systemui.recent.RecentsPanelView;
import com.android.systemui.recent.RecentTasksLoader;
import com.android.systemui.recent.TaskDescription;
import com.android.systemui.statusbar.CommandQueue;
+import com.android.systemui.statusbar.NotificationData.Entry;
import com.android.systemui.statusbar.policy.NotificationRowLayout;
import com.android.systemui.statusbar.tablet.StatusBarPanel;
@@ -935,4 +936,21 @@ public abstract class BaseStatusBar extends SystemUI implements
}
}
}
+
+ // Q: What kinds of notifications should show during setup?
+ // A: Almost none! Only things coming from the system (package is "android") that also
+ // have special "kind" tags marking them as relevant for setup (see below).
+ protected boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) {
+ if ("android".equals(sbn.pkg)) {
+ if (sbn.notification.kind != null) {
+ for (String aKind : sbn.notification.kind) {
+ // IME switcher, created by InputMethodManagerService
+ if ("android.system.imeswitcher".equals(aKind)) return true;
+ // OTA availability & errors, created by SystemUpdateService
+ if ("android.system.update".equals(aKind)) return true;
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 3c19ad2..eff6061 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -821,23 +821,6 @@ public class PhoneStatusBar extends BaseStatusBar {
R.integer.config_show_search_delay);
}
- // Q: What kinds of notifications should show during setup?
- // A: Almost none! Only things coming from the system (package is "android") that also
- // have special "kind" tags marking them as relevant for setup (see below).
- private boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) {
- if ("android".equals(sbn.pkg)) {
- if (sbn.notification.kind != null) {
- for (String aKind : sbn.notification.kind) {
- // IME switcher, created by InputMethodManagerService
- if ("android.system.imeswitcher".equals(aKind)) return true;
- // OTA availability & errors, created by SystemUpdateService
- if ("android.system.update".equals(aKind)) return true;
- }
- }
- }
- return false;
- }
-
private void loadNotificationShade() {
if (mPile == null) return;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index af0f9d3..fdbfb65 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -217,7 +217,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
*/
public void onClick(View v) {
- if (v == mTitleArea) {
+ if (mSettingsButton.isEnabled() && v == mTitleArea) {
swapPanels();
}
}
@@ -280,7 +280,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
public void updatePanelModeButtons() {
final boolean settingsVisible = (mSettingsView != null);
- mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.GONE);
+ mSettingsButton.setVisibility(!settingsVisible && mSettingsButton.isEnabled() ? View.VISIBLE : View.GONE);
mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.GONE);
}
@@ -421,5 +421,12 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
super.onTouchEvent(ev);
return handled;
}
+
+ public void setSettingsEnabled(boolean settingsEnabled) {
+ if (mSettingsButton != null) {
+ mSettingsButton.setEnabled(settingsEnabled);
+ mSettingsButton.setVisibility(settingsEnabled ? View.VISIBLE : View.GONE);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
index 00cf3c5..d180ab9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
@@ -32,7 +32,7 @@ import com.android.systemui.R;
public class NotificationPanelTitle extends RelativeLayout implements View.OnClickListener {
private NotificationPanel mPanel;
private ArrayList<View> buttons;
- private View mNotificationsButton;
+ private View mSettingsButton;
public NotificationPanelTitle(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -47,7 +47,7 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public void onFinishInflate() {
super.onFinishInflate();
- buttons.add(findViewById(R.id.settings_button));
+ buttons.add(mSettingsButton = findViewById(R.id.settings_button));
buttons.add(findViewById(R.id.notification_button));
}
@@ -63,6 +63,8 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public boolean onTouchEvent(MotionEvent e) {
+ if (!mSettingsButton.isEnabled())
+ return false;
switch (e.getAction()) {
case MotionEvent.ACTION_DOWN:
setPressed(true);
@@ -88,7 +90,7 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public void onClick(View v) {
- if (v == this) {
+ if (mSettingsButton.isEnabled() && v == this) {
mPanel.swapPanels();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 9b46af8..29d8c98 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -1235,7 +1235,7 @@ public class TabletStatusBar extends BaseStatusBar implements
@Override
protected void setAreThereNotifications() {
if (mNotificationPanel != null) {
- mNotificationPanel.setClearable(mNotificationData.hasClearableItems());
+ mNotificationPanel.setClearable(isDeviceProvisioned() && mNotificationData.hasClearableItems());
}
}
@@ -1533,10 +1533,13 @@ public class TabletStatusBar extends BaseStatusBar implements
if (mInputMethodSwitchButton.getVisibility() != View.GONE) maxNotificationIconsCount --;
if (mCompatModeButton.getVisibility() != View.GONE) maxNotificationIconsCount --;
+ final boolean provisioned = isDeviceProvisioned();
+ // If the device hasn't been through Setup, we only show system notifications
for (int i=0; toShow.size()< maxNotificationIconsCount; i++) {
if (i >= N) break;
Entry ent = mNotificationData.get(N-i-1);
- if (ent.notification.score >= HIDE_ICONS_BELOW_SCORE) {
+ if ((provisioned && ent.notification.score >= HIDE_ICONS_BELOW_SCORE)
+ || showNotificationEvenIfUnprovisioned(ent.notification)) {
toShow.add(ent.icon);
}
}
@@ -1567,9 +1570,13 @@ public class TabletStatusBar extends BaseStatusBar implements
ArrayList<View> toShow = new ArrayList<View>();
+ final boolean provisioned = isDeviceProvisioned();
+ // If the device hasn't been through Setup, we only show system notifications
for (int i=0; i<N; i++) {
- View row = mNotificationData.get(N-i-1).row;
- toShow.add(row);
+ Entry ent = mNotificationData.get(N-i-1);
+ if (provisioned || showNotificationEvenIfUnprovisioned(ent.notification)) {
+ toShow.add(ent.row);
+ }
}
ArrayList<View> toRemove = new ArrayList<View>();
@@ -1588,11 +1595,12 @@ public class TabletStatusBar extends BaseStatusBar implements
View v = toShow.get(i);
if (v.getParent() == null) {
// the notification panel has the most important things at the bottom
- mPile.addView(v, N-1-i);
+ mPile.addView(v, Math.min(toShow.size()-1-i, mPile.getChildCount()));
}
}
- mNotificationPanel.setNotificationCount(N);
+ mNotificationPanel.setNotificationCount(toShow.size());
+ mNotificationPanel.setSettingsEnabled(isDeviceProvisioned());
}
@Override