• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.settings.applications;
18 
19 import android.content.Intent;
20 import android.net.Uri;
21 import android.os.Bundle;
22 import android.util.FeatureFlagUtils;
23 
24 import com.android.settings.SettingsActivity;
25 import com.android.settings.applications.appinfo.AppInfoDashboardFragment;
26 import com.android.settings.spa.SpaActivity;
27 import com.android.settings.spa.app.appinfo.AppInfoSettingsProvider;
28 
29 public class InstalledAppDetailsTop extends SettingsActivity {
30 
31     @Override
onCreate(Bundle savedState)32     protected void onCreate(Bundle savedState) {
33         super.onCreate(savedState);
34         if (isFinishing() ||
35                 !FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_ENABLE_SPA)) {
36             return;
37         }
38         Uri data = super.getIntent().getData();
39         if (data != null) {
40             String packageName = data.getSchemeSpecificPart();
41             String route = AppInfoSettingsProvider.INSTANCE.getRoute(packageName, getUserId());
42             SpaActivity.startSpaActivity(this, route);
43         }
44         finish();
45     }
46 
47     @Override
getIntent()48     public Intent getIntent() {
49         Intent modIntent = new Intent(super.getIntent());
50         modIntent.putExtra(EXTRA_SHOW_FRAGMENT, AppInfoDashboardFragment.class.getName());
51         return modIntent;
52     }
53 
54     @Override
isValidFragment(String fragmentName)55     protected boolean isValidFragment(String fragmentName) {
56         return AppInfoDashboardFragment.class.getName().equals(fragmentName);
57     }
58 }
59