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

Commit 7f35036c authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Added a placeholder home activity for system user"

parents cf8c7746 c40e244b
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package com.android.internal.app;

import android.app.Activity;

/**
 * Placeholder home activity, which is always installed on the system user. At least one home
 * activity must be present and enabled in order for the system to boot.
 */
public class SystemUserHomeActivity extends Activity {
}
+11 −0
Original line number Diff line number Diff line
@@ -2841,6 +2841,17 @@
                android:process=":ui">
        </activity>

        <activity android:name="com.android.internal.app.SystemUserHomeActivity"
                  android:enabled="false"
                  android:process=":ui"
                  android:systemUserOnly="true"
                  android:theme="@style/Theme.Translucent.NoTitleBar">
            <intent-filter android:priority="-100">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.HOME" />
            </intent-filter>
        </activity>

        <receiver android:name="com.android.server.BootReceiver"
                android:systemUserOnly="true">
            <intent-filter android:priority="1000">
+12 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.internal.app.IAppOpsService;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.app.ProcessMap;
import com.android.internal.app.ProcessStats;
import com.android.internal.app.SystemUserHomeActivity;
import com.android.internal.os.BackgroundThread;
import com.android.internal.os.BatteryStatsImpl;
import com.android.internal.os.IResultReceiver;
@@ -12269,6 +12270,17 @@ public final class ActivityManagerService extends ActivityManagerNative
            // Start up initial activity.
            mBooting = true;
            // Enable home activity for system user, so that the system can always boot
            if (UserManager.isSplitSystemUser()) {
                ComponentName cName = new ComponentName(mContext, SystemUserHomeActivity.class);
                try {
                    AppGlobals.getPackageManager().setComponentEnabledSetting(cName,
                            PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0,
                            UserHandle.USER_SYSTEM);
                } catch (RemoteException e) {
                    e.rethrowAsRuntimeException();
                }
            }
            startHomeActivityLocked(currentUserId, "systemReady");
            try {