Loading api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -38899,6 +38899,17 @@ visibility="public" > </field> <field name="EXTRA_PHYSICAL_DOCK_STATE" type="java.lang.String" transient="false" volatile="false" value=""android.intent.extra.PHYSICAL_DOCK_STATE"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_REMOTE_INTENT_TOKEN" type="java.lang.String" transient="false" core/java/android/content/Intent.java +22 −5 Original line number Diff line number Diff line Loading @@ -1815,11 +1815,18 @@ public class Intent implements Parcelable, Cloneable { /** * Broadcast Action: A sticky broadcast indicating the phone was docked * or undocked. Includes the extra * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. It also * includes the boolean extra field {@link #EXTRA_CAR_MODE_ENABLED}, indicating * the state of the car mode. * This is intended for monitoring the current dock state. * or undocked. * * <p>The intent will have the following extra values: * <ul> * <li><em>{@link #EXTRA_DOCK_STATE}</em> - the current dock * state, which depends on the state of the car mode.</li> * <li><em>{@link #EXTRA_PHYSICAL_DOCK_STATE}</em> - the physical dock * state.</li> * <li><em>{@link #EXTRA_CAR_MODE_ENABLED}</em> - a boolean indicating the * state of the car mode.</li> * </ul> * <p>This is intended for monitoring the current dock state. * To launch an activity from a dock state change, use {@link #CATEGORY_CAR_DOCK} * or {@link #CATEGORY_DESK_DOCK} instead. */ Loading Loading @@ -2153,6 +2160,16 @@ public class Intent implements Parcelable, Cloneable { */ public static final int EXTRA_DOCK_STATE_CAR = 2; /** * Used as an int extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} * intents to request the physical dock state. Possible values are * {@link android.content.Intent#EXTRA_DOCK_STATE_UNDOCKED}, * {@link android.content.Intent#EXTRA_DOCK_STATE_DESK}, or * {@link android.content.Intent#EXTRA_DOCK_STATE_CAR}. */ public static final String EXTRA_PHYSICAL_DOCK_STATE = "android.intent.extra.PHYSICAL_DOCK_STATE"; /** * Used as an boolean extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} * intents to indicate that the car mode is enabled or not. Loading core/java/com/android/internal/app/DisableCarModeActivity.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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; import android.app.IUiModeManager; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; public class DisableCarModeActivity extends Activity { private static final String TAG = "DisableCarModeActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { IUiModeManager uiModeManager = IUiModeManager.Stub.asInterface( ServiceManager.getService("uimode")); uiModeManager.disableCarMode(); } catch (RemoteException e) { Log.e(TAG, "Failed to disable car mode", e); } finish(); } } core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1252,6 +1252,10 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="com.android.internal.app.DisableCarModeActivity" android:theme="@style/Theme.NoDisplay" android:excludeFromRecents="true"> </activity> <activity android:name="com.android.internal.app.RingtonePickerActivity" android:theme="@style/Theme.Dialog.Alert" android:excludeFromRecents="true" Loading core/res/res/drawable-hdpi/stat_notify_car_mode.png 0 → 100644 +1.64 KiB Loading image diff... Loading
api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -38899,6 +38899,17 @@ visibility="public" > </field> <field name="EXTRA_PHYSICAL_DOCK_STATE" type="java.lang.String" transient="false" volatile="false" value=""android.intent.extra.PHYSICAL_DOCK_STATE"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="EXTRA_REMOTE_INTENT_TOKEN" type="java.lang.String" transient="false"
core/java/android/content/Intent.java +22 −5 Original line number Diff line number Diff line Loading @@ -1815,11 +1815,18 @@ public class Intent implements Parcelable, Cloneable { /** * Broadcast Action: A sticky broadcast indicating the phone was docked * or undocked. Includes the extra * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. It also * includes the boolean extra field {@link #EXTRA_CAR_MODE_ENABLED}, indicating * the state of the car mode. * This is intended for monitoring the current dock state. * or undocked. * * <p>The intent will have the following extra values: * <ul> * <li><em>{@link #EXTRA_DOCK_STATE}</em> - the current dock * state, which depends on the state of the car mode.</li> * <li><em>{@link #EXTRA_PHYSICAL_DOCK_STATE}</em> - the physical dock * state.</li> * <li><em>{@link #EXTRA_CAR_MODE_ENABLED}</em> - a boolean indicating the * state of the car mode.</li> * </ul> * <p>This is intended for monitoring the current dock state. * To launch an activity from a dock state change, use {@link #CATEGORY_CAR_DOCK} * or {@link #CATEGORY_DESK_DOCK} instead. */ Loading Loading @@ -2153,6 +2160,16 @@ public class Intent implements Parcelable, Cloneable { */ public static final int EXTRA_DOCK_STATE_CAR = 2; /** * Used as an int extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} * intents to request the physical dock state. Possible values are * {@link android.content.Intent#EXTRA_DOCK_STATE_UNDOCKED}, * {@link android.content.Intent#EXTRA_DOCK_STATE_DESK}, or * {@link android.content.Intent#EXTRA_DOCK_STATE_CAR}. */ public static final String EXTRA_PHYSICAL_DOCK_STATE = "android.intent.extra.PHYSICAL_DOCK_STATE"; /** * Used as an boolean extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} * intents to indicate that the car mode is enabled or not. Loading
core/java/com/android/internal/app/DisableCarModeActivity.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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; import android.app.IUiModeManager; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; public class DisableCarModeActivity extends Activity { private static final String TAG = "DisableCarModeActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { IUiModeManager uiModeManager = IUiModeManager.Stub.asInterface( ServiceManager.getService("uimode")); uiModeManager.disableCarMode(); } catch (RemoteException e) { Log.e(TAG, "Failed to disable car mode", e); } finish(); } }
core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1252,6 +1252,10 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="com.android.internal.app.DisableCarModeActivity" android:theme="@style/Theme.NoDisplay" android:excludeFromRecents="true"> </activity> <activity android:name="com.android.internal.app.RingtonePickerActivity" android:theme="@style/Theme.Dialog.Alert" android:excludeFromRecents="true" Loading