Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea44079e authored by Jason Monk's avatar Jason Monk Committed by Android Git Automerger
Browse files

am aa2a1966: Merge "Fix some demo mode issues" into mnc-dev

* commit 'aa2a1966':
  Fix some demo mode issues
parents 34496264 aa2a1966
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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) {
+4 −1
Original line number Diff line number Diff line
@@ -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");