diff options
author | Jason Monk <jmonk@google.com> | 2015-06-18 14:07:26 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-06-18 15:24:43 -0400 |
commit | 259e06f58225e70716d3370d123e8dca830206a7 (patch) | |
tree | d7e15f62e722592181d83f12e7c3c88f3e20a3dc /packages | |
parent | 8c6750ff0eb2d07039336bf25dc87f10464c42db (diff) | |
download | frameworks_base-259e06f58225e70716d3370d123e8dca830206a7.zip frameworks_base-259e06f58225e70716d3370d123e8dca830206a7.tar.gz frameworks_base-259e06f58225e70716d3370d123e8dca830206a7.tar.bz2 |
Fix some demo mode issues
Bug: 21919885
Change-Id: If79d76a2954b62e290691b1c2338d175fdbbffc5
Diffstat (limited to 'packages')
3 files changed, 12 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java index 26d1c86..fcdd4b7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java @@ -124,6 +124,9 @@ public class DemoStatusIcons extends LinearLayout implements DemoMode { private void updateSlot(String slot, String iconPkg, int iconId) { if (!mDemoMode) return; + if (iconPkg == null) { + iconPkg = mContext.getPackageName(); + } int removeIndex = -1; for (int i = 0; i < getChildCount(); i++) { StatusBarIconView v = (StatusBarIconView) getChildAt(i); @@ -143,10 +146,10 @@ public class DemoStatusIcons extends LinearLayout implements DemoMode { if (iconId == 0) { if (removeIndex != -1) { removeViewAt(removeIndex); - return; } + return; } - StatusBarIcon icon = new StatusBarIcon(iconPkg, UserHandle.CURRENT, iconId, 0, 0, "Demo"); + StatusBarIcon icon = new StatusBarIcon(iconPkg, UserHandle.OWNER, iconId, 0, 0, "Demo"); StatusBarIconView v = new StatusBarIconView(getContext(), null, null); v.setTag(slot); v.set(icon); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 18b5820..1ba87da 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -408,7 +408,7 @@ public class NetworkControllerImpl extends BroadcastReceiver boolean hasNoSims = mHasMobileDataFeature && mMobileSignalControllers.size() == 0; if (hasNoSims != mHasNoSims) { mHasNoSims = hasNoSims; - notifyListeners(); + mCallbackHandler.setNoSims(mHasNoSims); } } @@ -660,8 +660,8 @@ public class NetworkControllerImpl extends BroadcastReceiver } String nosim = args.getString("nosim"); if (nosim != null) { - boolean show = nosim.equals("show"); - mCallbackHandler.setNoSims(show); + mHasNoSims = nosim.equals("show"); + mCallbackHandler.setNoSims(mHasNoSims); } String mobile = args.getString("mobile"); if (mobile != null) { diff --git a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java index d9f0598..ca6aaeb 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java @@ -131,11 +131,14 @@ public class DemoModeFragment extends PreferenceFragment implements OnPreference intent.putExtra("mobile", "show"); intent.putExtra("sims", "1"); intent.putExtra("nosim", "false"); - intent.putExtra("fully", "true"); intent.putExtra("level", "4"); intent.putExtra("datatypel", ""); getContext().sendBroadcast(intent); + // Need to send this after so that the sim controller already exists. + intent.putExtra("fully", "true"); + getContext().sendBroadcast(intent); + intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_BATTERY); intent.putExtra("level", "100"); intent.putExtra("plugged", "false"); |