diff options
Diffstat (limited to 'packages')
9 files changed, 56 insertions, 15 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java index cf56cba..731a09c 100644 --- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java @@ -80,7 +80,7 @@ import libcore.io.StructStatFs; */ public class DefaultContainerService extends IntentService { private static final String TAG = "DefContainer"; - private static final boolean localLOGV = true; + private static final boolean localLOGV = false; private static final String LIB_DIR_NAME = "lib"; diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index b649b43..4e5fc37 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -21,6 +21,7 @@ import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; +import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.res.XmlResourceParser; import android.database.Cursor; @@ -31,6 +32,8 @@ import android.media.AudioManager; import android.media.AudioService; import android.net.ConnectivityManager; import android.os.Environment; +import android.os.RemoteException; +import android.os.ServiceManager; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; @@ -171,7 +174,15 @@ public class DatabaseHelper extends SQLiteOpenHelper { db.execSQL("CREATE INDEX bookmarksIndex2 ON bookmarks (shortcut);"); // Populate bookmarks table with initial bookmarks - loadBookmarks(db); + boolean onlyCore = false; + try { + onlyCore = IPackageManager.Stub.asInterface(ServiceManager.getService( + "package")).isOnlyCoreApps(); + } catch (RemoteException e) { + } + if (!onlyCore) { + loadBookmarks(db); + } // Load initial volume levels into DB loadVolumeLevels(db); diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 8086bbc..f18338a 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -455,8 +455,8 @@ public class SettingsProvider extends ContentProvider { cache.setFullyMatchesDisk(false); Log.d(TAG, "row count exceeds max cache entries for table " + table); } - Log.d(TAG, "cache for settings table '" + table + "' rows=" + rows + "; fullycached=" + - cache.fullyMatchesDisk()); + if (LOCAL_LOGV) Log.d(TAG, "cache for settings table '" + table + + "' rows=" + rows + "; fullycached=" + cache.fullyMatchesDisk()); } } finally { c.close(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 248a516..2bad353 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -31,7 +31,7 @@ import com.android.systemui.statusbar.GestureRecorder; public class NotificationPanelView extends PanelView { Drawable mHandleBar; - float mHandleBarHeight; + int mHandleBarHeight; View mHandleView; int mFingers; PhoneStatusBar mStatusBar; @@ -51,7 +51,7 @@ public class NotificationPanelView extends PanelView { Resources resources = getContext().getResources(); mHandleBar = resources.getDrawable(R.drawable.status_bar_close); - mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height); + mHandleBarHeight = resources.getDimensionPixelSize(R.dimen.close_handle_height); mHandleView = findViewById(R.id.handle); setContentDescription(resources.getString(R.string.accessibility_desc_notification_shade)); 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 7371ce2..30af333 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -298,7 +298,7 @@ public class PhoneStatusBar extends BaseStatusBar { if (MULTIUSER_DEBUG) Slog.d(TAG, String.format("User setup changed: " + "selfChange=%s userSetup=%s mUserSetup=%s", selfChange, userSetup, mUserSetup)); - if (mSettingsButton != null && !mHasSettingsPanel) { + if (mSettingsButton != null && mHasFlipSettings) { mSettingsButton.setVisibility(userSetup ? View.VISIBLE : View.INVISIBLE); } if (mSettingsPanel != null) { @@ -1488,6 +1488,9 @@ public class PhoneStatusBar extends BaseStatusBar { return; } + // Settings are not available in setup + if (!mUserSetup) return; + if (mHasFlipSettings) { mNotificationPanel.expand(); if (mFlipSettingsView.getVisibility() != View.VISIBLE) { @@ -1501,6 +1504,9 @@ public class PhoneStatusBar extends BaseStatusBar { } public void switchToSettings() { + // Settings are not available in setup + if (!mUserSetup) return; + mFlipSettingsView.setScaleX(1f); mFlipSettingsView.setVisibility(View.VISIBLE); mSettingsButton.setVisibility(View.GONE); @@ -1512,6 +1518,9 @@ public class PhoneStatusBar extends BaseStatusBar { } public void flipToSettings() { + // Settings are not available in setup + if (!mUserSetup) return; + if (mFlipSettingsViewAnim != null) mFlipSettingsViewAnim.cancel(); if (mScrollViewAnim != null) mScrollViewAnim.cancel(); if (mSettingsButtonAnim != null) mSettingsButtonAnim.cancel(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java index a58eb22..bbb8455 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java @@ -41,7 +41,7 @@ public class SettingsPanelView extends PanelView { private QuickSettingsContainerView mQSContainer; Drawable mHandleBar; - float mHandleBarHeight; + int mHandleBarHeight; View mHandleView; public SettingsPanelView(Context context, AttributeSet attrs) { @@ -56,7 +56,7 @@ public class SettingsPanelView extends PanelView { Resources resources = getContext().getResources(); mHandleBar = resources.getDrawable(R.drawable.status_bar_close); - mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height); + mHandleBarHeight = resources.getDimensionPixelSize(R.dimen.close_handle_height); mHandleView = findViewById(R.id.handle); setContentDescription(resources.getString(R.string.accessibility_desc_quick_settings)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java index 7f9bcac..716341f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java @@ -68,9 +68,20 @@ public class BatteryController extends BroadcastReceiver { final String action = intent.getAction(); if (action.equals(Intent.ACTION_BATTERY_CHANGED)) { final int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); - final boolean plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0; - final int icon = plugged ? R.drawable.stat_sys_battery_charge + final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, + BatteryManager.BATTERY_STATUS_UNKNOWN); + + boolean plugged = false; + switch (status) { + case BatteryManager.BATTERY_STATUS_CHARGING: + case BatteryManager.BATTERY_STATUS_FULL: + plugged = true; + break; + } + + final int icon = plugged ? R.drawable.stat_sys_battery_charge : R.drawable.stat_sys_battery; + int N = mIconViews.size(); for (int i=0; i<N; i++) { ImageView v = mIconViews.get(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 8f2a4eb..e41de47 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -40,6 +40,7 @@ import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Locale; import java.util.TimeZone; import com.android.internal.R; @@ -52,6 +53,7 @@ public class Clock extends TextView { private Calendar mCalendar; private String mClockFormatString; private SimpleDateFormat mClockFormat; + private Locale mLocale; private static final int AM_PM_STYLE_NORMAL = 0; private static final int AM_PM_STYLE_SMALL = 1; @@ -117,6 +119,12 @@ public class Clock extends TextView { if (mClockFormat != null) { mClockFormat.setTimeZone(mCalendar.getTimeZone()); } + } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) { + final Locale newLocale = getResources().getConfiguration().locale; + if (! newLocale.equals(mLocale)) { + mLocale = newLocale; + mClockFormatString = ""; // force refresh + } } updateClock(); } diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index 91fc67a..06696fe 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -33,6 +33,7 @@ import android.util.Slog; public class StorageNotification extends StorageEventListener { private static final String TAG = "StorageNotification"; + private static final boolean DEBUG = false; private static final boolean POP_UMS_ACTIVITY_ON_CONNECT = true; @@ -70,8 +71,8 @@ public class StorageNotification extends StorageEventListener { mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE); final boolean connected = mStorageManager.isUsbMassStorageConnected(); - Slog.d(TAG, String.format( "Startup with UMS connection %s (media state %s)", mUmsAvailable, - Environment.getExternalStorageState())); + if (DEBUG) Slog.d(TAG, String.format( "Startup with UMS connection %s (media state %s)", + mUmsAvailable, Environment.getExternalStorageState())); HandlerThread thr = new HandlerThread("SystemUI StorageNotification"); thr.start(); @@ -101,7 +102,8 @@ public class StorageNotification extends StorageEventListener { */ String st = Environment.getExternalStorageState(); - Slog.i(TAG, String.format("UMS connection changed to %s (media state %s)", connected, st)); + if (DEBUG) Slog.i(TAG, String.format("UMS connection changed to %s (media state %s)", + connected, st)); if (connected && (st.equals( Environment.MEDIA_REMOVED) || st.equals(Environment.MEDIA_CHECKING))) { @@ -127,7 +129,7 @@ public class StorageNotification extends StorageEventListener { } private void onStorageStateChangedAsync(String path, String oldState, String newState) { - Slog.i(TAG, String.format( + if (DEBUG) Slog.i(TAG, String.format( "Media {%s} state changed from {%s} -> {%s}", path, oldState, newState)); if (newState.equals(Environment.MEDIA_SHARED)) { /* |
